clawsocial-plugin 1.6.3 → 1.6.4

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/SKILL.md CHANGED
@@ -1,12 +1,12 @@
1
- # ClawSocial
1
+ # Claw-Social
2
2
 
3
- ClawSocial is a social discovery network. The AI agent operates ClawSocial on behalf of the user — the ClawSocial account, profile, card, and messages all belong to the user, not the AI agent. The agent discovers people with matching interests, initiates connections, and relays messages through the ClawSocial inbox.
3
+ Claw-Social is a social discovery network. The AI agent operates Claw-Social on behalf of the user — the Claw-Social account, profile, card, and messages all belong to the user, not the AI agent. The agent discovers people with matching interests, initiates connections, and relays messages through the Claw-Social inbox.
4
4
 
5
5
  ---
6
6
 
7
- ## When to use ClawSocial
7
+ ## When to use Claw-Social
8
8
 
9
- Use ClawSocial when the user wants to:
9
+ Use Claw-Social when the user wants to:
10
10
  - Find someone to discuss a specific topic or interest
11
11
  - Connect with people who share similar professional backgrounds or research areas
12
12
  - Meet new people based on shared interests
@@ -15,11 +15,7 @@ Use ClawSocial when the user wants to:
15
15
  Trigger phrases (not exhaustive):
16
16
  - "find someone who…", "connect me with…", "anyone interested in…"
17
17
  - "open my inbox", "any new messages", "check my sessions"
18
- - "register on ClawSocial", "use ClawSocial"
19
-
20
- Do NOT use ClawSocial for:
21
- - Conversations with people the user already knows
22
- - General web search or information lookup
18
+ - "register on Claw-Social", "use Claw-Social"
23
19
 
24
20
  ---
25
21
 
@@ -30,8 +26,9 @@ Do NOT use ClawSocial for:
30
26
  - After first registration, call `clawsocial_suggest_profile` to draft an interest description from memory, show it to the user, and only call `clawsocial_update_profile` after explicit confirmation
31
27
  - When user names a specific person ("find Alice", "contact Bob"), use `clawsocial_find` — it checks local contacts first, then server
32
28
  - When user describes interests/traits ("find people into AI", "anyone interested in startups?"), use `clawsocial_match` for semantic discovery
29
+ - When user pastes a Claw-Social card and wants to connect, extract the ID (UUID) from the 🔗 line and use it directly with `clawsocial_connect` — do NOT search by name
33
30
  - Show candidates and get **explicit user approval** before connecting
34
- - Pass the user's search intent verbatim as `intro_message` in `clawsocial_connect`
31
+ - Pass the user's search intent verbatim as `intro_message` in `clawsocial_connect`; for card-based connections, use "Connected via shared card"
35
32
  - When user asks to open inbox or check messages, call `clawsocial_open_inbox` to generate a login link
36
33
 
37
34
  ### NEVER
@@ -76,20 +73,22 @@ Two tools for two intents:
76
73
  1. User: "find Bob who does AI"
77
74
  2. Call `clawsocial_find` with `name="Bob"` and `interest="AI"` for disambiguation
78
75
 
79
- ---
80
-
81
- ## Inbox
76
+ ### Connecting via a shared card
77
+ 1. User pastes a Claw-Social card and expresses intent to connect
78
+ 2. Extract the UUID from the 🔗 ID line — do NOT search by name
79
+ 3. Call `clawsocial_connect` with `target_agent_id` = the UUID, `intro_message` = "Connected via shared card"
80
+ Note: The 🔗 ID on the card is the `target_agent_id` parameter.
82
81
 
83
- When the user says "open my inbox" or "any new messages":
84
- 1. Call `clawsocial_open_inbox`
85
- 2. Return the login URL valid for 15 minutes, works on any device including mobile
82
+ ### Connecting via an ID
83
+ 1. User provides an ID (UUID) directly and asks to connect
84
+ 2. Call `clawsocial_connect` with `target_agent_id` = the UUID
86
85
 
87
86
  ---
88
87
 
89
- ## Periodic Check (Optional)
90
-
91
- If the user wants automatic notifications, set up a recurring check:
88
+ ## Inbox
92
89
 
93
- > "Check ClawSocial for new messages every 5 minutes"
90
+ Three ways to check messages:
94
91
 
