antenna-fyi 1.2.30 → 1.2.32
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/lib/cli.js +30 -3
- package/lib/hermes-plugin/tools.py +1 -5
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -564,7 +564,7 @@ export async function handleWatch(f) {
|
|
|
564
564
|
const logFile = path.join(logDir, 'watch.log');
|
|
565
565
|
try { if (!existsSync(logDir)) mkdirSync(logDir, { recursive: true }); } catch {}
|
|
566
566
|
const logStream = await import('fs').then(fs => fs.createWriteStream(logFile, { flags: 'a' }));
|
|
567
|
-
const _log = (msg) => {
|
|
567
|
+
const _log = (msg = "") => {
|
|
568
568
|
const line = `[${new Date().toISOString()}] ${msg}`;
|
|
569
569
|
console.log(msg);
|
|
570
570
|
try { logStream.write(line + '\n'); } catch {}
|
|
@@ -625,7 +625,7 @@ export async function handleWatch(f) {
|
|
|
625
625
|
_log(` ${m.emoji || "👤"} ${m.name}${m.their_contact ? " — contact: " + m.their_contact : ""}`);
|
|
626
626
|
}
|
|
627
627
|
saveNotified(notified);
|
|
628
|
-
_log();
|
|
628
|
+
_log("");
|
|
629
629
|
}
|
|
630
630
|
if (initial.incoming_accepts?.length) {
|
|
631
631
|
_log(`📩 ${initial.incoming_accepts.length} person(s) want to meet you!`);
|
|
@@ -635,9 +635,18 @@ export async function handleWatch(f) {
|
|
|
635
635
|
_log(` ${m.emoji || "👤"} ${m.name} — ${m.line1 || ""}`);
|
|
636
636
|
}
|
|
637
637
|
saveNotified(notified);
|
|
638
|
-
_log();
|
|
638
|
+
_log("");
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
+
// Seed notified set with current event states (don't push, just record)
|
|
642
|
+
try {
|
|
643
|
+
const { data: evts } = await sb.rpc("get_my_event_updates", { p_device_id: id });
|
|
644
|
+
for (const ev of (evts || [])) {
|
|
645
|
+
notified.add(`event:${ev.event_id}:${ev.status}`);
|
|
646
|
+
}
|
|
647
|
+
saveNotified(notified);
|
|
648
|
+
} catch { /* silent */ }
|
|
649
|
+
|
|
641
650
|
// Subscribe to realtime changes on matches table
|
|
642
651
|
const channel = sb
|
|
643
652
|
.channel("antenna-cli-watch")
|
|
@@ -762,6 +771,7 @@ export async function handleWatch(f) {
|
|
|
762
771
|
});
|
|
763
772
|
|
|
764
773
|
// Keep alive — also poll every 2 minutes as fallback
|
|
774
|
+
// (Realtime may not work without SELECT policies)
|
|
765
775
|
const pollInterval = setInterval(async () => {
|
|
766
776
|
try {
|
|
767
777
|
const result = await checkMatches({ device_id: id });
|
|
@@ -782,6 +792,23 @@ export async function handleWatch(f) {
|
|
|
782
792
|
}
|
|
783
793
|
}
|
|
784
794
|
} catch { /* silent */ }
|
|
795
|
+
|
|
796
|
+
// Poll event status changes (approval/rejection)
|
|
797
|
+
try {
|
|
798
|
+
const { data: events } = await sb.rpc("get_my_event_updates", { p_device_id: id });
|
|
799
|
+
for (const ev of (events || [])) {
|
|
800
|
+
const key = `event:${ev.event_id}:${ev.status}`;
|
|
801
|
+
if (!notified.has(key)) {
|
|
802
|
+
notified.add(key);
|
|
803
|
+
saveNotified(notified);
|
|
804
|
+
if (ev.status === "active" && ev.role !== "creator" && ev.role !== "cohost") {
|
|
805
|
+
pushNotify(`✅ Your application to "${ev.event_name}" was approved! You're in.`);
|
|
806
|
+
} else if (ev.status === "rejected") {
|
|
807
|
+
pushNotify(`❌ Your application to "${ev.event_name}" was not approved.`);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
} catch { /* silent */ }
|
|
785
812
|
}, 2 * 60 * 1000);
|
|
786
813
|
|
|
787
814
|
// Handle Ctrl+C
|
|
@@ -103,11 +103,6 @@ def handle_scan(params: dict) -> str:
|
|
|
103
103
|
|
|
104
104
|
flat, flng = _fuzzy(lat, lng)
|
|
105
105
|
|
|
106
|
-
# Update own location
|
|
107
|
-
sb.rpc("upsert_profile_location", {
|
|
108
|
-
"p_device_id": did, "p_lng": flng, "p_lat": flat,
|
|
109
|
-
}).execute()
|
|
110
|
-
|
|
111
106
|
# Query nearby
|
|
112
107
|
resp = sb.rpc("nearby_profiles", {
|
|
113
108
|
"p_lat": flat, "p_lng": flng, "p_radius_m": radius,
|
|
@@ -132,6 +127,7 @@ def handle_scan(params: dict) -> str:
|
|
|
132
127
|
"line1": p.get("line1"),
|
|
133
128
|
"line2": p.get("line2"),
|
|
134
129
|
"line3": p.get("line3"),
|
|
130
|
+
"distance_m": p.get("distance_m") or p.get("dist_meters"),
|
|
135
131
|
})
|
|
136
132
|
|
|
137
133
|
return _ok({
|