antenna-openclaw-plugin 1.2.7 → 1.2.9

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 CHANGED
@@ -519,12 +519,14 @@ export default function register(api: any) {
519
519
  api.registerTool({
520
520
  name: "antenna_bind",
521
521
  description:
522
- "Generate a GPS binding link. Send this URL to the user so they can share their phone's location via the web browser at antenna.fyi.",
522
+ "Generate a GPS binding link. Use purpose='event' + event_code when setting an event's location.",
523
523
  parameters: {
524
524
  type: "object",
525
525
  properties: {
526
526
  sender_id: { type: "string", description: "The sender's user ID" },
527
527
  channel: { type: "string", description: "The channel name" },
528
+ purpose: { type: "string", description: "'profile' (default) or 'event'" },
529
+ event_code: { type: "string", description: "Event code (required when purpose=event)" },
528
530
  },
529
531
  required: ["sender_id", "channel"],
530
532
  },
@@ -533,7 +535,11 @@ export default function register(api: any) {
533
535
  const supabase = getSupabase(cfg);
534
536
  const deviceId = deriveDeviceId(params.sender_id, params.channel);
535
537
 
536
- const { data, error } = await supabase.rpc("create_bind_token", { p_device_id: deviceId });
538
+ const { data, error } = await supabase.rpc("create_bind_token", {
539
+ p_device_id: deviceId,
540
+ p_purpose: params.purpose || "profile",
541
+ p_event_code: params.event_code || null,
542
+ });
537
543
  if (error) return ok({ error: error.message });
538
544
 
539
545
  const token = data?.token;
@@ -541,7 +547,10 @@ export default function register(api: any) {
541
547
  return ok({
542
548
  token,
543
549
  url: `${baseUrl}/locate?token=${token}`,
544
- message: "发送这个链接给用户,在手机浏览器打开即可共享位置。",
550
+ purpose: params.purpose || "profile",
551
+ message: params.purpose === "event"
552
+ ? "发送这个链接给活动创建者,在活动地点打开即可设定活动位置。"
553
+ : "发送这个链接给用户,在手机浏览器打开即可共享位置。",
545
554
  });
546
555
  },
547
556
  });
@@ -825,6 +834,34 @@ export default function register(api: any) {
825
834
  },
826
835
  });
827
836
 
837
+ // Tool: antenna_event_upload_image
838
+ // ═════════════════════════════════════════════════════════════════
839
+ api.registerTool({
840
+ name: "antenna_event_upload_image",
841
+ description: "Upload an image for an event OG preview. Returns a public URL.",
842
+ parameters: {
843
+ type: "object",
844
+ properties: {
845
+ image_base64: { type: "string", description: "Base64-encoded image data" },
846
+ content_type: { type: "string", description: "MIME type (default image/png)" },
847
+ event_code: { type: "string", description: "Event code" },
848
+ },
849
+ required: ["image_base64", "event_code"],
850
+ },
851
+ async execute(_id: string, params: any) {
852
+ const cfg = getConfig(api);
853
+ const supabase = getSupabase(cfg);
854
+ const content_type = params.content_type || "image/png";
855
+ const ext = content_type.split("/")[1] || "png";
856
+ const path = `${params.event_code}.${ext}`;
857
+ const buf = Buffer.from(params.image_base64, "base64");
858
+ const { error } = await supabase.storage.from("event-images").upload(path, buf, { contentType: content_type, upsert: true });
859
+ if (error) return ok({ error: error.message });
860
+ const { data } = supabase.storage.from("event-images").getPublicUrl(path);
861
+ return ok({ url: data.publicUrl });
862
+ },
863
+ });
864
+
828
865
  // Tool: antenna_check_matches
829
866
  // ═══════════════════════════════════════════════════════════════════
830
867
  api.registerTool({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antenna-openclaw-plugin",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "Antenna — agent-mediated nearby people discovery for OpenClaw",
5
5
  "openclaw": {
6
6
  "extensions": ["./index.ts"]
@@ -112,9 +112,12 @@ Check for mutual matches and contact info updates.
112
112
  ### `antenna_bind`
113
113
  Generate a GPS binding link. **You MUST call this immediately after saving a profile.** Do not skip this step.
114
114
  - `sender_id`, `channel`: from context
115
+ - `purpose`: optional — `'profile'` (default) updates user location; `'event'` sets event location
116
+ - `event_code`: required when `purpose='event'`
115
117
  - Returns a URL like `https://www.antenna.fyi/locate?token=xxx`
116
118
  - Send this link to the user — they open it on their phone, allow GPS, and their location is automatically shared
117
119
  - **MANDATORY after profile save. Do not wait for user to ask.**
120
+ - **For events:** When a creator needs to set event location, call with `purpose='event'` and `event_code`. The GPS will update the event's coordinates, NOT the user's profile.
118
121
 
119
122
  ### `antenna_discover`
120
123
  Get today's global recommendation — the person most similar to you worldwide. 1 per day, no repeats.
@@ -282,6 +285,8 @@ Create an event. Returns a shareable link (antenna.fyi/e/CODE).
282
285
  - `description`: optional event description
283
286
  - `og_image`: optional OG image URL for social sharing preview
284
287
 
288
+ **GPS flow for events:** If the user doesn't provide coordinates, generate a bind link (`antenna_bind`) and ask them to open it at the event location. Once GPS comes in, use those coordinates for the event's `lat`/`lng` — do NOT treat this as the user's personal location. The bind link GPS for event creation goes to the event, not the user's profile. Only use `antenna_checkin` when the user wants to update their own location.
289
+
285
290
  ### `antenna_event_end`
286
291
  End an event. Only the creator can end it.
287
292
  - `code`: event code
@@ -303,3 +308,9 @@ Check in at an event — marks you as present at the event location. Optionally
303
308
  - `code`: event code
304
309
  - `sender_id`, `channel`: from context
305
310
  - `lat`, `lng`: optional GPS coordinates
311
+
312
+ ### `antenna_event_upload_image`
313
+ Upload an image for an event OG preview. Returns a public URL.
314
+ - `image_base64`: base64-encoded image data
315
+ - `content_type`: MIME type (default image/png)
316
+ - `event_code`: event code