{ "argumentSchema": { "$defs": { "Coordinate": { "properties": { "col": { "type": "number" }, "row": { "type": "number" } }, "required": [ "row", "col" ], "type": "object" }, "GameState": { "properties": { "currentTurn": { "enum": [ 1, 2 ] }, "lastMessage": { "type": "string" }, "phase": { "enum": [ "waiting", "playing", "finished" ] }, "winner": { "enum": [ 1, 2, null ] } }, "required": [ "phase", "currentTurn", "winner", "lastMessage" ], "type": "object" }, "PlayerData": { "properties": { "avatar": { "description": "Avatar URL or glyph, snapshotted from the joiner's shared profile.", "type": "string" }, "color": { "type": "string" }, "joinedAt": { "type": "number" }, "name": { "type": "string" }, "ships": { "items": { "$ref": "#/$defs/Ship" }, "type": "array" } }, "required": [ "name", "ships", "color", "joinedAt" ], "type": "object" }, "Ship": { "properties": { "orientation": { "enum": [ "horizontal", "vertical" ] }, "start": { "$ref": "#/$defs/Coordinate" }, "type": { "$ref": "#/$defs/ShipType" } }, "required": [ "type", "start", "orientation" ], "type": "object" }, "ShipType": { "enum": [ "carrier", "battleship", "cruiser", "submarine", "destroyer" ] }, "ShotsState": { "properties": { "1": { "items": { "items": { "$ref": "#/$defs/SquareState" }, "type": "array" }, "type": "array" }, "2": { "items": { "items": { "$ref": "#/$defs/SquareState" }, "type": "array" }, "type": "array" } }, "required": [ "1", "2" ], "type": "object" }, "SquareState": { "enum": [ "empty", "miss", "hit" ] } }, "description": "Shared match state is per-space; viewer identity is scoped per user. The\njoin name/avatar come from the viewer's shared profile (resolved via\n`wish({ query: \"#profile\" })` in the lobby), so there is no join-form text.", "properties": { "gameName": { "default": "Battleship", "scope": "space", "type": "string" }, "gameState": { "$ref": "#/$defs/GameState", "asCell": [ { "kind": "cell", "scope": "space" } ], "default": { "currentTurn": 1, "lastMessage": "Waiting for players...", "phase": "waiting", "winner": null } }, "myName": { "asCell": [ { "kind": "cell", "scope": "user" } ], "default": "", "type": "string" }, "myPlayerNumber": { "anyOf": [ { "enum": [ 1, 2 ], "type": "number" }, { "type": "null" } ], "asCell": [ { "kind": "cell", "scope": "user" } ], "default": null }, "player1": { "anyOf": [ { "$ref": "#/$defs/PlayerData" }, { "type": "null" } ], "asCell": [ { "kind": "cell", "scope": "space" } ], "default": null }, "player2": { "anyOf": [ { "$ref": "#/$defs/PlayerData" }, { "type": "null" } ], "asCell": [ { "kind": "cell", "scope": "space" } ], "default": null }, "shots": { "$ref": "#/$defs/ShotsState", "asCell": [ { "kind": "cell", "scope": "space" } ] } }, "tags": [ "profile" ], "type": "object" }, "pattern": "battleship/multiplayer/lobby.tsx", "resultSchema": { "$defs": { "Coordinate": { "properties": { "col": { "type": "number" }, "row": { "type": "number" } }, "required": [ "row", "col" ], "type": "object" }, "GameState": { "properties": { "currentTurn": { "enum": [ 1, 2 ] }, "lastMessage": { "type": "string" }, "phase": { "enum": [ "waiting", "playing", "finished" ] }, "winner": { "enum": [ 1, 2, null ] } }, "required": [ "phase", "currentTurn", "winner", "lastMessage" ], "type": "object" }, "PlayerData": { "properties": { "avatar": { "description": "Avatar URL or glyph, snapshotted from the joiner's shared profile.", "type": "string" }, "color": { "type": "string" }, "joinedAt": { "type": "number" }, "name": { "type": "string" }, "ships": { "items": { "$ref": "#/$defs/Ship" }, "type": "array" } }, "required": [ "name", "ships", "color", "joinedAt" ], "type": "object" }, "Ship": { "properties": { "orientation": { "enum": [ "horizontal", "vertical" ] }, "start": { "$ref": "#/$defs/Coordinate" }, "type": { "$ref": "#/$defs/ShipType" } }, "required": [ "type", "start", "orientation" ], "type": "object" }, "ShipType": { "enum": [ "carrier", "battleship", "cruiser", "submarine", "destroyer" ] }, "ShotsState": { "properties": { "1": { "items": { "items": { "$ref": "#/$defs/SquareState" }, "type": "array" }, "type": "array" }, "2": { "items": { "items": { "$ref": "#/$defs/SquareState" }, "type": "array" }, "type": "array" } }, "required": [ "1", "2" ], "type": "object" }, "SquareState": { "enum": [ "empty", "miss", "hit" ] } }, "properties": { "$UI": { "$ref": "https://commonfabric.org/schemas/vnode.json", "scope": "session" }, "gameName": { "type": "string" }, "gameState": { "$ref": "#/$defs/GameState" }, "joinPlayer1": { "asCell": [ "stream" ], "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "joinPlayer2": { "asCell": [ "stream" ], "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object" }, "joinWithName": { "asCell": [ "stream" ], "type": "string" }, "myName": { "type": "string" }, "myPlayerNumber": { "enum": [ 1, 2, null ] }, "player1": { "anyOf": [ { "$ref": "#/$defs/PlayerData" }, { "type": "null" } ] }, "player2": { "anyOf": [ { "$ref": "#/$defs/PlayerData" }, { "type": "null" } ] }, "reset": { "asCell": [ "stream", "opaque" ] }, "shots": { "$ref": "#/$defs/ShotsState" } }, "required": [ "gameName", "player1", "player2", "shots", "gameState", "myName", "myPlayerNumber", "joinWithName", "joinPlayer1", "joinPlayer2", "reset", "$UI" ], "type": "object" } }