antenna-fyi 1.3.22 → 1.3.23

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/lib/core.js CHANGED
@@ -558,6 +558,81 @@ export async function discover({ device_id, supabaseUrl, supabaseKey }) {
558
558
  };
559
559
  }
560
560
 
561
+ // ─── initialRecommendations (one-time first-use) ──────────────────────
562
+
563
+ export async function initialRecommendations({ device_id, supabaseUrl, supabaseKey }) {
564
+ const sb = getClient(supabaseUrl, supabaseKey);
565
+
566
+ const { data: results, error } = await sb.rpc("initial_recommendations", {
567
+ p_device_id: device_id,
568
+ p_limit: 3,
569
+ });
570
+
571
+ if (error) throw new Error(error.message);
572
+
573
+ if (!results || results.length === 0) {
574
+ return {
575
+ count: 0,
576
+ profiles: [],
577
+ initial: true,
578
+ message: "暂时没有推荐,等有更多人加入!",
579
+ };
580
+ }
581
+
582
+ // Build ref map + generate match reasons
583
+ const _refMap = {};
584
+ const myProfile = await getProfile({ device_id, supabaseUrl, supabaseKey });
585
+ const myLines = myProfile ? [myProfile.line1, myProfile.line2, myProfile.line3].filter(Boolean).join(". ") : "";
586
+
587
+ const profiles = [];
588
+ for (let i = 0; i < results.length; i++) {
589
+ const p = results[i];
590
+ const ref = String(i + 1);
591
+ _refMap[ref] = p.device_id;
592
+
593
+ const theirLines = [p.line1, p.line2, p.line3].filter(Boolean).join(". ");
594
+ let reason = null;
595
+ if (myLines && theirLines) {
596
+ reason = await generateMatchReason(myLines, theirLines);
597
+ }
598
+
599
+ profiles.push({
600
+ ref,
601
+ name: p.display_name || "匿名",
602
+ emoji: p.emoji || "👤",
603
+ personal_description: p.line1,
604
+ looking_for: p.line2,
605
+ conversation_style: p.line3,
606
+ more_information: p.matching_context || null,
607
+ profile_slug: p.profile_slug || null,
608
+ match_reason: reason,
609
+ });
610
+ }
611
+
612
+ // Log who was recommended (for dedup in daily discover)
613
+ for (const p of results) {
614
+ await sb.rpc("log_recommendation", {
615
+ p_device_id: device_id,
616
+ p_recommended_id: p.device_id,
617
+ });
618
+ }
619
+
620
+ // Persist ref map to DB
621
+ if (device_id && Object.keys(_refMap).length > 0) {
622
+ try {
623
+ await sb.rpc("save_scan_refs", { p_owner: device_id, p_refs: _refMap });
624
+ } catch { /* best effort */ }
625
+ }
626
+
627
+ return {
628
+ count: profiles.length,
629
+ profiles,
630
+ _ref_map: _refMap,
631
+ initial: true,
632
+ message: "这是你的首次推荐——基于你的名片,这几个人跟你最匹配。",
633
+ };
634
+ }
635
+
561
636
  // ─── pass ───────────────────────────────────────────────────────────
562
637
 
563
638
  export async function pass({ device_id, target_device_id, ref, supabaseUrl, supabaseKey }) {
@@ -402,3 +402,21 @@ LINK_ACCOUNT_SCHEMA = {
402
402
  "required": ["sender_id", "channel", "chat_id", "user_id"],
403
403
  },
404
404
  }
405
+
406
+ INITIAL_RECOMMENDATIONS_SCHEMA = {
407
+ "name": "antenna_initial_recommendations",
408
+ "description": (
409
+ "Get initial recommendations for a new user \u2014 2-3 people most similar to them. "
410
+ "One-time only, does NOT consume daily discover quota. "
411
+ "Use right after profile creation in onboarding."
412
+ ),
413
+ "parameters": {
414
+ "type": "object",
415
+ "properties": {
416
+ "sender_id": {"type": "string", "description": "The sender's user ID"},
417
+ "channel": {"type": "string", "description": "Platform name (any platform works)"},
418
+ "chat_id": {"type": "string", "description": "REQUIRED for notifications. Pass chat/channel ID from message context."},
419
+ },
420
+ "required": ["sender_id", "channel", "chat_id"],
421
+ },
422
+ }
@@ -735,3 +735,81 @@ def handle_link_account(params: dict) -> str:
735
735
  data = resp.data or {}
