MicroFish/backend/app
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
..
api feat(narrative): add world + god mode API endpoints 2026-04-22 14:56:36 +05:30
models feat(i18n): replace hardcoded Chinese in backend SSE progress messages 2026-04-01 16:32:10 +08:00
services feat(narrative): extend translator with world context + dead filter 2026-04-22 14:54:22 +05:30
utils fix(i18n): validate Accept-Language header against registered locales 2026-04-02 14:20:15 +08:00
__init__.py feat(narrative): add narrative API blueprint 2026-04-20 22:02:16 +05:30
config.py fix(config): enable overriding of environment variables when loading .env file 2026-01-23 16:20:24 +08:00