antenna-openclaw-plugin 0.5.0 → 0.6.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/index.ts CHANGED
@@ -448,6 +448,39 @@ export default function register(api: any) {
448
448
  },
449
449
  });
450
450
 
451
+ // ═══════════════════════════════════════════════════════════════════
452
+ // Tool: antenna_bind
453
+ // ═══════════════════════════════════════════════════════════════════
454
+ api.registerTool({
455
+ name: "antenna_bind",
456
+ description:
457
+ "Generate a GPS binding link. Send this URL to the user so they can share their phone's location via the web browser at antenna.fyi.",
458
+ parameters: {
459
+ type: "object",
460
+ properties: {
461
+ sender_id: { type: "string", description: "The sender's user ID" },
462
+ channel: { type: "string", description: "The channel name" },
463
+ },
464
+ required: ["sender_id", "channel"],
465
+ },
466
+ async execute(_id: string, params: any) {
467
+ const cfg = getConfig(api);
468
+ const supabase = getSupabase(cfg);
469
+ const deviceId = deriveDeviceId(params.sender_id, params.channel);
470
+
471
+ const { data, error } = await supabase.rpc("create_bind_token", { p_device_id: deviceId });
472
+ if (error) return ok({ error: error.message });
473
+
474
+ const token = data?.token;
475
+ const baseUrl = "https://www.antenna.fyi";
476
+ return ok({
477
+ token,
478
+ url: `${baseUrl}/locate?token=${token}`,
479
+ message: "发送这个链接给用户,在手机浏览器打开即可共享位置。",
480
+ });
481
+ },
482
+ });
483
+
451
484
  // ═══════════════════════════════════════════════════════════════════
452
485
  // Tool: antenna_check_matches
453
486
  // ═══════════════════════════════════════════════════════════════════
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antenna-openclaw-plugin",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Antenna — agent-mediated nearby people discovery for OpenClaw",
5
5
  "openclaw": {
6
6
  "extensions": ["./index.ts"]
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: antenna
3
- description: "Nearby people discovery via Antenna. Use when a user shares location, asks who's nearby, wants to set up their profile card, or interacts with match results. Handles location-based social discovery through the antenna_scan, antenna_profile, antenna_accept, and antenna_check_matches tools."
3
+ description: "Nearby people discovery via Antenna. Use when a user shares location, asks who's nearby, wants to set up their profile card, or interacts with match results. Handles location-based social discovery through the antenna_scan, antenna_profile, antenna_accept, antenna_check_matches, and antenna_bind tools."
4
4
  metadata: { "openclaw": { "always": true } }
5
5
  ---
6
6
 
@@ -20,9 +20,20 @@ Plugin 安装后,agent 应该**主动**开始引导,不要等用户问"怎
20
20
  **第二步:聊天式填名片**(见下方详细流程)
21
21
 
22
22
  **第三步:名片存好后,要位置**
23
- > "名片存好了 ✅ 现在发个位置给我——在 Telegram/WhatsApp 里点位置分享就行。我帮你看看附近有谁值得认识。"
24
23
 
25
- **关键:名片先于位置。** 没有名片就扫描,附近的人看不到你的信息,匹配质量也差。
24
+ 名片保存后,**立刻**帮用户获取位置。有两种方式,优先用第一种:
25
+
26
+ **方式 1:生成绑定链接(推荐)**
27
+ 调用 `antenna_bind` 生成链接,发给用户:
28
+ > "名片存好了 ✅ 点这个链接,在手机浏览器打开,允许定位就行:
29
+ > [链接]
30
+ > 我收到你的位置后会自动帮你看看附近有谁。"
31
+
32
+ **方式 2:直接发位置消息**
33
+ 如果用户在 Telegram/WhatsApp 里,可以直接发位置:
34
+ > "或者你也可以直接在聊天里点位置分享发给我。"
35
+
36
+ **关键:名片存好后必须主动要位置,不要等用户问。**
26
37
 
27
38
  ## When to use
28
39
 
@@ -72,6 +83,13 @@ Check for mutual matches and contact info updates.
72
83
  - `sender_id`, `channel`
73
84
  - Returns mutual matches with any contact info the other person shared
74
85
 
86
+ ### `antenna_bind`
87
+ Generate a GPS binding link. Call this after profile is created to get the user's location.
88
+ - `sender_id`, `channel`: from context
89
+ - Returns a URL like `https://www.antenna.fyi/locate?token=xxx`
90
+ - Send this link to the user — they open it on their phone, allow GPS, and their location is automatically shared with Supabase
91
+ - **Always call this right after saving the profile** — don't wait for the user to ask
92
+
75
93
  ## Behavior guidelines
76
94
 
77
95
  ### First-time user — 聊天式引导(不要让用户填表)