Mud Routes

app.routes_mud contains the /api/mud/* proxy router that fronts mud-server authentication, world selection, and world metadata endpoints.

Mud-server proxy routes for the Axis Descriptor Lab.

This router owns the /api/mud/* endpoints that proxy authentication, session, and world-selection requests to the optional Pipe-Works mud server. The logic here is intentionally thin: validate the local mode, delegate to the shared mud client, and translate connection/session failures into stable HTTP responses for the frontend.

app.routes_mud.mud_mode()[source]

Return the active runtime chat mode and available mode options.

app.routes_mud.mud_set_mode(req)[source]

Switch the active chat translation mode without restarting the app.

app.routes_mud.mud_login(req)[source]

Proxy login to the mud server and store the session in memory.

app.routes_mud.mud_logout()[source]

Clear the mud server session from memory.

app.routes_mud.mud_session()[source]

Return current mud server auth status and translation mode.

app.routes_mud.mud_worlds()[source]

Proxy to GET /api/lab/worlds on the mud server.

app.routes_mud.mud_world_config(world_id)[source]

Proxy to GET /api/lab/world-config/{world_id} on the mud server.

app.routes_mud.mud_world_prompts(world_id)[source]

Proxy to GET /api/lab/world-prompts/{world_id} on the mud server.

app.routes_mud.mud_world_image_policy_bundle(world_id)[source]

Proxy to GET /api/lab/world-image-policy-bundle/{world_id} on the mud server.

app.routes_mud.mud_pipeline_build_bootstrap(world_id)[source]

Return stage-1/2 metadata in one payload for Pipeline Build.

This endpoint intentionally aggregates multiple mud-server calls so the frontend can avoid orchestration race conditions across session/world/policy lookups.

app.routes_mud.mud_pipeline_build_resolve_image_selection(req)[source]

Return canonical selection metadata and deterministic pre-compile hashes.

The route delegates selection to canonical mud-server compile logic and then strips final prompt text, returning only stage-5/6/7 metadata for the UI.

app.routes_mud.mud_pipeline_build_generate_condition_axis(req)[source]

Generate canonical condition-axis payload from mud-server policy rules.

The endpoint keeps Stage 4 canonical in production mode by delegating axis generation to mud-server APIs rather than local preset/manual editing.

app.routes_mud.mud_compile_image_prompt(req)[source]

Proxy POST /api/lab/compile-image-prompt using the active mud session.

app.routes_mud.mud_select_world(req)[source]

Store the selected world_id in the MudServerClient’s memory.