[The user sent a text document: 'message.txt'. Its content has been included below. The file is also saved at: /root/.hermes/cache/documents/doc_c40eef1aff86_message.txt]
[Content of message.txt]:
Create a new Hermes skill called "location_lookup" that answers questions like "where am I", "where's my phone", "where's my laptop", and "track my device".
Requirements:
1. Create the skill file at ~/.hermes/skills/location_lookup/skill.py that:
- Calls GET
http://127.0.0.1:9118/api/latest to get the latest report per device
- Reverse-geocodes the lat/lon using the free Nominatim API (
https://nominatim.openstreetmap.org/reverse) with a proper User-Agent header, params lat/lon/format=json/zoom=16, respecting their 1 req/sec rate limit
- Computes how long ago the report was made (e.g. "5 min ago", "2h ago") from the timestamp field
- Extracts battery percentage from extra_json if present
- If multiple devices are returned, list each one with its device name (or device_id if no name), reverse-geocoded place, time since last report, and battery if available
- If a specific device is referenced in the query (e.g. "phone" or "laptop"), filter to the device whose device_name or device_id best matches that keyword
- Returns a clean, human-readable multi-line string as the answer
2. Register this skill in ~/hermes-agent/skills/skills-registry.json with:
- name: location_lookup
- path pointing to the skill.py file above
- triggers: ["where am i", "where's my phone", "where is my phone", "where's my laptop", "where is my laptop", "my location", "track my device", "where's my device"]
- enabled: true
- a description explaining it looks up the latest known location of tracked devices via the self-hosted location service at location.teksploits.com
3. Verify the location service is reachable at 127.0.0.1:9118 before finishing โ if it's not reachable from wherever Hermes is running, check whether Hermes needs to reach it over Tailscale/WireGuard instead of localhost, and adjust the base URL in the skill accordingly.
4. Test the skill end-to-end by simulating the query "where's my phone" and confirm it returns a real reverse-geocoded location string pulled from the live /api/latest data, not a stub or mock response.
5. Before restarting anything, identify exactly how the Hermes gateway process (the one running "hermes_cli.main gateway run") is currently being run:
- Check for a systemd unit first:
systemctl list-units --type=service | grep -i hermes
- If none exists, find the process via
ps aux | grep hermes_cli and check if it's attached to a screen/tmux session (
screen -ls,
tmux ls) or running detached (nohup/disown)
Record the current PID and confirm the process is healthy BEFORE touching it.
Then restart it using whichever method matches how it's actually running (systemctl restart, or resending the launch command in its existing screen/tmux session, or kill + relaunch with the exact same command line it was originally started with โ copy the full command from
ps aux output first so it can be relaunched identically).
SAFETY CHECK โ do not declare success until ALL of the following are true:
- A new process for "hermes_cli.main gateway run" is confirmed running (
ps aux | grep hermes_cli) with a new PID
- The process has been up and stable for at least 30 seconds with no immediate crash/exit
- Logs (via journalctl if systemd, or the process's log file/output if not) show no startup errors or unhandled exceptions
- If possible, confirm Discord and/or Telegram connectivity is restored (e.g. bot shows online status, or a simple test message/command gets a response)
If the restart fails, the process does not come back up, or any of the above checks fail: STOP immediately, do NOT attempt further kills or restarts, and report the exact failure state (last known good PID if any, error output, current process status) so the situation can be manually recovered rather than risking a longer outage from repeated automated restart attempts.
Report back with: the final file contents, the registry entry added, the test query result, confirmation of how the gateway process is run (systemd vs. bare process) and confirmation it picked up the new skill and passed all safety checks without errors.