File Watcher
Notice added, modified and removed files in allowed directories by polling, snapshot to a self-contained cursor, list changes since a cursor, or wait up to 5 minutes for the next change, bounded, read-only, never follows symlinks
About
A Graphrt plugin that notices new, changed and removed files in directories you allow. graphrt nodes and tools are request/response, so there is no background watcher: the plugin polls. A snapshot becomes a cursor, later calls rescan and report what changed since that cursor, or wait (up to five minutes) for the next change.
What it can do
- snapshot: records the entries under a directory (type, size, modified time) and returns a cursor.
- list_changes: rescans the cursor's directory and returns added, modified and removed entries, with a new cursor to continue from.
- wait_for_change: polls every poll_interval_ms (default 2000, at least 250) until something changes or timeout_seconds (default 60, at most 300) pass, returns changed, the changes and a new cursor either way. With a cursor, changes made since that cursor are returned at once, so nothing is missed between calls.
- Filters: max_depth (default 5, at most 20), include_hidden, name_pattern ( and ?, e.g. .csv).
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Snapshot a directory
file-watcher.snapshot - List changes since a cursor
file-watcher.list_changes - Wait for a change
file-watcher.wait_for_change
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
FILE_WATCHER_ALLOWED_DIRS(required)Comma-separated directories (absolute or ~/...) that may be watched, subdirectories included -
FILE_WATCHER_MAX_ENTRIES10000Most entries one snapshot looks at, counting those name_pattern skips (10 to 100000), a bigger tree gives truncated: true
How to use it
In Graphrt Desktop
- Open Plugins and search for File Watcher.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
$ graphrt plugin install file-watcher - { id: changes, type: file-watcher.list_changes, cursor: "{{#saved.data.value#}}" }