TL;DR
Add several new events to the game to enable mods keeping an up-to-date list of ghost entities.What ?
I suggest adding the following events to the game:1. on_post_entity_created - an event triggered always after a new entity was created, irrespective of the way it has been created (by the player, by robots, by blueprint, whatever).
2. on_post_entity_removed - an event triggered always after an entity is removed, irrespective of the way it happens (destroyed, mined, deconstructed, player builds something else over a ghost, whatever).
3. on_item_requests_updated - an event triggered each time the `item_requests` dictionary is updated.
4. one of the following, which would again happen regardless of the way a ghost is revived (player built, robot built, whatever):
4a. ensure that reviving a ghost generates a `on_post_entity_removed` event for the ghost entity, and a `on_post_entity_created` event for the new constructed entity; or
4b. on_ghost_revived - triggered every time a ghost is revived
5. (bonus) on_neighbour_connected and on_neighbour_disconnected - triggered each time an entity's circuit network neighbours are updated