feat: Add PREVIEW_EVENT_TYPES, CONVERSATION_EVENT_TYPES, and subscription procedures

- Add preview:building/ready/stopped/failed to ALL_EVENT_TYPES
- Export PREVIEW_EVENT_TYPES and CONVERSATION_EVENT_TYPES constants
- Add onPreviewUpdate and onConversationUpdate subscription procedures
- Add audit comment confirming phase:pending_review presence (gap 3 verified)
- Add unit tests covering constants, filtering behavior, and procedure shape
- Update server-api.md to document new subscription procedures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas May
2026-03-05 17:07:00 +01:00
parent 865e8bffa0
commit 209629241d
3 changed files with 152 additions and 2 deletions

View File

@@ -205,10 +205,12 @@ Each procedure uses `require*Repository(ctx)` helpers that throw `TRPCError(INTE
### Subscriptions (SSE)
| Procedure | Type | Events |
|-----------|------|--------|
| onEvent | subscription | All 30+ event types |
| onEvent | subscription | All event types |
| onAgentUpdate | subscription | agent:* events (8 types) |
| onTaskUpdate | subscription | task:* + phase:* events (8 types) |
| onPageUpdate | subscription | page:created/updated/deleted |
| onPreviewUpdate | subscription | preview:building/ready/stopped/failed |
| onConversationUpdate | subscription | conversation:created/answered |
Subscriptions use `eventBusIterable()` — queue-based async generator, max 1000 events, 30s heartbeat.