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.

Functions¶

create_game_instance(game_type, game_id)

Create or get a game instance.

create_game_router(game_type)

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(game_type, game_id)

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, game_id)¶

Create or get a game instance.

Parameters:
  • game_type (str)

  • game_id (str)

Return type:

dict[str, Any]

dataflow.api.game_router_fixed.create_game_router(game_type)¶

Create a router for a specific game type.

Parameters:

game_type (str)

Return type:

fastapi.APIRouter

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)¶

Generate HTML for a specific game client.

Parameters:

game_type (str)

dataflow.api.game_router_fixed.get_game_instance(game_type, game_id)¶

Get an existing game instance.

Parameters:
  • game_type (str)

  • game_id (str)

Return type:

dict[str, Any]

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.