Register Monitors¶
Registering a monitor has two layers:
- Save a ChatEvent
Subscriptiondescribing the platform, scope, and action kinds to observe. - Configure the platform's official webhook, event queue, or bounded API cursor so real events reach ChatEvent.
Create a ChatEvent subscription¶
curl -k -X POST https://event.public.wzhecnu.cn/api/subscriptions \
-H 'Content-Type: application/json' \
-d '{
"id": "discourse-practice",
"source": "discourse",
"target": "category:agent-runs",
"label": "Discourse practice",
"event_kinds": ["topic.created", "post.created", "reply.created"],
"capture_modes": ["webhook", "api_cursor"],
"filters": {"category": "agent-runs"},
"labels": ["practice", "forum"]
}'
The id becomes the webhook URL's subscription_id, so each captured event can be filtered and can update subscription cursors.
Discourse webhook¶
Discourse supports official webhooks. Configure the platform payload URL as:
Recommended Discourse event types:
The ChatEvent endpoint reads the X-Discourse-Event header and normalizes:
post_created + post_number == 1topost.createdpost_created + post_number > 1toreply.created
Zulip event queue¶
Zulip should use the official event queue first:
uv run --extra serve chatevent capture zulip-once \
--env-file ~/.chatarch/envs/Zulip/.env \
--stream "chatevent-practice" \
--topic "real-loop" \
--subscription-id zulip-practice
Platform secrets are managed by ChatEnv profiles or service secret files; ChatEvent references them by path only and does not copy or print secrets. A long-running capture should later be supervised by a proper service/cron/watchdog; the current CLI is a bounded capture pass.
Gitea webhook¶
Gitea repository/org webhook payload URL:
The current normalizer supports issue payloads and the first action catalog. Recommended events:
GitHub webhook¶
GitHub repository webhook payload URL:
GitHub sends the event name through X-GitHub-Event. ChatEvent acknowledges ping without writing it to the event stream; push normalizes to commit.pushed.
Acceptance checks¶
After registering a monitor, verify with:
curl -k https://event.public.wzhecnu.cn/api/stats
curl -k 'https://event.public.wzhecnu.cn/api/events?source=discourse&days=7&limit=20'
Or open the Observatory, wait up to 5 seconds for automatic refresh, or click Refresh manually. The top Event Stream filter keeps only source and time dropdowns; action kinds, subscriptions/channels, keyword search, and custom captured-at ranges live under Advanced options, with action-kind multi-select bound to the selected source.