Work on Game Playground (frontend /playground and backend game API). Use for adding/debugging games, render modes (scene vs frame), session lifecycle, controls/keyboard, and backend environments (Gymnasium, Snake, Tetris). 游戏游乐场开发:新增/排查游戏、前后端协议、渲染模式(scene/frame)、会话管理、键盘与控制面板。
backend/main.py.backend/engine/session_manager.py.backend/engine/gym_wrapper.py.Endpoints:
GET /healthPOST /api/game/start body: { "env_id": "<gameId>", "config": { ... } }POST /api/game/{session_id}/step body: { "action": <int> }POST /api/game/{session_id}/resetDELETE /api/game/{session_id}Rendering:
render.mode === "scene": frontend should draw from render.scene.render.mode === "frame": frontend should display render.frame / state.frame (often a data URL).src/app/playground/page.tsx + src/lib/games/registry.tssrc/app/playground/[gameId]/page.tsxsrc/components/features/playground/src/components/games/renderers/*src/components/games/controls/*, src/components/games/settings/*src/lib/games/registry.ts (id, category, renderMode, actions, available).backend/engine/games/ and map it in backend/engine/session_manager.py.env_id is valid for gymnasium.make.renderMode: "scene", add/extend renderer + types under src/components/games/.src/components/features/playground/types.ts.Run the bundled script after starting the backend:
python docs/skills/agent-studio-playground/scripts/smoke_game_api.py --env-id CartPole-v1 --steps 5