antenna-openclaw-plugin 0.6.1 → 0.7.0

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.
Files changed (2) hide show
  1. package/index.ts +19 -5
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -221,17 +221,17 @@ export default function register(api: any) {
221
221
  api.registerTool({
222
222
  name: "antenna_scan",
223
223
  description:
224
- "Scan for nearby people at a given location. Returns raw profile cards of nearby people the agent should read these cards and decide who to recommend based on its understanding of the user. Use when the user shares their location or asks 'who is nearby'.",
224
+ "Scan for nearby people. If lat/lng are omitted, uses the location from the user's web GPS binding (antenna.fyi/locate). Returns raw profile cards the agent decides who to recommend.",
225
225
  parameters: {
226
226
  type: "object",
227
227
  properties: {
228
- lat: { type: "number", description: "Latitude" },
229
- lng: { type: "number", description: "Longitude" },
228
+ lat: { type: "number", description: "Latitude (optional if location was shared via web)" },
229
+ lng: { type: "number", description: "Longitude (optional if location was shared via web)" },
230
230
  radius_m: { type: "number", description: "Search radius in meters (default: 500)" },
231
231
  sender_id: { type: "string", description: "The sender's user ID (from message context)" },
232
232
  channel: { type: "string", description: "The channel name (telegram, whatsapp, etc.)" },
233
233
  },
234
- required: ["lat", "lng", "sender_id", "channel"],
234
+ required: ["sender_id", "channel"],
235
235
  },
236
236
  async execute(_id: string, params: any) {
237
237
  const cfg = getConfig(api);
@@ -243,7 +243,21 @@ export default function register(api: any) {
243
243
  return ok({ nearby: [], message: "刚刚才扫描过,稍等一会儿再试。", rate_limited: true });
244
244
  }
245
245
 
246
- const fuzzy = fuzzyCoords(params.lat, params.lng);
246
+ let lat = params.lat;
247
+ let lng = params.lng;
248
+
249
+ // If no coordinates, read from profile (web GPS bind)
250
+ if (lat == null || lng == null) {
251
+ const { data: loc } = await supabase.rpc("get_profile_location", { p_device_id: deviceId });
252
+ if (loc?.found) {
253
+ lat = loc.lat;
254
+ lng = loc.lng;
255
+ } else {
256
+ return ok({ nearby: [], message: "还没有位置信息。请先通过链接分享位置,或者发送位置消息。" });
257
+ }
258
+ }
259
+
260
+ const fuzzy = fuzzyCoords(lat, lng);
247
261
 
248
262
  const { error: upsertErr } = await supabase.rpc("upsert_profile_location", {
249
263
  p_device_id: deviceId, p_lng: fuzzy.lng, p_lat: fuzzy.lat,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antenna-openclaw-plugin",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Antenna — agent-mediated nearby people discovery for OpenClaw",
5
5
  "openclaw": {
6
6
  "extensions": ["./index.ts"]