Add typed reactions (approve/reject/in_progress/done/published) with
toggle semantics. Workflow state derived from highest-priority reaction.
New reactions package with model, SQLite store, and service layer.
REST API: POST/GET/DELETE /api/messages/{id}/reactions for toggle/query,
PUT /api/channels/{name}/settings for workflow config, GET by-state
endpoint for listing messages by workflow state.
MCP: react/unreact/get_reactions/list_by_state actions via bridge.
Web UI: WorkflowBadge (colored state pills) and ReactionPills (toggle
pills with agent names) components integrated into channel view.
Channel settings: auto_approve, stalemate_remind_after,
stalemate_escalate_after columns. CLI: channels update command.
Migration 013_reactions.sql adds message_reactions table and channel
workflow columns. 29+ new test cases across model and store.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.3 KiB
2.3 KiB
Quickstart: Message Reactions & Workflow States
Testing Reactions via curl
Add a reaction
curl -X POST http://localhost:8080/api/messages/123/reactions \
-H "Cookie: session=YOUR_SESSION" \
-H "Content-Type: application/json" \
-d '{"reaction": "approve"}'
Add reaction with metadata
curl -X POST http://localhost:8080/api/messages/123/reactions \
-H "Cookie: session=YOUR_SESSION" \
-H "Content-Type: application/json" \
-d '{"reaction": "published", "metadata": {"url": "https://blog.example.com/post"}}'
Toggle off (call same reaction again)
curl -X POST http://localhost:8080/api/messages/123/reactions \
-H "Cookie: session=YOUR_SESSION" \
-H "Content-Type: application/json" \
-d '{"reaction": "approve"}'
# Returns {"action": "removed", ...}
Get reactions for a message
curl http://localhost:8080/api/messages/123/reactions \
-H "Cookie: session=YOUR_SESSION"
List messages by workflow state
curl "http://localhost:8080/api/channels/new_posts/messages/by-state?state=proposed" \
-H "Cookie: session=YOUR_SESSION"
Update channel workflow settings
curl -X PUT http://localhost:8080/api/channels/new_posts/settings \
-H "Cookie: session=YOUR_SESSION" \
-H "Content-Type: application/json" \
-d '{"auto_approve": true, "stalemate_remind_after": "12h"}'
Testing via MCP
call('react', {message_id: 123, reaction: 'approve'})
call('react', {message_id: 123, reaction: 'published', metadata: {url: 'https://blog.example.com'}})
call('get_reactions', {message_id: 123})
call('list_by_state', {channel: 'new_posts', state: 'proposed'})
call('unreact', {message_id: 123, reaction: 'approve'})
Testing via CLI
./synapbus channels update --name new_posts --auto-approve=true --stalemate-remind-after=12h --stalemate-escalate-after=48h
Web UI
- Navigate to a channel (e.g., #new_posts)
- Messages show colored workflow badges (yellow=proposed, green=approved, blue=in_progress, red=rejected, cyan=published)
- Hover over a message to see reaction pills
- Click a reaction pill to toggle your reaction
- Published messages show clickable URL links
- Channel info panel shows workflow settings (auto-approve toggle, timeout inputs)