antenna-openclaw-plugin 1.2.3 → 1.2.6
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 +64 -0
- package/package.json +1 -1
- package/skills/antenna/SKILL.md +16 -2
package/index.ts
CHANGED
|
@@ -642,6 +642,8 @@ export default function register(api: any) {
|
|
|
642
642
|
lng: { type: "number", description: "Event longitude" },
|
|
643
643
|
starts_at: { type: "string", description: "Start time ISO" },
|
|
644
644
|
ends_at: { type: "string", description: "End time ISO" },
|
|
645
|
+
description: { type: "string", description: "Event description" },
|
|
646
|
+
og_image: { type: "string", description: "OG image URL for social sharing" },
|
|
645
647
|
},
|
|
646
648
|
required: ["name", "sender_id", "channel"],
|
|
647
649
|
},
|
|
@@ -656,6 +658,36 @@ export default function register(api: any) {
|
|
|
656
658
|
p_created_by: deviceId,
|
|
657
659
|
p_starts_at: params.starts_at || new Date().toISOString(),
|
|
658
660
|
p_ends_at: params.ends_at || new Date(Date.now() + 12*60*60*1000).toISOString(),
|
|
661
|
+
p_description: params.description || null,
|
|
662
|
+
p_og_image: params.og_image || null,
|
|
663
|
+
});
|
|
664
|
+
if (error) return ok({ error: error.message });
|
|
665
|
+
return ok(data);
|
|
666
|
+
},
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
// ═════════════════════════════════════════════════════════════════
|
|
670
|
+
// Tool: antenna_event_end
|
|
671
|
+
// ═════════════════════════════════════════════════════════════════
|
|
672
|
+
api.registerTool({
|
|
673
|
+
name: "antenna_event_end",
|
|
674
|
+
description: "End an event. Only the creator can end it.",
|
|
675
|
+
parameters: {
|
|
676
|
+
type: "object",
|
|
677
|
+
properties: {
|
|
678
|
+
code: { type: "string", description: "Event code" },
|
|
679
|
+
sender_id: { type: "string" },
|
|
680
|
+
channel: { type: "string" },
|
|
681
|
+
},
|
|
682
|
+
required: ["code", "sender_id", "channel"],
|
|
683
|
+
},
|
|
684
|
+
async execute(_id: string, params: any) {
|
|
685
|
+
const cfg = getConfig(api);
|
|
686
|
+
const supabase = getSupabase(cfg);
|
|
687
|
+
const deviceId = deriveDeviceId(params.sender_id, params.channel);
|
|
688
|
+
const { data, error } = await supabase.rpc("end_event", {
|
|
689
|
+
p_code: params.code,
|
|
690
|
+
p_device_id: deviceId,
|
|
659
691
|
});
|
|
660
692
|
if (error) return ok({ error: error.message });
|
|
661
693
|
return ok(data);
|
|
@@ -761,6 +793,38 @@ export default function register(api: any) {
|
|
|
761
793
|
});
|
|
762
794
|
|
|
763
795
|
// ═══════════════════════════════════════════════════════════════════
|
|
796
|
+
// Tool: antenna_event_checkin
|
|
797
|
+
// ═════════════════════════════════════════════════════════════════
|
|
798
|
+
api.registerTool({
|
|
799
|
+
name: "antenna_event_checkin",
|
|
800
|
+
description: "Check in at an event — marks you as present at the event location. Optionally updates GPS.",
|
|
801
|
+
parameters: {
|
|
802
|
+
type: "object",
|
|
803
|
+
properties: {
|
|
804
|
+
code: { type: "string", description: "Event code" },
|
|
805
|
+
sender_id: { type: "string" },
|
|
806
|
+
channel: { type: "string" },
|
|
807
|
+
lat: { type: "number", description: "Latitude (optional)" },
|
|
808
|
+
lng: { type: "number", description: "Longitude (optional)" },
|
|
809
|
+
},
|
|
810
|
+
required: ["code", "sender_id", "channel"],
|
|
811
|
+
},
|
|
812
|
+
async execute(_id: string, params: any) {
|
|
813
|
+
const cfg = getConfig(api);
|
|
814
|
+
const supabase = getSupabase(cfg);
|
|
815
|
+
const deviceId = deriveDeviceId(params.sender_id, params.channel);
|
|
816
|
+
const fuzzy = (params.lat != null && params.lng != null) ? fuzzyCoords(params.lat, params.lng) : { lat: null, lng: null };
|
|
817
|
+
const { data, error } = await supabase.rpc("event_checkin", {
|
|
818
|
+
p_code: params.code,
|
|
819
|
+
p_device_id: deviceId,
|
|
820
|
+
p_lat: fuzzy.lat,
|
|
821
|
+
p_lng: fuzzy.lng,
|
|
822
|
+
});
|
|
823
|
+
if (error) return ok({ error: error.message });
|
|
824
|
+
return ok(data);
|
|
825
|
+
},
|
|
826
|
+
});
|
|
827
|
+
|
|
764
828
|
// Tool: antenna_check_matches
|
|
765
829
|
// ═══════════════════════════════════════════════════════════════════
|
|
766
830
|
api.registerTool({
|
package/package.json
CHANGED
package/skills/antenna/SKILL.md
CHANGED
|
@@ -66,11 +66,12 @@ cron 设完后,问用户一句:
|
|
|
66
66
|
## Tools
|
|
67
67
|
|
|
68
68
|
### `antenna_scan`
|
|
69
|
-
Scan for nearby people
|
|
69
|
+
Scan for nearby people **and events**. Returns raw profile cards + active events within 5km.
|
|
70
70
|
- `lat`, `lng`: coordinates (from `LocationLat`/`LocationLon` context, or geocoded from user input)
|
|
71
|
-
- `radius_m`: search radius in meters (default 500, max 1000)
|
|
71
|
+
- `radius_m`: search radius in meters (default 500, max 1000) for people; events search uses 5km
|
|
72
72
|
- `sender_id`: the user's id from message context
|
|
73
73
|
- `channel`: the channel name (telegram, whatsapp, discord, etc.)
|
|
74
|
+
- Returns `profiles` (nearby people) + `nearby_events` (active events with name, participants count, code)
|
|
74
75
|
|
|
75
76
|
After receiving the nearby profiles, **you decide** who to recommend:
|
|
76
77
|
- Use everything you know about the user: their SOUL.md, memory, recent conversations, interests, current mood
|
|
@@ -278,6 +279,13 @@ Create an event. Returns a shareable link (antenna.fyi/e/CODE).
|
|
|
278
279
|
- `sender_id`, `channel`: from context
|
|
279
280
|
- `lat`, `lng`: optional event location
|
|
280
281
|
- `starts_at`, `ends_at`: optional time range (default: now to +12h)
|
|
282
|
+
- `description`: optional event description
|
|
283
|
+
- `og_image`: optional OG image URL for social sharing preview
|
|
284
|
+
|
|
285
|
+
### `antenna_event_end`
|
|
286
|
+
End an event. Only the creator can end it.
|
|
287
|
+
- `code`: event code
|
|
288
|
+
- `sender_id`, `channel`: from context
|
|
281
289
|
|
|
282
290
|
### `antenna_event_join`
|
|
283
291
|
Join an event by code.
|
|
@@ -289,3 +297,9 @@ Scan people in an event. No distance limit — returns all participants.
|
|
|
289
297
|
- `code`: event code
|
|
290
298
|
- `sender_id`, `channel`: from context
|
|
291
299
|
- Returns profiles with `source: "event"` tag
|
|
300
|
+
|
|
301
|
+
### `antenna_event_checkin`
|
|
302
|
+
Check in at an event — marks you as present at the event location. Optionally updates GPS.
|
|
303
|
+
- `code`: event code
|
|
304
|
+
- `sender_id`, `channel`: from context
|
|
305
|
+
- `lat`, `lng`: optional GPS coordinates
|