{"id":50145106,"url":"https://github.com/budtmo/mazer","last_synced_at":"2026-05-24T03:34:13.666Z","repository":{"id":355463809,"uuid":"1208849914","full_name":"budtmo/mazer","owner":"budtmo","description":"a simple dungeon-escape game featuring an AI agent","archived":false,"fork":false,"pushed_at":"2026-04-12T20:33:19.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-24T03:34:05.788Z","etag":null,"topics":["ai-agent","maze-game"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/budtmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS","copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-12T20:28:18.000Z","updated_at":"2026-04-13T19:53:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/budtmo/mazer","commit_stats":null,"previous_names":["budtmo/mazer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/budtmo/mazer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budtmo%2Fmazer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budtmo%2Fmazer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budtmo%2Fmazer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budtmo%2Fmazer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/budtmo","download_url":"https://codeload.github.com/budtmo/mazer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/budtmo%2Fmazer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33420660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","maze-game"],"created_at":"2026-05-24T03:34:10.928Z","updated_at":"2026-05-24T03:34:13.659Z","avatar_url":"https://github.com/budtmo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mazer\n\nMazer is a simple dungeon-escape game. You are trapped in a 2×2 grid. Find the exit to escape! This project contains example of AI Agent to play the game by itself (currently it support Gemini AI).\n\n```\n    col 0      col 1\n   ┌──────────┬──────────┐\nr1 │  OPEN    │  EXIT 🚪 │  ← reach EXIT to win\n   ├──────────┼──────────┤\nr0 │  START ⚑ │  WALL 🧱 │  ← you always begin here (0,0)\n   └──────────┴──────────┘\n```\n\n- **Coordinates**: `(x=col, y=row)` — `y` increases going **up**.\n- You start at `(0, 0)`.\n- The exit is at `(1, 1)`.\n- Winning path:  UP → RIGHT  (2 moves)\n\n## How It Works (the short version)\n\n1. **Register** — `POST /users` with a name → you get a `user_id`.\n2. **Start a game** — `POST /start` with your `user_id` → you get a `session_id`.\n3. **Move** — `POST /game/{session_id}/move` with a direction (`up`, `down`, `left`, `right`).\n4. Repeat until you **win** or get **blocked** by a wall.\n\n## Quick Start using docker\n\n1. Run the services with command: ```./app.sh run``` or  ```GOOGLE_API_KEY=\"xxx\" ./app.sh run --with-agent``` if you want to run the AI-Agent in parallel.\n\n2. Open:\n    - ```http://localhost:8000/ui``` for the UI\n    - ```http://localhost:8000/docs``` for the Swagger UI\n    - ```http://localhost:8000/openapi.json``` for the OpenAPI specification\n    - ```http://localhost:8501``` for the Gemini Agent\n\n\u003cp\u003e\n  \u003cimg src=\"images/swagger.png\" width=\"80%\" /\u003e\u003cbr\u003e\u003cbr\u003e\n  \u003cimg src=\"images/game-ui.png\" width=\"80%\" /\u003e\u003cbr\u003e\u003cbr\u003e\n  \u003cimg src=\"images/ai-agent.png\" width=\"80%\" /\u003e\n\u003c/p\u003e\n\n## Run Tests using docker\n\n```./app.sh test```\n\n## Endpoints\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `GET` | `/ui` | Game UI (HTML interface) |\n| `POST` | `/users` | Register a new player (returns `id`) |\n| `GET` | `/users` | List all players |\n| `DELETE` | `/users/{user_id}` | Delete a player and all their sessions |\n| `POST` | `/start` | Start a new game session (requires `user_id`, returns `session_id`) |\n| `POST` | `/game/{session_id}/move` | Make a move: `up`, `down`, `left`, `right` |\n| `POST` | `/game/{session_id}/reset` | Reset a finished/abandoned session back to the start |\n| `GET` | `/game/{session_id}` | Get current state + full move history |\n| `GET` | `/games` | List all sessions |\n| `DELETE` | `/game/{session_id}` | Abandon a session |\n\n### Move result values\n\n| `result` | Meaning |\n|----------|---------|\n| `moved` | Successfully stepped to a new cell |\n| `blocked` | Wall or boundary — position unchanged |\n| `won` | Reached the exit — game complete |\n\n### Session status values\n\n| `status` | Meaning |\n|----------|---------|\n| `active` | Game in progress |\n| `won` | Player reached the exit |\n| `abandoned` | Player called DELETE |\n\n## Note\n\n**Why separate users and sessions?**\n\u003e A user is your permanent account (just an id + name). A game session is one play-through. You can start many sessions with the same user and compare runs. Deleting a user also removes all their sessions. Two sessions can't use the same session simultaneously — moves are **locked at the database row level** to prevent race conditions from parallel requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudtmo%2Fmazer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbudtmo%2Fmazer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbudtmo%2Fmazer/lists"}