antenna-fyi 1.2.0 → 1.2.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/lib/core.js +8 -5
- package/lib/mcp.js +3 -2
- package/package.json +1 -1
- package/skill/SKILL.md +7 -1
package/lib/core.js
CHANGED
|
@@ -135,7 +135,7 @@ export async function scan({ lat, lng, radius_m = 500, device_id, supabaseUrl, s
|
|
|
135
135
|
const saveRefs = async (refMap) => {
|
|
136
136
|
if (device_id && Object.keys(refMap).length > 0) {
|
|
137
137
|
try {
|
|
138
|
-
await sb.rpc("save_scan_refs", { p_owner: device_id, p_refs:
|
|
138
|
+
await sb.rpc("save_scan_refs", { p_owner: device_id, p_refs: refMap });
|
|
139
139
|
} catch { /* best effort */ }
|
|
140
140
|
}
|
|
141
141
|
};
|
|
@@ -197,6 +197,7 @@ export async function setProfile({
|
|
|
197
197
|
line1,
|
|
198
198
|
line2,
|
|
199
199
|
line3,
|
|
200
|
+
matching_context,
|
|
200
201
|
visible = true,
|
|
201
202
|
supabaseUrl,
|
|
202
203
|
supabaseKey,
|
|
@@ -210,12 +211,14 @@ export async function setProfile({
|
|
|
210
211
|
p_line2: line2 || null,
|
|
211
212
|
p_line3: line3 || null,
|
|
212
213
|
p_visible: visible,
|
|
214
|
+
p_matching_context: matching_context || null,
|
|
213
215
|
});
|
|
214
216
|
if (error) throw new Error(error.message);
|
|
215
217
|
|
|
216
|
-
// Generate embedding for
|
|
218
|
+
// Generate embedding using lines + matching_context for better quality
|
|
217
219
|
try {
|
|
218
|
-
const
|
|
220
|
+
const textParts = [line1, line2, line3, matching_context].filter(Boolean);
|
|
221
|
+
const text = textParts.join(". ");
|
|
219
222
|
if (text) {
|
|
220
223
|
const embedding = await generateEmbedding(text);
|
|
221
224
|
if (embedding) {
|
|
@@ -443,7 +446,7 @@ export async function discover({ device_id, supabaseUrl, supabaseKey }) {
|
|
|
443
446
|
// Persist ref map to DB
|
|
444
447
|
if (device_id && Object.keys(_refMap).length > 0) {
|
|
445
448
|
try {
|
|
446
|
-
await sb.rpc("save_scan_refs", { p_owner: device_id, p_refs:
|
|
449
|
+
await sb.rpc("save_scan_refs", { p_owner: device_id, p_refs: _refMap });
|
|
447
450
|
} catch { /* best effort */ }
|
|
448
451
|
}
|
|
449
452
|
|
|
@@ -520,7 +523,7 @@ export async function eventScan({ code, device_id, supabaseUrl, supabaseKey }) {
|
|
|
520
523
|
|
|
521
524
|
// Persist refs
|
|
522
525
|
if (device_id && Object.keys(_refMap).length > 0) {
|
|
523
|
-
try { await sb.rpc("save_scan_refs", { p_owner: device_id, p_refs:
|
|
526
|
+
try { await sb.rpc("save_scan_refs", { p_owner: device_id, p_refs: _refMap }); } catch {}
|
|
524
527
|
}
|
|
525
528
|
|
|
526
529
|
return {
|
package/lib/mcp.js
CHANGED
|
@@ -72,16 +72,17 @@ export async function startMcpServer() {
|
|
|
72
72
|
line1: z.string().optional(),
|
|
73
73
|
line2: z.string().optional(),
|
|
74
74
|
line3: z.string().optional(),
|
|
75
|
+
matching_context: z.string().optional().describe("Agent-generated rich context for better matching (not shown to others)"),
|
|
75
76
|
visible: z.boolean().optional().default(true),
|
|
76
77
|
},
|
|
77
|
-
async ({ action, sender_id, channel, display_name, emoji, line1, line2, line3, visible }) => {
|
|
78
|
+
async ({ action, sender_id, channel, display_name, emoji, line1, line2, line3, matching_context, visible }) => {
|
|
78
79
|
const deviceId = deriveDeviceId(sender_id, channel);
|
|
79
80
|
try {
|
|
80
81
|
if (action === "get") {
|
|
81
82
|
const data = await getProfile({ device_id: deviceId });
|
|
82
83
|
return jsonResult(data ? { profile: data } : { profile: null, message: "还没有名片,帮你创建一个?" });
|
|
83
84
|
}
|
|
84
|
-
const data = await setProfile({ device_id: deviceId, display_name, emoji, line1, line2, line3, visible });
|
|
85
|
+
const data = await setProfile({ device_id: deviceId, display_name, emoji, line1, line2, line3, matching_context, visible });
|
|
85
86
|
return jsonResult({ saved: true, profile: data });
|
|
86
87
|
} catch (e) {
|
|
87
88
|
return jsonResult({ error: e.message });
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -83,7 +83,7 @@ After receiving the nearby profiles, **you decide** who to recommend:
|
|
|
83
83
|
View or update the user's name card.
|
|
84
84
|
- `action`: "get" or "set"
|
|
85
85
|
- `sender_id`, `channel`: from context
|
|
86
|
-
- For "set": `display_name`, `emoji`, `line1`, `line2`, `line3`, `visible`
|
|
86
|
+
- For "set": `display_name`, `emoji`, `line1`, `line2`, `line3`, `visible`, `matching_context`
|
|
87
87
|
|
|
88
88
|
The name card has:
|
|
89
89
|
- **emoji**: a single emoji that represents them
|
|
@@ -91,6 +91,12 @@ The name card has:
|
|
|
91
91
|
- **line1**: who they are / what they do
|
|
92
92
|
- **line2**: what they're into
|
|
93
93
|
- **line3**: what they're looking for right now
|
|
94
|
+
- **matching_context** (optional, not shown to others): A richer description generated by the agent based on what it knows about the user — career background, tech stack, interests, projects, personality traits. ~200 words. Only used for embedding-based matching, never displayed to other users.
|
|
95
|
+
|
|
96
|
+
**After saving the profile, generate `matching_context` automatically** based on your knowledge of the user (memory, conversations, context). Don't ask the user to write it — you write it. Example:
|
|
97
|
+
> "Product designer at a tech company in Beijing, focusing on AI search experience. Interested in music (Sakamoto), swimming, cooking, language learning. Recently exploring AI agent ecosystems and social discovery. Looking to connect with AI builders, indie hackers, and creative technologists."
|
|
98
|
+
- **line2**: what they're into
|
|
99
|
+
- **line3**: what they're looking for right now
|
|
94
100
|
|
|
95
101
|
### `antenna_accept`
|
|
96
102
|
Accept a match after the user sees results. Can optionally include contact info to share.
|