dataflow.api.game_router_fixed¶

Game API router for Haive games using the discovery system.

This module discovers and loads game agents from haive-games package using the centralized discovery system, creating routes for each available game. It provides WebSocket endpoints for streaming game state and interacting with game agents.

Attributes¶

Functions¶

create_game_instance(→ dict[str, Any])

Create or get a game instance.

create_game_router(→ fastapi.APIRouter)

Create a router for a specific game type.

create_game_router_app()

Create a standalone FastAPI app for game routes.

discover_game_agents()

Discover game agents using the unified discovery system.

get_game_client_html(game_type)

Generate HTML for a specific game client.

get_game_instance(→ dict[str, Any])

Get an existing game instance.

get_index_html()

Generate HTML for the index page with links to all games.

get_router()

Get a router with all game routes configured.

main()

Run the API server as standalone.

Module Contents¶

dataflow.api.game_router_fixed.create_game_instance(game_type: str, game_id: str) dict[str, Any]¶

Create or get a game instance.

dataflow.api.game_router_fixed.create_game_router(game_type: str) fastapi.APIRouter¶

Create a router for a specific game type.

dataflow.api.game_router_fixed.create_game_router_app()¶

Create a standalone FastAPI app for game routes.

dataflow.api.game_router_fixed.discover_game_agents()¶

Discover game agents using the unified discovery system.

dataflow.api.game_router_fixed.get_game_client_html(game_type: str)¶

Generate HTML for a specific game client.

dataflow.api.game_router_fixed.get_game_instance(game_type: str, game_id: str) dict[str, Any]¶

Get an existing game instance.

dataflow.api.game_router_fixed.get_index_html()¶

Generate HTML for the index page with links to all games.

dataflow.api.game_router_fixed.get_router()¶

Get a router with all game routes configured.

dataflow.api.game_router_fixed.main()¶

Run the API server as standalone.

dataflow.api.game_router_fixed.active_connections: dict[str, set[fastapi.WebSocket]]¶
dataflow.api.game_router_fixed.active_games: dict[str, dict[str, Any]]¶
dataflow.api.game_router_fixed.game_agents¶
dataflow.api.game_router_fixed.logger¶