736
736
  data["message"] = "账号已关联!现在你可以在 antenna.fyi/me 看到你的完整 profile 和匹配记录了。"
737
737
  return _ok(data)
738
+
739
+
740
+ def handle_initial_recommendations(params: dict) -> str:
741
+ """Get initial recommendations for a new user (2-3 people). One-time only."""
742
+ sb = _sb()
743
+ did = _device_id(params["sender_id"], params["channel"], params.get("chat_id"))
744
+
745
+ resp = sb.rpc("initial_recommendations", {
746
+ "p_device_id": did,
747
+ "p_limit": 3,
748
+ }).execute()
749
+ results = resp.data or []
750
+
751
+ if not results:
752
+ return _ok({"count": 0, "profiles": [], "initial": True, "message": "暂时没有推荐,等有更多人加入!"})
753
+
754
+ global _last_ref_map
755
+ _last_ref_map = {}
756
+ profiles = []
757
+
758
+ # Get my profile for match reason
759
+ my_prof = sb.rpc("get_profile", {"p_device_id": did}).execute()
760
+ my_data = my_prof.data or {}
761
+ my_lines = [my_data.get("line1", ""), my_data.get("line2", ""), my_data.get("line3", "")]
762
+
763
+ ref_map = {}
764
+ for i, p in enumerate(results):
765
+ ref = str(i + 1)
766
+ _last_ref_map[ref] = p.get("device_id")
767
+ ref_map[ref] = p.get("device_id")
768
+
769
+ their_lines = [p.get("line1", ""), p.get("line2", ""), p.get("line3", "")]
770
+
771
+ # Generate match reason via Edge Function
772
+ match_reason = None
773
+ try:
774
+ req = urllib.request.Request(
775
+ f"{BUILTIN_URL}/functions/v1/generate-match-reason",
776
+ data=json.dumps({"my_lines": my_lines, "their_lines": their_lines}).encode(),
777
+ headers={"Content-Type": "application/json", "Authorization": f"Bearer {BUILTIN_KEY}"},
778
+ )
779
+ res = urllib.request.urlopen(req, timeout=10)
780
+ body = json.loads(res.read().decode())
781
+ match_reason = body.get("reason")
782
+ except Exception:
783
+ pass
784
+
785
+ profile = {
786
+ "ref": ref,
787
+ "emoji": p.get("emoji") or "\ud83d\udc64",
788
+ "name": p.get("display_name") or "匿名",
789
+ "personal_description": p.get("line1"),
790
+ "looking_for": p.get("line2"),
791
+ "conversation_style": p.get("line3"),
792
+ "more_information": p.get("matching_context") or None,
793
+ "profile_slug": p.get("profile_slug") or None,
794
+ }
795
+ if match_reason:
796
+ profile["match_reason"] = match_reason
797
+ profiles.append(profile)
798
+
799
+ # Save refs and log recommendations
800
+ try:
801
+ sb.rpc("save_scan_refs", {"p_owner": did, "p_refs": ref_map}).execute()
802
+ except Exception:
803
+ pass
804
+ for p in results:
805
+ try:
806
+ sb.rpc("log_recommendation", {"p_device_id": did, "p_recommended_id": p["device_id"]}).execute()
807
+ except Exception:
808
+ pass
809
+
810
+ return _ok({
811
+ "count": len(profiles),
812
+ "profiles": profiles,
813
+ "initial": True,
814
+ "message": "这是你的首次推荐——基于你的名片,这几个人跟你最匹配。",
815
+ })
package/lib/mcp.js CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  checkin,
14
14
  createBindToken,
15
15
  discover,
16
+ initialRecommendations,
16
17
  createEvent,
17
18
  endEvent,
18
19
  eventCheckin,
@@ -258,6 +259,31 @@ export async function startMcpServer() {
258
259
  }
259
260
  );
260
261
 
