Commit Graph

8 Commits

Author SHA1 Message Date
Alexander Whitestone
0f1d21c5bd feat: add whisper (private DM) and inventory commands to bridge
- whisper <user_id> <message>: private messaging between online users
- whisper validates target exists and rejects self-whisper
- whisper events delivered as type='whisper' (distinct from room_broadcast)
- inventory / i: stub command for future item system
2026-04-13 16:18:46 -04:00
Alexander Whitestone
623e397d68 test: add 11 new tests for stats, go, and emote commands
- TestStatsEndpoint: empty bridge stats, stats after activity
- TestGoCommand: room change, occupant tracking, old-room notification,
  same-room rejection, missing room argument
- TestEmoteCommand: room broadcast, first-person response, no self-echo,
  /me alias support
- Also fix bare 'go'/'move' (no argument) to show usage hint
2026-04-13 15:09:52 -04:00
Alexander Whitestone
bb21d6c790 feat: add /bridge/stats endpoint, go/emote MUD commands
- /bridge/stats returns uptime, sessions, messages, rooms, WS connections
- 'go <room>' moves user between rooms via HTTP (was WS-only)
- 'emote <action>' broadcasts third-person action to room occupants
- Both commands notify other room occupants via room_events
2026-04-13 15:08:38 -04:00
Alexander Whitestone
601b7456a7 docs: add /bridge/stats to endpoint list in docstring 2026-04-13 15:08:08 -04:00
Alexander Whitestone
c954ac4db9 feat(bridge): add per-user token-bucket rate limiting
- RateLimiter class with configurable max_tokens and window
- Default 60 requests per 60 seconds per user
- 429 response with X-RateLimit headers on exceed
- Remaining tokens header on success responses
- Prevents single-user resource monopolization
2026-04-13 04:05:42 -04:00
Alexander Whitestone
cf7e754524 feat: add /bridge/rooms endpoint — world-state room listing with occupants 2026-04-13 04:05:42 -04:00
Alexander Whitestone
b8a31e07f2 feat: room broadcast — say command delivers to all occupants in room
- say <message> now queues room_broadcast events on other sessions
- New GET /bridge/room_events/{user_id} endpoint (drain-on-read)
- WS connections receive real-time room broadcasts
- 5 new tests: broadcast, no-echo, room isolation, drain, 404
- Total tests: 27 (all passing)
2026-04-13 00:34:33 -04:00
Alexander Whitestone
79b735b595 feat: add multi-user HTTP+WS bridge with session isolation
- Per-user session state with isolated message history
- Crisis detection with multi-turn 988 delivery tracking
- HTTP POST /bridge/chat (curl-testable) + WebSocket per user
- Room occupancy tracking across concurrent sessions
- Session eviction when max capacity reached
- Health and sessions list endpoints
2026-04-12 20:35:22 -04:00