antenna-openclaw-plugin 1.3.39 → 1.3.41
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 +21 -3
- package/package.json +1 -1
- package/skills/antenna/SKILL.md +7 -1
package/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createClient, SupabaseClient } from "@supabase/supabase-js";
|
|
2
2
|
import { execSync } from "child_process";
|
|
3
|
+
import { createHash } from "crypto";
|
|
3
4
|
|
|
4
5
|
// ─── Built-in Supabase config (shared backend, zero config) ─────────
|
|
5
6
|
|
|
@@ -72,6 +73,16 @@ function getSupabase(cfg: AntennaConfig): SupabaseClient {
|
|
|
72
73
|
return _supabaseClient;
|
|
73
74
|
}
|
|
74
75
|
|
|
76
|
+
function profileSlugCandidate(displayName: string | null | undefined, deviceId: string) {
|
|
77
|
+
const fromName = String(displayName || "")
|
|
78
|
+
.toLowerCase()
|
|
79
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
80
|
+
.replace(/^-|-$/g, "")
|
|
81
|
+
.substring(0, 30);
|
|
82
|
+
if (fromName) return fromName;
|
|
83
|
+
return `user-${createHash("sha1").update(deviceId).digest("hex").slice(0, 10)}`;
|
|
84
|
+
}
|
|
85
|
+
|
|
75
86
|
function isRateLimited(deviceId: string): boolean {
|
|
76
87
|
const now = Date.now();
|
|
77
88
|
const last = _lastScanTime.get(deviceId);
|
|
@@ -446,6 +457,7 @@ export default function register(api: any) {
|
|
|
446
457
|
p_line1: params.line1 ?? null, p_line2: params.line2 ?? null,
|
|
447
458
|
p_line3: params.line3 ?? null, p_visible: params.visible ?? true,
|
|
448
459
|
...(params.matching_context != null ? { p_matching_context: params.matching_context } : {}),
|
|
460
|
+
p_api_key: null,
|
|
449
461
|
});
|
|
450
462
|
|
|
451
463
|
if (error) return ok({ error: error.message });
|
|
@@ -455,8 +467,14 @@ export default function register(api: any) {
|
|
|
455
467
|
let archetypeResult = null;
|
|
456
468
|
try {
|
|
457
469
|
const { data: profile } = await supabase.rpc("get_profile", { p_device_id: deviceId });
|
|
458
|
-
|
|
459
|
-
|
|
470
|
+
let profileSlug = profile?.profile_slug || null;
|
|
471
|
+
if (!profileSlug) {
|
|
472
|
+
const targetSlug = profileSlugCandidate(params.display_name, deviceId);
|
|
473
|
+
const { data: slugResult } = await supabase.rpc("set_profile_slug", { p_device_id: deviceId, p_slug: targetSlug, p_api_key: null });
|
|
474
|
+
if (slugResult?.set) profileSlug = targetSlug;
|
|
475
|
+
}
|
|
476
|
+
if (profileSlug) {
|
|
477
|
+
publicUrl = `https://www.antenna.fyi/p/${profileSlug}`;
|
|
460
478
|
}
|
|
461
479
|
} catch {}
|
|
462
480
|
|
|
@@ -503,7 +521,7 @@ export default function register(api: any) {
|
|
|
503
521
|
line1: data.line1, line2: data.line2, line3: data.line3, visible: data.visible },
|
|
504
522
|
public_url: publicUrl,
|
|
505
523
|
archetype: archetypeResult || null,
|
|
506
|
-
next_step: "IMPORTANT: 1) Send the public_url to the user — this is their shareable profile link. 2) Tell the user their archetype and the personalized reason. 3) Call antenna_bind to generate a GPS link. Do not skip any step.",
|
|
524
|
+
next_step: "IMPORTANT: 1) Send the public_url to the user — this is their shareable profile link. If public_url is null, say profile link generation failed and retry profile save. 2) Tell the user their archetype and the personalized reason. 3) Call antenna_bind to generate a GPS link. Do not skip any step.",
|
|
507
525
|
});
|
|
508
526
|
},
|
|
509
527
|
});
|
package/package.json
CHANGED
package/skills/antenna/SKILL.md
CHANGED
|
@@ -114,7 +114,7 @@ openclaw cron add --every 1h --message "Check antenna matches: call antenna_chec
|
|
|
114
114
|
- **首次安装后**: 主动开始 onboarding(名片 → 位置)
|
|
115
115
|
- User shares a location (Telegram live location, WhatsApp pin, or tells you where they are)
|
|
116
116
|
- User asks "附近有谁" / "who's nearby" / "周围有什么人"
|
|
117
|
-
- User says "我想找一个 xxx 的人" / "find me someone who..."
|
|
117
|
+
- User says "我想找一个 xxx 的人" / "find me someone who..." / "有没有做 X 的人" → call `antenna_find_people` first
|
|
118
118
|
- User wants to set up or edit their profile card (名片)
|
|
119
119
|
- User accepts or skips a match
|
|
120
120
|
- User asks about match status or wants to exchange contact info
|
|
@@ -172,6 +172,10 @@ The name card has:
|
|
|
172
172
|
**During onboarding, generate `matching_context` FIRST** based on your conversation with the user (+ memory, SOUL.md, etc.). Then derive line1/2/3 from it. Don't ask the user to write matching_context - you write it. Example:
|
|
173
173
|
> "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."
|
|
174
174
|
|
|
175
|
+
After setting a profile, the tool returns `public_url`. **You must immediately send that link to the user** as their shareable public profile. If `public_url` is empty, retry profile save or report that link generation failed.
|
|
176
|
+
|
|
177
|
+
**i18n:** Save and show user-written profile content in the user's original language. Do not machine-translate their personal description, looking-for text, or conversation style. Antenna UI labels can switch language; the user's own text stays as written.
|
|
178
|
+
|
|
175
179
|
### `antenna_accept`
|
|
176
180
|
Accept a match after the user sees results. Can optionally include contact info to share.
|
|
177
181
|
- `sender_id`, `channel`, `target_device_id`
|
|
@@ -207,6 +211,8 @@ Find 1-3 people by free-form intent.
|
|
|
207
211
|
- Returns privacy-safe profiles with `ref`, `display_name`, `profile_slug`, three card fields, `more_information`, `interest_tags`, `city`, and `recommendation_reason`
|
|
208
212
|
- Does not return contact info or raw `device_id`
|
|
209
213
|
- If the user wants an intro, call `antenna_accept` with the returned `ref`
|
|
214
|
+
- If plugin tools are unavailable, use the CLI fallback:
|
|
215
|
+
`antenna find --id <platform>:<user_id> --query "想找一个懂 consumer social 增长的人" --limit 3`
|
|
210
216
|
|
|
211
217
|
### `antenna_pass`
|
|
212
218
|
Pass/skip a person. They won't be recommended again.
|