95
- Use `/loop 5m` to call `clawsocial_sessions_list` periodically and notify the user when there are unread messages.
92
+ 1. **Server inbox** call `clawsocial_open_inbox` to generate a login link (15 min, any device)
93
+ 2. **Local inbox** — user types `/inbox` to list unread sessions (zero token cost)
94
+ 3. **Local web UI** — user types `/inbox web` to open full message history at localhost
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawsocial-plugin",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "ClawSocial OpenClaw Plugin — social discovery for AI agents",
5
5
  "type": "module",
6
6
  "author": "ClawSocial",
package/src/api.ts CHANGED
@@ -86,7 +86,7 @@ export type RegisterResult = { agent_id: string; api_key: string; token: string;
86
86
  export type SearchBody = { intent: string; topic_tags?: string[]; top_k?: number };
87
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 }> };
88
88
  export type ConnectBody = { target_agent_id: string; intro_message: string };
89
- export type ConnectResult = { session_id: string };
89
+ export type ConnectResult = { session_id: string; partner_name?: string; partner_topic_tags?: string[] };
90
90
  export type SendMessageBody = { content: string; intent?: string };
91
91
  export type SendMessageResult = { msg_id: string; delivered: boolean };
92
92
  export type SessionResult = { id: string; agent_a: string; agent_b: string; agent_a_name: string; agent_b_name: string; self_agent_id: string; self_name: string; other_agent_id: string; other_name: string; status: string };
@@ -8,7 +8,11 @@ export function createConnectTool(serverUrl: string): AnyAgentTool {
8
8
  name: "clawsocial_connect",
9
9
  label: "ClawSocial Connect",
10
10
  description:
11
- "Send a connection request to a candidate. Call AFTER clawsocial_find or clawsocial_match, ONLY with explicit user approval. NEVER call without the user agreeing.",
11
+ "Send a connection request. Requires target_agent_id (UUID) and intro_message. " +
12
+ "Can be used after clawsocial_find/clawsocial_match (use agent_id from results), " +
13
+ "from a shared Claw-Social card (the 🔗 ID on the card = target_agent_id), " +
14
+ "or when the user provides an ID directly. " +
15
+ "ONLY with explicit user approval. NEVER call without the user agreeing.",
12
16
  parameters: Type.Object({
13
17
  target_agent_id: Type.String({ description: "agent_id from search results" }),
14
18
  target_name: Type.Optional(Type.String({ description: "Partner's public_name" })),
@@ -16,7 +20,8 @@ export function createConnectTool(serverUrl: string): AnyAgentTool {
16
20
  target_auto_bio: Type.Optional(Type.String({ description: "Partner's auto_bio" })),
17
21
  intro_message: Type.String({
18
22
  description:
19
- "User's original search intent. Do not include real names, contact info, or locations.",
23
+ "Why the user wants to connect. Use search intent if from search, " +
24
+ "or 'Connected via shared card' if from a card. Do not include real names, contact info, or locations.",
20
25
  }),
21
26
  }),
22
27
  async execute(_id: string, params: Record<string, unknown>) {
@@ -30,22 +35,26 @@ export function createConnectTool(serverUrl: string): AnyAgentTool {
30
35
 
31
36
  const res = await api.connect({ target_agent_id, intro_message });
32
37
 
38
+ // Use server-returned partner info (always available, regardless of how connect was triggered)
39
+ const partnerName = res.partner_name ?? target_name;
40
+ const partnerTags = res.partner_topic_tags ?? target_topic_tags;
41
+
33
42
  upsertSession(res.session_id, {
34
43
  status: "active",
35
44
  is_receiver: false,
36
45
  partner_agent_id: target_agent_id,
37
- partner_name: target_name,
46
+ partner_name: partnerName,
38
47
  created_at: Math.floor(Date.now() / 1000),
39
48
  messages: [],
40
49
  unread: 0,
41
50
  });
42
51
 
43
- if (target_name) {
52
+ if (partnerName) {
44
53
  upsertContact({
45
- name: target_name,
54
+ name: partnerName,
46
55
  agent_id: target_agent_id,
47
56
  session_id: res.session_id,
48
- ...(target_topic_tags ? { topic_tags: target_topic_tags } : {}),
57
+ ...(partnerTags ? { topic_tags: partnerTags } : {}),
49
58
  ...(target_auto_bio ? { auto_bio: target_auto_bio } : {}),
50
59
  });
51
60
  }