Note 2: poll_fallback_seconds==0 silently means 'use default'. Document in example yaml; no v1 way to disable polling, and we don't think anyone needs that. Note 3: Writer.locks grows unbounded. Bounded in practice (<10 agents); add a comment for the future maintainer who may need to evict. Notes 1 and 4 left unchanged: missingkey=zero is the friendlier choice (produces a visible '<no value>' in the inbox rather than a silent 500); fsnotify double-fire is already handled by os.ErrNotExist on second-read. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
55 lines
2 KiB
YAML
55 lines
2 KiB
YAML
# agent-watcher Collector configuration
|
|
#
|
|
# Lives at: ~/.config/agent-watcher/collector.yaml
|
|
# Override with --config or AGENT_WATCHER_CONFIG.
|
|
#
|
|
# At least one source (webhook OR drop_folder) must be configured.
|
|
|
|
# This host's identity. Used in logs only; the inbox writer routes by
|
|
# the recipient field on each event, not this.
|
|
agent: foreman
|
|
|
|
# Optional. Where to write <recipient>.inbox files. Default shown.
|
|
# inbox_dir: ~/Nyx/workspace/pings
|
|
|
|
sources:
|
|
|
|
# HTTP webhook source.
|
|
# v1 binds loopback only — Caddy + bearer-token reverse-proxy is the
|
|
# v2 upgrade path for accepting webhooks from external producers.
|
|
webhook:
|
|
listen: 127.0.0.1:18790
|
|
routes:
|
|
# Path → which inbox to land in, with a Go text/template payload.
|
|
# Variables come from the request body decoded as JSON.
|
|
/forgejo/push:
|
|
recipient: bob
|
|
type: INFO
|
|
payload_template: "forgejo push to {{ .repo }} by {{ .actor }}"
|
|
|
|
# Empty-body posts work too — fixed-string templates render without
|
|
# any data.
|
|
/openrouter/billing-alert:
|
|
recipient: bob
|
|
type: NEEDS-RESPONSE
|
|
priority: urgent
|
|
payload_template: "billing alert: {{ .message }}"
|
|
|
|
# Drop-folder source.
|
|
# Watches a directory via inotify for *.json files matching the spec
|
|
# §3.1.2 schema:
|
|
# {
|
|
# "recipient": "bob",
|
|
# "type": "INFO" | "NEEDS-RESPONSE" | "ACK-REQUEST",
|
|
# "priority": "normal" | "urgent", # optional
|
|
# "payload": "...",
|
|
# "sentinel": "/path/optional" # optional
|
|
# }
|
|
# Valid → emit + delete. Invalid → moved to .dead-letter/ with reason.
|
|
drop_folder:
|
|
path: ~/Nyx/workspace/incoming/
|
|
# Safety net if inotify misses an event. 0 (or unset) = use the
|
|
# 30-second default. There is no "disable polling" option in v1 —
|
|
# if you don't want polling, leave inotify to do its job and ignore
|
|
# the cost (a periodic readdir is microseconds).
|
|
poll_fallback_seconds: 30
|