Skip to content

Commit bb95fbb

Browse files
committed
Prepare public repo docs and browser checks
1 parent 4f1a093 commit bb95fbb

7 files changed

Lines changed: 101 additions & 17 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ This file is for AI coding agents and humans using them.
2121
- Optional game list: `config/known-games.json`
2222
- Local game generator: `scripts/local-games.mjs`
2323
- Virtual controller helper for AI browser checks: `scripts/virtual-controllers.mjs`
24+
- Host DEV automation bridge for browser checks: `apps/host/src/app/appBootstrap.ts`
2425
- Catalog: `packages/game-core/src/catalog/gameCatalog.ts`
2526
- Shared protocol exports: `packages/protocol/src/index.ts`
2627
- Room lifecycle: `apps/server/src/rooms/roomLifecycle.ts`

CONTRIBUTING.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,9 @@ If those terms do not work for you, please discuss before contributing.
2727

2828
All games are currently alpha. Balance, pacing, scoring, and content may change substantially, and contributions that make the games easier to understand, fairer, or more fun are welcome.
2929

30-
New or changed games usually need updates in all of these places:
31-
32-
- `packages/game-core/src/catalog/gameCatalog.ts`
33-
- `packages/game-core/src/catalog/i18n/gameTexts.ts`
34-
- `packages/protocol/src/games/*`
35-
- `apps/server/src/game-engine/gameRegistry.ts`
36-
- `apps/server/src/games/*`
37-
- `apps/host/src/games/*`
38-
- `apps/controller/src/controller-ui/games/*`
39-
- docs
30+
Games live in optional repos under `local-games/` during local development. A game repo owns its server logic, protocol types, host scene, controller model, assets, manifest, README, and package entrypoints.
31+
32+
The Platform owns common room lifecycle, generated optional game registries, reusable controller layouts, generic setup rendering, and shared DTO/socket contracts. Add a game to `config/known-games.json`, then run `npm run games:sync-local` so the generated registries import only locally available games.
4033

4134
The server must remain authoritative. Controllers should send input, not decide winners. Before adding a controller layout, check whether an existing layout can be reused or extended.
4235

