antenna-openclaw-plugin 1.3.24 → 1.3.26
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 +16 -6
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -416,11 +416,21 @@ export default function register(api: any) {
|
|
|
416
416
|
|
|
417
417
|
if (error) return ok({ error: error.message });
|
|
418
418
|
|
|
419
|
+
// Read back profile to get slug for public page link
|
|
420
|
+
let publicUrl = null;
|
|
421
|
+
try {
|
|
422
|
+
const { data: profile } = await supabase.rpc("get_profile", { p_device_id: deviceId });
|
|
423
|
+
if (profile?.profile_slug) {
|
|
424
|
+
publicUrl = `https://www.antenna.fyi/p/${profile.profile_slug}`;
|
|
425
|
+
}
|
|
426
|
+
} catch {}
|
|
427
|
+
|
|
419
428
|
return ok({
|
|
420
429
|
updated: true,
|
|
421
|
-
profile: { display_name: data.display_name,
|
|
430
|
+
profile: { display_name: data.display_name,
|
|
422
431
|
line1: data.line1, line2: data.line2, line3: data.line3, visible: data.visible },
|
|
423
|
-
|
|
432
|
+
public_url: publicUrl,
|
|
433
|
+
next_step: "IMPORTANT: 1) Send the public_url to the user — this is their shareable profile link. 2) Call antenna_bind to generate a GPS link. Do not skip either step.",
|
|
424
434
|
});
|
|
425
435
|
},
|
|
426
436
|
});
|
|
@@ -608,16 +618,16 @@ export default function register(api: any) {
|
|
|
608
618
|
api.registerTool({
|
|
609
619
|
name: "antenna_link_account",
|
|
610
620
|
description:
|
|
611
|
-
"Link your Antenna agent profile to your antenna.fyi website account.
|
|
621
|
+
"Link your Antenna agent profile to your antenna.fyi website account. Pass the user's API key — the server verifies it and extracts the user_id. The agent never needs to know or pass user_id directly.",
|
|
612
622
|
parameters: {
|
|
613
623
|
type: "object",
|
|
614
624
|
properties: {
|
|
615
625
|
sender_id: { type: "string", description: "The sender's user ID" },
|
|
616
626
|
channel: { type: "string", description: "The channel name" },
|
|
617
627
|
chat_id: { type: "string", description: "REQUIRED. Pass the chat/channel ID from your message context." },
|
|
618
|
-
|
|
628
|
+
api_key: { type: "string", description: "The user's Antenna API key (ant_xxx) from antenna.fyi/me" },
|
|
619
629
|
},
|
|
620
|
-
required: ["sender_id", "channel", "chat_id", "
|
|
630
|
+
required: ["sender_id", "channel", "chat_id", "api_key"],
|
|
621
631
|
},
|
|
622
632
|
async execute(_id: string, params: any) {
|
|
623
633
|
const cfg = getConfig(api);
|
|
@@ -626,7 +636,7 @@ export default function register(api: any) {
|
|
|
626
636
|
|
|
627
637
|
const { data, error } = await supabase.rpc("bind_user_id", {
|
|
628
638
|
p_device_id: deviceId,
|
|
629
|
-
|
|
639
|
+
p_api_key: params.api_key,
|
|
630
640
|
});
|
|
631
641
|
if (error) return ok({ error: error.message });
|
|
632
642
|
|