Skip to main content
Notifications tell an agent when files or directories change in the virtual filesystem. For example, a teammate edits a report in connected storage, and your agent receives the report’s virtual path and what happened to it.

How it works

  1. Your application receives a service notification or checks for changes.
  2. It reports each change to Mirage with ws.notify().
  3. The agent receives it through ws.events().
Your application connects the service’s notifications to Mirage. Subscribing with ws.events() alone does not start a file watcher or check the service.

Listen for changes

Here, ws is your workspace with a VFS connected at /data. This listens for changes anywhere under that path:
For example, after your application reports an edit to report.csv, the listener prints:
Output
update means the existing file’s contents or metadata changed. To listen to fewer files, change the path:

Notification types

Each notification includes the virtual path and what happened:

Connect your VFS

VFS Notifications lists the supported services, Python and TypeScript functions, and how to report a change with ws.notify().