262
+ // ─── antenna_initial_recommendations ─────────────────────────
263
+
264
+ server.tool(
265
+ "antenna_initial_recommendations",
266
+ "Get initial recommendations for a new user — 2-3 people most similar to them. One-time only, does NOT consume daily discover quota. Use right after profile creation in onboarding.",
267
+ {
268
+ sender_id: z.string().describe("The sender's user ID"),
269
+ channel: z.string().describe("Channel name"),
270
+ chat_id: z.string().optional().describe("Chat/channel ID for notifications"),
271
+ },
272
+ async ({ sender_id, channel, chat_id }) => {
273
+ try {
274
+ const result = await initialRecommendations({ device_id: deriveDeviceId(sender_id, channel) });
275
+ if (result._ref_map) {
276
+ _lastRefMap = result._ref_map;
277
+ const { _ref_map, ...clean } = result;
278
+ return jsonResult(clean);
279
+ }
280
+ return jsonResult(result);
281
+ } catch (e) {
282
+ return jsonResult({ error: e.message });
283
+ }
284
+ }
285
+ );
286
+
261
287
  // ─── antenna_pass ────────────────────────────────────────────
262
288
 
263
289
  server.tool(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antenna-fyi",
3
- "version": "1.3.22",
3
+ "version": "1.3.23",
4
4
  "description": "Antenna \u2014 nearby people discovery. CLI + MCP server + OpenClaw skill & plugin, all in one package.",
5
5
  "type": "module",
6
6
  "bin": {
package/skill/SKILL.md CHANGED
@@ -1,157 +1,159 @@
1
1
  ---
2
2
  name: antenna
3
- description: "AI-native social discovery via Antenna. Use when a user wants to meet interesting people through nearby scan, global recommendations, profile links, or events. Handles profile management, matching, and contact exchange."
3
+ description: "AI-native social discovery via Antenna. Use when a user wants to meet interesting people - through nearby scan, global recommendations, profile links, or events. Handles profile management, matching, and contact exchange."
4
4
  metadata: { "openclaw": { "always": true } }
5
5
  ---
6
6
 
7
- # Antenna AI-Native Social Discovery
7
+ # Antenna - AI-Native Social Discovery
8
8
 
9
- Antenna 帮你的用户发现值得认识的人。不只是"附近的人"——profile link、全球推荐、活动,都是发现路径。
9
+ Antenna 帮你的用户发现值得认识的人。不只是"附近的人"--profile link、全球推荐、活动,都是发现路径。
10
10
 
11
- **核心流程:发现 → 判断 → accept → 交换联系方式。**
11
+ **核心流程:发现 → 判断 → accept → 交换联系方式。**
12
12
 
13
- 发现可以来自任何渠道:
14
- - 📡 **附近扫描** `antenna_scan`,基于 GPS 的周边发现
15
- - 🌍 **全球推荐** `antenna_discover`,每天 1 个最匹配的人
16
- - 🔗 **Profile 链接** 用户收到 `antenna.fyi/p/xxx` 链接,agent 读取后直接 accept
17
- - 🎪 **活动** `antenna_event_scan`,同一个活动里的人
13
+ 发现可以来自任何渠道:
14
+ - 📡 **附近扫描** - `antenna_scan`,基于 GPS 的周边发现
15
+ - 🌍 **全球推荐** - `antenna_discover`,每天 1 个最匹配的人
16
+ - 🔗 **Profile 链接** - 用户收到 `antenna.fyi/p/xxx` 链接,agent 读取后直接 accept
17
+ - 🎪 **活动** - `antenna_event_scan`,同一个活动里的人
18
18
 
19
- **Accept 不需要先 scan。** 只要你知道对方的 `ref`、`profile_slug` 或 `device_id`,就可以直接 accept。
19
+ **Accept 不需要先 scan。** 只要你知道对方的 `ref`、`profile_slug` 或 `device_id`,就可以直接 accept。
20
20
 
21
21
  ## How to call Antenna
22
22
 
23
- - 如果有 Antenna plugin toolsantenna_scan, antenna_profile 等),直接用。
24
- - 如果没有,用 CLI:`antenna <command> [flags]`。
25
- - **所有 tool 必须传 `chat_id`**——Antenna 用它发通知。
23
+ - 如果有 Antenna plugin tools(antenna_scan, antenna_profile 等),直接用。
24
+ - 如果没有,用 CLI:`antenna <command> [flags]`。
25
+ - **所有 tool 必须传 `chat_id`**--Antenna 用它发通知。
26
26
 
27
- ## Onboarding 装上后主动引导
27
+ ## Onboarding - 装上后主动引导
28
28
 
29
- Plugin 安装后,agent **主动**开始引导,不要等用户问。
29
+ Plugin 安装后,agent **主动**开始引导,不要等用户问。
30
30
 
31
- **前置条件:** 用户需要先在 antenna.fyi 注册账号,从 Dashboard 获取 API key。如果没注册,引导去 antenna.fyi。
31
+ **前置条件:** 用户需要先在 antenna.fyi 注册账号,从 Dashboard 获取 API key。如果没注册,引导去 antenna.fyi。
32
32
 
33
33
  ### 流程
34
34
 
35
- **第一步:打招呼 + 解释**
36
- > "嘿,你装了 Antenna——它能帮你发现有意思的人。先确认一下,你在 antenna.fyi 注册过了吗?拿到 API key 了吗?"
35
+ **第一步:打招呼 + 解释**
36
+ > "嘿,你装了 Antenna--它能帮你发现有意思的人。先确认一下,你在 antenna.fyi 注册过了吗?拿到 API key 了吗?"
37
37
 
38
- **第二步:聊天收集 → 生成名片 → 确认**
38
+ **第二步:聊天收集 → 生成名片 → 确认**
39
39
 
40
- 跟用户聊几句,了解他们是谁、做什么、想认识什么人。然后 agent 自己生成:
41
- - more_information(~200 字,给 agent 匹配用的私密上下文,不展示给别人)
40
+ 跟用户聊几句,了解他们是谁、做什么、想认识什么人。然后 agent 自己生成:
41
+ - more_information(~200 字,给 agent 匹配用的私密上下文,不展示给别人)
42
42
  - 从中提炼 line1/2/3 + display_name
43
43
 
44
- 展示预览给用户确认:
45
- > 你的名片:
44
+ 展示预览给用户确认:
45
+ > 你的名片:
46
46
  > Yi
47
- > · Product Designer,做 AI 搜索体验
47
+ > · Product Designer,做 AI 搜索体验
48
48
  > · 对 AI agent、音乐、游泳感兴趣
49
49
  > · 想认识做 AI 产品和独立创作的人
50
50
  >
51
- > 这样可以吗?要改哪里告诉我。
51
+ > 这样可以吗?要改哪里告诉我。
52
52
 
53
53
  确认后才调 `antenna_profile(action="set")` 保存。**不要跳过确认。**
54
54
 
55
- **第三步:立刻推荐 2-3 个人**
55
+ **第三步:立刻推荐 2-3 个人**
56
56
 
57
- 名片存好后,**立刻**调 `antenna_discover` 获取全球推荐,让用户马上看到价值:
58
- > "名片存好了!我先帮你看看有谁跟你特别像——"
57
+ 名片存好后,**立刻**调 `antenna_initial_recommendations` 获取首次推荐:
58
+ > "名片存好了!我先帮你看看有谁跟你特别像--"
59
59
 
60
- **第四步:调 antenna_bind 获取 GPS 链接**
60
+ 这是一次性的首次推荐(不消耗每日 discover 额度)。如果返回空,说明还没有足够的用户--跳过这步,继续 antenna_bind。
61
61
 
62
- **强制。** 名片存好后**必须立刻**调用 `antenna_bind` 生成链接并发给用户:
63
- > "点这个链接,在手机浏览器打开,允许定位就行:[链接]"
62
+ **第四步:调 antenna_bind 获取 GPS 链接**
64
63
 
65
- GPS 不是 Antenna 的唯一入口,但它开启了附近发现的能力。
64
+ **强制。** 名片存好后**必须立刻**调用 `antenna_bind` 生成链接并发给用户:
65
+ > "点这个链接,在手机浏览器打开,允许定位就行:[链接]"
66
66
 
67
- **第五步:设置定时任务**
67
+ GPS 不是 Antenna 的唯一入口,但它开启了附近发现的能力。
68
68
 
69
- 设一个每小时检查匹配的 cron:
69
+ **第五步:设置定时任务**
70
+
71
+ 设一个每小时检查匹配的 cron:
70
72
  ```
71
73
  openclaw cron add --every 1h --message "Check antenna matches: call antenna_check_matches. If there are new mutual matches or incoming accepts, tell the user. If nothing new, reply HEARTBEAT_OK."
72
74
  ```
73
75
 
74
- **第六步:问要不要全球推荐**
75
- > "要我每天帮你找一个全球最像你的人吗?"
76
+ **第六步:问要不要全球推荐**
77
+ > "要我每天帮你找一个全球最像你的人吗?"
76
78
 
77
79
  ### Linking to antenna.fyi account
78
80
 
79
- 如果用户之前通过 agent 创建过 profile(没有网站账号),现在注册了 antenna.fyi
81
+ 如果用户之前通过 agent 创建过 profile(没有网站账号),现在注册了 antenna.fyi:
80
82
  1. 让用户从 antenna.fyi/me 复制 user ID
81
83
  2. 调 `antenna_link_account(user_id = "xxx")`
82
- 3. 确认:"关联成功!你现在可以在 dashboard 上看到完整的 profile 和匹配记录了。"
84
+ 3. 确认:"关联成功!你现在可以在 dashboard 上看到完整的 profile 和匹配记录了。"
83
85
 
84
- 这把 agent 创建的 profile(带全部历史)关联到网站账号。
86
+ 这把 agent 创建的 profile(带全部历史)关联到网站账号。
85
87
 
86
88
  ## When to use
87
89
 
88
- - **首次安装后**:主动 onboarding
90
+ - **首次安装后**:主动 onboarding
89
91
  - 用户分享位置 → `antenna_scan`
90
92
  - 用户问"附近有谁" → `antenna_scan`
91
- - 用户收到 profile 链接(`antenna.fyi/p/xxx`)→ 读取 profile → 判断 → `antenna_accept`
93
+ - 用户收到 profile 链接(`antenna.fyi/p/xxx`)→ 读取 profile → 判断 → `antenna_accept`
92
94
  - 用户想编辑名片 → `antenna_profile`
93
95
  - 用户说 accept / skip → `antenna_accept` / `antenna_pass`
94
96
  - 用户问匹配状态 → `antenna_check_matches`
95
97
 
96
98
  ## Discovery Paths
97
99
 
98
- ### 1. 附近扫描(antenna_scan
100
+ ### 1. 附近扫描(antenna_scan)
99
101
  基于 GPS 发现 1km 内的人。需要位置信息。
100
- - 如果没有 GPS,先调 `antenna_bind` 或让用户发位置
101
- - 返回 raw profile cards,**agent 判断谁值得推荐**
102
+ - 如果没有 GPS,先调 `antenna_bind` 或让用户发位置
103
+ - 返回 raw profile cards,**agent 判断谁值得推荐**
102
104
 
103
- ### 2. 全球推荐(antenna_discover
104
- 每天 1 个全球最匹配的人,不需要 GPS。
105
- - 用在日常 cron 里,或用户主动要求
105
+ ### 2. 全球推荐(antenna_discover)
106
+ 每天 1 个全球最匹配的人,不需要 GPS。
107
+ - 用在日常 cron 里,或用户主动要求
106
108
 
107
109
  ### 3. Profile 链接
108
- 用户收到 `antenna.fyi/p/xxx` 链接时:
109
- 1. 用 `web_fetch` 读取页面——页面里有 `<script id="antenna-profile-data">` JSON,包含完整 profile
110
+ 用户收到 `antenna.fyi/p/xxx` 链接时:
111
+ 1. 用 `web_fetch` 读取页面--页面里有 `<script id="antenna-profile-data">` JSON,包含完整 profile
110
112
  2. 读取 more_information、interest_tags、个人描述等
111
- 3. 结合你对用户的了解,判断是否推荐
113
+ 3. 结合你对用户的了解,判断是否推荐
112
114
  4. 如果用户想 accept → 调 `antenna_accept(profile_slug="xxx")`
113
115
 
114
116
  **不需要先 scan。** Profile 链接是独立的发现路径。
115
117
 
116
- ### 4. 活动(Events
118
+ ### 4. 活动(Events)
117
119
  同一个活动里的人。详见 EVENTS.md。
118
120
 
119
121
  ## Tools
120
122
 
121
123
  ### `antenna_scan`
122
- 扫描附近的人和活动。**只读——不会更新你的位置。**
123
- - `lat`, `lng`:坐标(可选,没有的话用已绑定的 GPS
124
- - `radius_m`:搜索半径(默认 500m,最大 1000m
125
- - `sender_id`, `channel`, `chat_id`:必填
126
- - 返回 `profiles`(附近的人)+ `nearby_events`(5km 内的活动)
127
- - 每个 profile 包含 `ref`(用于 accept)、`profile_slug`(公开链接)、`more_information`(匹配上下文)
124
+ 扫描附近的人和活动。**只读--不会更新你的位置。**
125
+ - `lat`, `lng`:坐标(可选,没有的话用已绑定的 GPS)
126
+ - `radius_m`:搜索半径(默认 500m,最大 1000m)
127
+ - `sender_id`, `channel`, `chat_id`:必填
128
+ - 返回 `profiles`(附近的人)+ `nearby_events`(5km 内的活动)
129
+ - 每个 profile 包含 `ref`(用于 accept)、`profile_slug`(公开链接)、`more_information`(匹配上下文)
128
130
 
129
- **GPS 时效:** 如果 `last_seen_at` 超过 2 小时,提示用户更新位置。
131
+ **GPS 时效:** 如果 `last_seen_at` 超过 2 小时,提示用户更新位置。
130
132
 
131
133
  ### `antenna_profile`
132
134
  查看或更新用户名片。
133
- - `action`:"get" 或 "set"
135
+ - `action`:"get" 或 "set"
134
136
  - `sender_id`, `channel`, `chat_id`
135
- - "set" 时传:`display_name`, `line1`, `line2`, `line3`, `visible`, `matching_context`
137
+ - "set" 时传:`display_name`, `line1`, `line2`, `line3`, `visible`, `matching_context`
136
138
 
137
- 名片内容:
138
- - **display_name**:显示名称
139
- - **line1**:个人描述(谁 / 做什么)
140
- - **line2**:想认识的人
141
- - **line3**:想要的交流方式
142
- - **matching_context**(more_information,不展示给别人):agent 基于对用户的了解生成的详细描述,~200 字。**这是匹配的核心数据源。** line1/2/3 从它提炼出来,不是反过来。
139
+ 名片内容:
140
+ - **display_name**:显示名称
141
+ - **line1**:个人描述(谁 / 做什么)
142
+ - **line2**:想认识的人
143
+ - **line3**:想要的交流方式
144
+ - **matching_context**(more_information,不展示给别人):agent 基于对用户的了解生成的详细描述,~200 字。**这是匹配的核心数据源。** line1/2/3 从它提炼出来,不是反过来。
143
145
 
144
146
  ### `antenna_accept`
145
- 接受一个匹配。**不需要先 scan**——任何发现路径都可以触发 accept。
146
- - `sender_id`, `channel`, `chat_id`:必填
147
- - 三种方式指定对方(任选一种):
148
- - `ref`:来自 scan/discover 结果的编号
149
- - `profile_slug`:来自 profile 链接(如 `antenna.fyi/p/yi` → `profile_slug="yi"`)
150
- - `target_device_id`:内部 ID(尽量用 ref 或 slug
151
- - `contact_info`(可选):分享联系方式
147
+ 接受一个匹配。**不需要先 scan**--任何发现路径都可以触发 accept。
148
+ - `sender_id`, `channel`, `chat_id`:必填
149
+ - 三种方式指定对方(任选一种):
150
+ - `ref`:来自 scan/discover 结果的编号
151
+ - `profile_slug`:来自 profile 链接(如 `antenna.fyi/p/yi` → `profile_slug="yi"`)
152
+ - `target_device_id`:内部 ID(尽量用 ref 或 slug)
153
+ - `contact_info`(可选):分享联系方式
152
154
 
153
155
  ### `antenna_pass`
154
- 跳过一个人,不再推荐。
156
+ 跳过一个人,不再推荐。
155
157
  - `sender_id`, `channel`, `chat_id`
156
158
  - `ref` 或 `target_device_id`
157
159
 
@@ -163,68 +165,75 @@ openclaw cron add --every 1h --message "Check antenna matches: call antenna_chec
163
165
  ### `antenna_bind`
164
166
  生成 GPS 绑定链接。
165
167
  - `sender_id`, `channel`, `chat_id`
166
- - `purpose`:`'profile'`(默认,更新用户位置)或 `'event'`(设活动位置)
167
- - `event_code`:purpose=event 时必填
168
- - 返回 URL,用户在手机打开后自动共享位置
168
+ - `purpose`:`'profile'`(默认,更新用户位置)或 `'event'`(设活动位置)
169
+ - `event_code`:purpose=event 时必填
170
+ - 返回 URL,用户在手机打开后自动共享位置
169
171
  - **Onboarding 后必须调用。** 不要等用户问。
170
172
 
171
173
  ### `antenna_link_account`
172
174
  关联 agent profile 到 antenna.fyi 网站账号。
173
- - `sender_id`, `channel`, `chat_id`:必填
174
- - `user_id`:用户的 antenna.fyi 账号 UUID(从 dashboard 获取)
175
- - 把已有的 agent profile(带全部历史)绑定到网站账号
176
- - 如果用户先在网站注册了(产生空 profile),空 profile 自动删除
175
+ - `sender_id`, `channel`, `chat_id`:必填
176
+ - `user_id`:用户的 antenna.fyi 账号 UUID(从 dashboard 获取)
177
+ - 把已有的 agent profile(带全部历史)绑定到网站账号
178
+ - 如果用户先在网站注册了(产生空 profile),空 profile 自动删除
177
179
  - 一次性操作
178
180
 
179
181
  ### `antenna_discover`
180
182
  全球推荐——每天 1 个最匹配的人。
181
183
  - `sender_id`, `channel`, `chat_id`
182
184
  - 不需要 GPS
183
- - 如果所有人都推荐过了,返回"等新人加入"
185
+ - 如果所有人都推荐过了,返回“等新人加入”
186
+
187
+ ### `antenna_initial_recommendations`
188
+ 首次推荐——注册后立刻看到 2-3 个最匹配的人。
189
+ - `sender_id`, `channel`, `chat_id`: from context
190
+ - One-time only — second call returns empty
191
+ - Does NOT consume daily discover quota
192
+ - Use in onboarding step 3, right after profile save
184
193
 
185
194
  ### `antenna_checkin`
186
- 签到——更新你的位置。
187
- - `lat`, `lng`:必填
195
+ 签到--更新你的位置。
196
+ - `lat`, `lng`:必填
188
197
  - `sender_id`, `channel`, `chat_id`
189
- - `place_name`:可选
198
+ - `place_name`:可选
190
199
  - 用于"我在 XX"场景
191
200
 
192
201
  ## GPS Logic
193
202
 
194
- **Profile GPS** 用户的位置
203
+ **Profile GPS** - 用户的位置
195
204
  - 通过 `antenna_bind(purpose="profile")` 或 `antenna_checkin` 更新
196
205
  - 位置不原始存储
197
- - 2 小时后概念上过期,agent 应提示刷新
206
+ - 2 小时后概念上过期,agent 应提示刷新
198
207
 
199
- **Event GPS** 活动的位置
208
+ **Event GPS** - 活动的位置
200
209
  - 通过 `antenna_bind(purpose="event")` 或 `antenna_event_create(lat, lng)` 设置
201
- - 精确坐标(不模糊)
210
+ - 精确坐标(不模糊)
202
211
  - 不过期
203
212
 
204
213
  ## Behavior Guidelines
205
214
 
206
215
  ### 名片创建原则
207
- - **不要让用户填表。** 跟用户聊天,你来生成。
216
+ - **不要让用户填表。** 跟用户聊天,你来生成。
208
217
  - **每次只问一个问题。**
209
218
  - **用户说的原话尽量保留。** 帮缩短但让用户确认。
210
219
  - **不要在名片里写联系方式。** 联系方式在 accept 时分享。
211
220
  - **line1 必填。**
212
221
  - **确认后才存。**
213
222
 
214
- ### Showing results 你来判断
223
+ ### Showing results - 你来判断
215
224
 
216
- scan 和 discover 返回的是 raw profile cards,**没有打分**。你需要:
225
+ scan 和 discover 返回的是 raw profile cards,**没有打分**。你需要:
217
226
  1. 读每个人的名片 + more_information
218
227
  2. 结合你对用户的全部了解判断谁值得推荐
219
228
  3. 为每个推荐的人写一句**个性化的理由**
220
229
  4. **不要推荐所有人。** 质量 > 数量。
221
230
 
222
- **全球推荐 fallback:** 如果 scan 结果有 `global: true`,说明附近没人。告诉用户"附近暂时没人,但全球有这个人跟你很像"。
231
+ **全球推荐 fallback:** 如果 scan 结果有 `global: true`,说明附近没人。告诉用户"附近暂时没人,但全球有这个人跟你很像"。
223
232
 
224
233
  ### Profile 链接场景
225
234
 
226
- 用户收到或提到 `antenna.fyi/p/xxx` 时:
227
- 1. 抓取页面,读 `#antenna-profile-data` JSON
235
+ 用户收到或提到 `antenna.fyi/p/xxx` 时:
236
+ 1. 抓取页面,读 `#antenna-profile-data` JSON
228
237
  2. 展示对方 profile + 你的判断
229
238
  3. 用户想 accept → `antenna_accept(profile_slug="xxx")`
230
239
  4. 用户想 skip → `antenna_pass` 或直接不操作
@@ -232,43 +241,43 @@ scan 和 discover 返回的是 raw profile cards,**没有打分**。你需要
232
241
  **这跟 scan 是完全平级的发现路径。**
233
242
 
234
243
  ### Accepting & contact exchange
235
- accept 可以从任何路径触发:
236
- 1. 调 `antenna_accept`(用 ref、profile_slug 或 device_id
237
- 2. **立刻问**:"想分享什么联系方式给对方?"
244
+ accept 可以从任何路径触发:
245
+ 1. 调 `antenna_accept`(用 ref、profile_slug 或 device_id)
246
+ 2. **立刻问**:"想分享什么联系方式给对方?"
238
247
  3. 用户给了 → 再调一次 `antenna_accept` 带 `contact_info`
239
- 4. 用户不想 → "先 accept 着,以后想分享再说"
248
+ 4. 用户不想 → "先 accept 着,以后想分享再说"
240
249
  5. 如果 mutual match → 展示对方联系方式
241
- 6. 如果还没 mutual → "已发出,等对方回应"
250
+ 6. 如果还没 mutual → "已发出,等对方回应"
242
251
 
243
252
  **不要跳过第 2 步。**
244
253
 
245
254
  ### Privacy
246
- - **永远不要显示 device_id**——这是内部标识符
255
+ - **永远不要显示 device_id**--这是内部标识符
247
256
  - 只展示名字 + 三句话 + 你写的匹配理由
248
257
  - 不要泄露对方的平台或用户名
249
258
  - 联系方式只在用户明确同意时分享
250
259
  - GPS 不原始存储
251
260
 
252
- ### Time Decay 可见性衰减
253
- - Event 后 0-7 天:全部参与者互相可见
254
- - 7-30 天:只有互相 scan 过 / 有共同活动的人可见
255
- - 30 天后:需要新事件激活
261
+ ### Time Decay - 可见性衰减
262
+ - Event 后 0-7 天:全部参与者互相可见
263
+ - 7-30 天:只有互相 scan 过 / 有共同活动的人可见
264
+ - 30 天后:需要新事件激活
256
265
 
257
- ### Heartbeat 自动查匹配
258
- Plugin 后台每 10 分钟查一次新匹配。看到 `[Antenna] 🎉` 时:
266
+ ### Heartbeat - 自动查匹配
267
+ Plugin 后台每 10 分钟查一次新匹配。看到 `[Antenna] 🎉` 时:
259
268
  1. 调 `antenna_check_matches`
260
269
  2. 告诉用户 + 展示对方名片
261
- 3. 展示联系方式(如果有)
270
+ 3. 展示联系方式(如果有)
262
271
 
263
272
  ## Events
264
273
 
265
- 详见 EVENTS.md。包括:`antenna_event_create`, `antenna_event_join`, `antenna_event_scan`, `antenna_event_end`, `antenna_event_checkin`, `antenna_event_upload_image`, `antenna_event_update`, `antenna_event_approve`, `antenna_event_reject`, `antenna_event_add_host`, `antenna_event_message`。
274
+ 详见 EVENTS.md。包括:`antenna_event_create`, `antenna_event_join`, `antenna_event_scan`, `antenna_event_end`, `antenna_event_checkin`, `antenna_event_upload_image`, `antenna_event_update`, `antenna_event_approve`, `antenna_event_reject`, `antenna_event_add_host`, `antenna_event_message`。
266
275
 
267
276
  ## Data Transparency
268
277
 
269
278
  Antenna 只跟 Supabase (bcudjloikmpcqwcptuyd.supabase.co) 通信。
270
279
 
271
- **发送的数据:** GPS(不原始存储)、名片文本、匹配状态、你选择分享的联系方式、Profile embedding。
272
- **不发送的数据:** 你跟 agent 的对话、文件、浏览记录。
280
+ **发送的数据:** GPS(不原始存储)、名片文本、匹配状态、你选择分享的联系方式、Profile embedding。
281
+ **不发送的数据:** 你跟 agent 的对话、文件、浏览记录。
273
282
 
274
283
  Source code: https://github.com/H1an1/Antenna