antenna-fyi 1.2.39 → 1.2.41

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/lib/cli.js +46 -7
  2. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -180,9 +180,10 @@ export async function handleEvent(f) {
180
180
  }
181
181
 
182
182
  if (f.create || (!f.join && !f.scan && !f.end && !f.update && !f.approve && !f.reject && !f['add-host'] && f.name)) {
183
- if (!f.name) return console.error("Usage: antenna event --create --name 'AI Meetup' --starts-at '2026-04-19T14:00' --ends-at '2026-04-19T18:00' [--lat 34.05 --lng -118.25] [--desc 'description'] [--og-image 'url'] [--requires-approval] [--screening-questions 'Q1|Q2']");
183
+ if (!f.name) return console.error("Usage: antenna event --create --name 'AI Meetup' --id telegram:123 --starts-at '2026-04-19T14:00' --ends-at '2026-04-19T18:00' [--lat 34.05 --lng -118.25] [--desc 'description'] [--og-image 'url'] [--requires-approval] [--screening-questions 'Q1|Q2']");
184
+ if (!f.id) return console.error("❌ --id is required (e.g. --id telegram:123). Creator identity needed to manage the event.");
184
185
  if (!f['starts-at'] || !f['ends-at']) return console.error("❌ --starts-at and --ends-at are required. Example: --starts-at '2026-04-19T14:00' --ends-at '2026-04-19T18:00'");
185
- const result = await createEvent({ name: f.name, device_id: f.id || null, lat: f.lat ? +f.lat : undefined, lng: f.lng ? +f.lng : undefined, starts_at: f['starts-at'], ends_at: f['ends-at'], description: f.desc || undefined, og_image: f['og-image'] || undefined, requires_approval: f['requires-approval'] === true || f['requires-approval'] === 'true' || undefined, screening_questions: f['screening-questions'] ? f['screening-questions'].split('|') : undefined });
186
+ const result = await createEvent({ name: f.name, device_id: f.id, lat: f.lat ? +f.lat : undefined, lng: f.lng ? +f.lng : undefined, starts_at: f['starts-at'], ends_at: f['ends-at'], description: f.desc || undefined, og_image: f['og-image'] || undefined, requires_approval: f['requires-approval'] === true || f['requires-approval'] === 'true' || undefined, screening_questions: f['screening-questions'] ? f['screening-questions'].split('|') : undefined });
186
187
  console.log(`\n🎉 Event created!\n`);
187
188
  console.log(` Name: ${result.name}`);
188
189
  console.log(` Code: ${result.code}`);
@@ -471,6 +472,25 @@ export function handleInstallHermesPlugin() {
471
472
  console.log(" cd ~/.hermes/hermes-agent && uv pip install supabase");
472
473
  }
473
474
 
475
+ // 4. Auto-configure webhook for deliver-only push notifications
476
+ try {
477
+ // Check if hermes CLI supports --deliver-only
478
+ const helpText = execSync('hermes webhook subscribe --help', { stdio: 'pipe', timeout: 5000 }).toString();
479
+ if (helpText.includes('--deliver-only')) {
480
+ // Check if antenna-notify already exists
481
+ const existing = execSync('hermes webhook list --json', { stdio: 'pipe', timeout: 5000 }).toString();
482
+ const hooks = JSON.parse(existing);
483
+ if (!hooks.find(h => h.name === 'antenna-notify')) {
484
+ execSync('hermes webhook subscribe antenna-notify --prompt "{message}" --deliver telegram --deliver-only --description "Antenna push notifications"', { stdio: 'pipe', timeout: 10000 });
485
+ console.log("\n🔔 Webhook: antenna-notify (deliver-only → telegram)");
486
+ } else {
487
+ console.log("\n🔔 Webhook: antenna-notify already configured");
488
+ }
489
+ }
490
+ } catch {
491
+ // Webhook not available (older Hermes or gateway not running), skip silently
492
+ }
493
+
474
494
  console.log("\n✅ Antenna installed for Hermes! (Plugin + Skill + deps)");
475
495
  console.log(" Restart Hermes to activate.");
476
496
  console.log();
@@ -613,12 +633,31 @@ export async function handleWatch(f) {
613
633
  } catch (err) { /* terminal output is the fallback */ }
614
634
  }
615
635
  if (pushMethods.has("hermes")) {
636
+ // Try webhook deliver-only first (instant, zero LLM cost), fallback to cron
637
+ let hermesPushed = false;
616
638
  try {
617
- execSync(
618
- `hermes cron create "1m" ${JSON.stringify("[SYSTEM] Forward the following notification to the user exactly as-is. Do not analyze, reply, or add anything.\n\n" + message)} --name "Antenna" --deliver telegram --repeat 1`,
619
- { timeout: 30_000, stdio: "pipe" }
620
- );
621
- } catch (err) { /* terminal output is the fallback */ }
639
+ const webhookInfo = execSync('hermes webhook list --json', { timeout: 10_000, stdio: 'pipe' }).toString();
640
+ const hooks = JSON.parse(webhookInfo);
641
+ const antennaHook = hooks.find(h => h.name === 'antenna-notify' && h.deliver_only);
642
+ if (antennaHook) {
643
+ const url = antennaHook.url || 'http://localhost:8644/webhooks/antenna-notify';
644
+ const secret = antennaHook.secret;
645
+ const body = JSON.stringify({ message });
646
+ const curlCmd = secret
647
+ ? `curl -s -X POST ${JSON.stringify(url)} -H 'Content-Type: application/json' -H 'X-Webhook-Signature: sha256='$(echo -n ${JSON.stringify(body)} | openssl dgst -sha256 -hmac ${JSON.stringify(secret)} | cut -d' ' -f2) -d ${JSON.stringify(body)}`
648
+ : `curl -s -X POST ${JSON.stringify(url)} -H 'Content-Type: application/json' -d ${JSON.stringify(body)}`;
649
+ execSync(curlCmd, { timeout: 10_000, stdio: 'pipe' });
650
+ hermesPushed = true;
651
+ }
652
+ } catch { /* webhook not available */ }
653
+ if (!hermesPushed) {
654
+ try {
655
+ execSync(
656
+ `hermes cron create "1m" ${JSON.stringify("[SYSTEM] Forward the following notification to the user exactly as-is. Do not analyze, reply, or add anything.\n\n" + message)} --name "Antenna" --deliver telegram --repeat 1`,
657
+ { timeout: 30_000, stdio: "pipe" }
658
+ );
659
+ } catch (err) { /* terminal output is the fallback */ }
660
+ }
622
661
  }
623
662
  }
624
663
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antenna-fyi",
3
- "version": "1.2.39",
3
+ "version": "1.2.41",
4
4
  "description": "Antenna — nearby people discovery. CLI + MCP server + OpenClaw skill & plugin, all in one package.",
5
5
  "type": "module",
6
6
  "bin": {