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.
- package/index.ts +19 -5
- 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
|
|
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: ["
|
|
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
|
-
|
|
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,
|