MicroFish/backend/app/api
anadoris007 2eb98a00bd feat(narrative): add world + god mode API endpoints
Six new endpoints under /api/narrative/*:
- GET  /world/<sim_id>                       — full world state
- POST /world/<sim_id>/rules                 — replace rules list
- POST /world/<sim_id>/locations             — upsert location
- POST /godmode/<sim_id>/inject-event        — inject world event
- POST /godmode/<sim_id>/modify-emotion      — overwrite emotions
- POST /godmode/<sim_id>/kill                — kill character

Validation:
- 400 on missing required fields (description, character_id, rules)
- 400 on invalid round (must be non-negative int or null)
- 404 on character not found (from ValueError in handlers)

Smoke-tested via Flask test client — all 11 response codes correct.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-22 14:56:36 +05:30
..
__init__.py feat(narrative): add narrative API blueprint 2026-04-20 22:02:16 +05:30
graph.py fix(i18n): pass locale to background threads via thread-local storage 2026-04-01 16:55:51 +08:00
narrative.py feat(narrative): add world + god mode API endpoints 2026-04-22 14:56:36 +05:30
report.py fix(i18n): pass locale to background threads via thread-local storage 2026-04-01 16:55:51 +08:00
simulation.py fix(i18n): replace hardcoded Chinese stage names in simulation prepare SSE 2026-04-01 17:31:00 +08:00