[kimi] Add /api/matrix/config endpoint for world configuration (#674) #736

Merged
kimi merged 1 commits from kimi/issue-674 into main 2026-03-21 14:25:19 +00:00
Collaborator

Fixes #674

Summary

Added GET /api/matrix/config endpoint that serves world configuration to the Matrix frontend, enabling config-driven rendering instead of hardcoded values.

Changes

  • config/matrix.yaml (new): World configuration file with lighting presets, environment settings, and feature flags
  • src/dashboard/routes/world.py: Added /api/matrix/config endpoint with:
    • _DEFAULT_MATRIX_CONFIG: Sensible fallback defaults
    • _load_matrix_config(): Loads config from YAML with graceful fallback
    • get_matrix_config(): FastAPI route handler returning JSON config
  • tests/dashboard/test_world_api.py: Added comprehensive tests for the new endpoint

Response Structure

{
  "lighting": {
    "ambient_color": "#1a1a2e",
    "ambient_intensity": 0.4,
    "point_lights": [...]
  },
  "environment": {
    "rain_enabled": false,
    "starfield_enabled": true,
    "fog_color": "#0f0f23",
    "fog_density": 0.02
  },
  "features": {
    "chat_enabled": true,
    "visitor_avatars": true,
    "pip_familiar": true,
    "workshop_portal": true
  }
}

Testing

  • All unit tests pass (tox -e unit)
  • Lint checks pass (tox -e lint)
  • New tests cover endpoint structure, config loading, fallback behavior, and edge cases
Fixes #674 ## Summary Added GET /api/matrix/config endpoint that serves world configuration to the Matrix frontend, enabling config-driven rendering instead of hardcoded values. ## Changes - **config/matrix.yaml** (new): World configuration file with lighting presets, environment settings, and feature flags - **src/dashboard/routes/world.py**: Added `/api/matrix/config` endpoint with: - `_DEFAULT_MATRIX_CONFIG`: Sensible fallback defaults - `_load_matrix_config()`: Loads config from YAML with graceful fallback - `get_matrix_config()`: FastAPI route handler returning JSON config - **tests/dashboard/test_world_api.py**: Added comprehensive tests for the new endpoint ## Response Structure ```json { "lighting": { "ambient_color": "#1a1a2e", "ambient_intensity": 0.4, "point_lights": [...] }, "environment": { "rain_enabled": false, "starfield_enabled": true, "fog_color": "#0f0f23", "fog_density": 0.02 }, "features": { "chat_enabled": true, "visitor_avatars": true, "pip_familiar": true, "workshop_portal": true } } ``` ## Testing - All unit tests pass (`tox -e unit`) - Lint checks pass (`tox -e lint`) - New tests cover endpoint structure, config loading, fallback behavior, and edge cases
kimi added 1 commit 2026-03-21 14:24:45 +00:00
feat: Add /api/matrix/config endpoint for world configuration
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
84e18d6b88
- Add GET /api/matrix/config endpoint that serves world config to Matrix
- Create config/matrix.yaml with lighting, environment, and feature settings
- Implement fallback to sensible defaults if config file is missing/invalid
- Add comprehensive tests for the new endpoint

Fixes #674
kimi merged commit 9d4ac8e7cc into main 2026-03-21 14:25:19 +00:00
kimi deleted branch kimi/issue-674 2026-03-21 14:25:20 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#736