apps/host/src/app/appBootstrap.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { mountFullscreenOverlay } from "./fullscreenOverlay.js";
66
import { mountScreenWakeLock } from "./screenWakeLock.js";
77
import { mountBackgroundMusic } from "./backgroundMusic.js";
88
import { createHostRouter } from "./router.js";
9-
import { HostSocketClient } from "./hostSocketClient.js";
9+
import { HostSocketClient, type HostAppState } from "./hostSocketClient.js";
1010
import { mountJoinOverlay } from "./joinOverlay.js";
1111
import {
1212
applyHostFps,
@@ -21,6 +21,36 @@ import { RoundIntroScene } from "../scenes/RoundIntroScene.js";
2121
import { ScoreboardScene } from "../scenes/ScoreboardScene.js";
2222
import { externalHostScenes } from "../games/.generated/externalGames.js";
2323

24+
interface HostAutomationBridge {
25+
getState: () => HostAppState;
26+
kickPlayer: (playerId: string) => void;
27+
returnToGameSelection: () => void;
28+
selectGame: (gameId: string) => void;
29+
sendGameHostAction: (gameId: string, action: unknown) => void;
30+
startRound: () => void;
31+
}
32+
33+
declare global {
34+
interface Window {
35+
__openPartyLabHost?: HostAutomationBridge;
36+
}
37+
}
38+
39+
function exposeHostAutomationBridge(hostClient: HostSocketClient): void {
40+
if (!import.meta.env.DEV) {
41+
return;
42+
}
43+
44+
window.__openPartyLabHost = {
45+
getState: () => hostClient.getState(),
46+
kickPlayer: (playerId) => hostClient.kickPlayer(playerId),
47+
returnToGameSelection: () => hostClient.returnToGameSelection(),
48+
selectGame: (gameId) => hostClient.selectGame(gameId),
49+
sendGameHostAction: (gameId, action) => hostClient.sendGameHostAction(gameId, action),
50+
startRound: () => hostClient.startRound()
51+
};
52+
}
53+
2454
export function bootstrapHostApp(): Phaser.Game {
2555
const serverUrl = import.meta.env.VITE_SERVER_URL ?? "http://localhost:3000";
2656
const hostClient = new HostSocketClient(serverUrl);
@@ -58,6 +88,7 @@ export function bootstrapHostApp(): Phaser.Game {
5888
mountFullscreenOverlay(hostClient);
5989
mountScreenWakeLock();
6090
mountBackgroundMusic(hostClient);
91+
exposeHostAutomationBridge(hostClient);
6192
hostClient.connect();
6293

6394
return game;

docs/architecture.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Open Party Lab is a TypeScript npm-workspace monorepo for local browser party ga
1010

1111
## Shared Packages
1212

13-
- `packages/protocol`: event names, client/server event payloads, DTOs, game-specific payloads
14-
- `packages/game-core`: game manifests, catalog, localization hooks, round phase helpers, shared gameplay contracts
13+
- `packages/protocol`: event names, client/server event payloads, and shared DTOs
14+
- `packages/game-core`: game manifests, layout keys, round phase helpers, and shared gameplay contracts
1515
- `packages/ui-kit`: shared UI tokens
1616
- `packages/utils`: generic utilities
1717

@@ -21,7 +21,7 @@ Open Party Lab is a TypeScript npm-workspace monorepo for local browser party ga
2121
2. Controllers send intent; they do not decide outcomes.
2222
3. Host scenes render state; they do not own game rules.
2323
4. Protocol types are the contract between all apps.
24-
5. New games should be additive: manifest, server implementation, host scene, controller model, registry entries, docs.
24+
5. New games should live in optional game repos and expose only the documented package entrypoints.
2525

2626
## Runtime Flow
2727

@@ -56,9 +56,10 @@ Game-specific state should fit inside this lifecycle unless there is a strong re
5656

5757
Main registry files:
5858

59-
- `packages/game-core/src/catalog/gameCatalog.ts`
59+
- `config/known-games.json`
60+
- `scripts/local-games.mjs`
6061
- `apps/server/src/game-engine/gameRegistry.ts`
6162
- `apps/host/src/games/registry.ts`
6263
- `apps/controller/src/controller-ui/games/registry.tsx`
6364

64-
If a game is added or removed, check all of them.
65+
`npm run games:sync-local` generates optional registry imports from the local repos it finds. Missing optional game repos are normal and must not break `dev`, `typecheck`, or `build`.

docs/project-status.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Platform:
1717
- host controls for language, FPS, and player moderation outside active rounds
1818
- optional local game-repo discovery through `npm run games:list` and `npm run games:sync-local`
1919
- virtual controller helper for AI browser checks through `npm run ai:controllers`
20+
- host DEV automation bridge for browser checks exposed only by the Vite dev host
2021

2122
Optional local game repos:
2223

docs/protocol.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@ The shared protocol lives in `packages/protocol`.
4040

4141
## Game Payloads
4242

43-
Game-specific types live in `packages/protocol/src/games/*`. When a game adds public state, controller state, host actions, or inputs, define those contracts there and export them from `packages/protocol/src/index.ts`.
43+
Game-specific types belong in each optional game repo under its `./protocol` package entrypoint. The Platform should import only public game package entrypoints generated by `npm run games:sync-local`, not private files from a game repo.
44+
45+
Some legacy shared layout models still reference older protocol types while the Platform keeps those reusable controller layouts. Do not add new game-specific protocol files to `packages/protocol` without maintainer approval.

docs/repository-descriptions.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Repository Descriptions
2+
3+
Short descriptions and topics for GitHub repository metadata.
4+
5+
## Tap Race
6+
Description: Fast tap-mash race for Open Party Lab where players sprint by tapping their phone controller.
7+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer tap-race
8+
9+
## Pantomime
10+
Description: Charades-style Open Party Lab game where one player performs prompts while the others guess.
11+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer charades
12+
13+
## Air Hockey
14+
Description: Two-player arcade air hockey for Open Party Lab with phone joystick controls.
15+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer air-hockey
16+
17+
## Tabu
18+
Description: Taboo-inspired word explanation game for Open Party Lab with team and party flow.
19+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer word-game
20+
21+
## Imposter
22+
Description: Social deduction prompt game for Open Party Lab where players identify the bluffing player.
23+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer social-deduction
24+
25+
## Schaetzorama
26+
Description: Colorful estimation quiz for Open Party Lab with numeric, ranking, and assignment questions.
27+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer quiz-game
28+
29+
## Light Trails
30+
Description: Realtime trail-survival arena game for Open Party Lab with compact phone steering.
31+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer arcade
32+
33+
## Drift Racer
34+
Description: Arcade drift racing game for Open Party Lab with phone racing controls and shared host action.
35+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer racing-game
36+
37+
## Word Tiles
38+
Description: Shared word-board tile game for Open Party Lab with phone rack controls and premium fields.
39+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer word-game
40+
41+
## Zeichnen & Erraten
42+
Description: Drawing and guessing party game for Open Party Lab with phone drawing controls and word categories.
43+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer drawing-game
44+
45+
## Arena Survivor
46+
Description: Co-op arena survival game for Open Party Lab with character choices, waves, and difficulty setup.
47+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer arena-survival
48+
49+
## MinionsTD
50+
Description: Competitive tower-defense game for Open Party Lab where players build towers and send minions.
51+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer tower-defense
52+
53+
## Chaos-Kommando
54+
Description: Turn-based cartoon artillery game for Open Party Lab with mercenaries, wild weapons, and destructible terrain.
55+
Topics: open-party-lab party-game browser-game phaser typescript local-multiplayer artillery-game

0 commit comments

Comments
 (0)