Join the waitlist

Player API reference

Read public state, send intent and render the Engine's committed result.

The player API is the boundary between the browser and the Engine. The browser renders a challenge and sends intent. The Engine decides whether the play is accepted, changes player state and returns the committed result.

The current contract version is 2.0. Local development and the internal hosted Engine implement the same wire shape.

What the Gamestage client is built on

gamestage.js is wiring over the Monterosa JavaScript SDK, which is what connects a game to Interaction Cloud. It wraps five of its kits: connect, interact, consent, storage and analytics. Identity is not among them, deliberately, because a player's token comes from the game's own login and the Engine validates it against a configured issuer: a deployed Engine reads its issuer and JWKS from that deployment's own environment.

Keep two facts apart. The SDK is documented and released by Monterosa, and only that link tracks its latest version. What @monterosa/gamestage currently pins is 2.0.0-rc.9, exactly rather than as a range: SDK 2 has no stable release yet, and a caret across release candidates takes breaking changes silently.

If you need something the Gamestage client does not expose, the SDK is the thing to reach for, and packages/gamestage/src/monterosa.ts is the one file that touches it.

Start with the generated client

gamestage client

For most games, import gamestage.js:

import { start } from "./gamestage.js";

const game = await start();
render(game.round);

game.onRoundChanged((round) => render(round));

const result = await game.play({ picks: ["alpha"] });
renderResult(result.round_state, result.feedback, result.outcome);

start() reads window.GAMESTAGE_API and window.GAMESTAGE_GAME. dev prints them and deploy injects them before the page's first script.

The Gamestage client also resolves an optional identity source, gates analytics and storage on consent, follows platform announcements and re-reads the container from the Engine. An announcement never carries authoritative container state.

Render content safely

Producer and dataset text is text, never HTML. This includes round prompts, labels, player names, result tiers and sign-in copy, even when a Studio field allows rich text. Use textContent or build DOM elements and set their text; never interpolate content into innerHTML, outerHTML or insertAdjacentHTML.

For any href or src supplied by content, parse it with new URL(value) without a base URL and accept only url.protocol === "https:". Omit the attribute or disable the control when it fails. Do not accept javascript:, data:, HTTP or relative content URLs. Bundled assets with paths chosen by the page and locally generated share images are separate from content URLs.

Use the smaller client when needed

Import gamestage-player.js when the game needs only the player API:

import {
  createPlayerClient,
  newIdempotencyKey,
} from "./gamestage-player.js";

const client = createPlayerClient({
  baseUrl: window.GAMESTAGE_API,
  game: window.GAMESTAGE_GAME,
});

const round = await client.getCurrentRound();
const intent = newIdempotencyKey();
const result = await client.play(
  round.id,
  { picks: ["alpha"], roundVersion: round.version },
  intent,
);

Reuse the same idempotency key when retrying one lost request. Mint a new key only for a new fan action.

Routes

All player routes sit under /play/v1 so they do not share the creator-authenticated Backstage prefix.

MethodPathReturns
GET/play/v1/games/{game}/runtimeRuntime rules and capabilities
GET/play/v1/games/{game}/rounds/currentCurrent public container
GET/play/v1/games/{game}/rounds/{round}Named public container
GET/play/v1/games/{game}/roundsEvery container this game has
GET/play/v1/games/{game}/rounds/mineWhich of them this player has played
GET/play/v1/games/{game}/rounds/nextOne this player has not finished
POST/play/v1/games/{game}/sessionSigned anonymous player session
POST/play/v1/games/{game}/session/restoreRestore a player from a recovery code
GET/play/v1/games/{game}/players/me/recovery-codeWhether this player has a recovery code
POST/play/v1/games/{game}/players/me/recovery-codeIssue a recovery code, replacing any earlier one
POST/play/v1/games/{game}/rounds/{round}/playsCommitted play result
GET/play/v1/games/{game}/rounds/{round}/players/mePlayer state in one container
GET/play/v1/games/{game}/players/me/profileCross-container profile
GET/play/v1/games/{game}/identityThe names and avatars a player may choose
POST/play/v1/games/{game}/players/me/identityChoose a name, an avatar or both; returns the profile
POST/play/v1/games/{game}/name-ticketThe chosen name, signed for an arcade board
GET/play/v1/games/{game}/leaderboardThe current round's board: ranked entries and the player's own rank. See Leaderboard
GET/play/v1/games/{game}/leaderboard/editionThe same board for the current edition: each player's total across its rounds

Runtime

RuntimeInfo says how this game behaves without exposing Engine internals:

  • archetype: the rule set.
  • marking: at_commit or at_settlement.
  • challenge_source: shared, per player or feed-driven.
  • schedule: fixed, local midnight, feed-driven or continuous.
  • updates: poll or socket, with a freshness target.
  • identity: whether identity is required and whether anonymous play can later be claimed.
  • archive and capabilities: past-container access and named optional features.

Every runtime response also carries server_time and the deployed snapshot.

Container reads

The wire type is Round. Creator-facing surfaces use the game's container label instead of hardcoding that word.

The read contains:

  • id, number and version: identity and optimistic concurrency.
  • can: derived booleans for accepting plays, results available, solution revealed and closed.
  • challenge: public content only.
  • challenge_instance_id: present for a per-player challenge and echoed on the play.
  • solution: present only after the Engine says it may be revealed.

Do not branch on an imagined lifecycle such as settling. The four can values are the public capability.

Show when a round opens and closes

const game = await gamestage.start();
const { opens_at, locks_at } = game.round ?? {};
if (opens_at && locks_at) {
  showDates(new Date(opens_at), new Date(locks_at)); // "This week: 16 to 23 November"
}

Each time is one the Engine applies, so what you show is true. Before opens_at the Engine serves no such round. From locks_at on it refuses every play, and the round reads with can.accepting_plays false. The same two fields are on each summary in the rounds list, so a season screen can label every week without reading each round.

FieldTypePresent whenWhat the Engine does with it
opens_atISO 8601 string, UTCA hunt or group round in a calendar game whose Studio edition has a startServes no such round before this time
locks_atISO 8601 string, UTCA calendar game's hunt, group or push round whose edition has an end; a bingo round; a predict round with a close timeRefuses every play from this time on

Either field may be absent, and absent means no time is known. That covers a rotation game, whose rounds outlive any one edition, an edition a producer left open-ended, and a predict question a producer closes by hand. Draw nothing in that case rather than a guessed date. A quiz on the Quiz Engine carries its own close as closesAt on the quiz state.

Both times follow the Studio edition, so a producer who moves an edition's end moves locks_at the next time the round is read.

The pool, and offering another one

A game may hold more than one container. rounds returns them all as summaries carrying no challenge and no solution, each marked current if it is the one rounds/current answers with. rounds/mine returns what this player has touched, with finished on each: a player who opened a board and left is owed it back, and one who completed it is owed a different one.

rounds/next is the answer to "play another". It returns the whole container when there is one, and it is worth reading its shape before you use it:

{ "status": "ready", "round": { "id": "...", "number": 2, "challenge": {} } }
{ "status": "exhausted" }

status is the point. A response that simply omitted round when there was nothing left would look identical to one that failed to include it, and every client would have to decide for itself whether to draw an empty state or an error. This says which, and the Engine answers 200 either way.

So draw the control only on ready. A button offering another round that then cannot produce one is worse than no button.

Selection prefers a container the player has never opened over one they left half done, and never returns one they finished or one that has stopped accepting plays. Ordering and selection are the Engine's, not a store's, because a query returns rows in whatever order its index gives.

const next = await player.getNextRound();
if (next.status === "ready") show(next.round);
else offerNothing();

Plays

A raw request has this shape:

{
  "idempotency_key": "4f86a7b89a23912d4ce82610",
  "round_version": 3,
  "challenge_instance_id": null,
  "payload": {
    "picks": ["alpha"]
  }
}

The result includes:

  • outcome: accepted, rejected, duplicate, stale or busy.
  • marked: false when the play is committed now and marked at settlement.
  • feedback: typed items with correct, close, wrong, higher, lower or unknown verdicts.
  • round_state: the reducer output after the play, including score, attempts, mistakes, progress and finish state.
  • retry_after_seconds: wait time when the outcome is busy.

A busy result is an expected capacity response rather than a server fault. It can arrive as HTTP 200 so clients do not create a retry storm.

Send a guess on a Solve round

A Solve (hunt) round with round.challenge.guesses_allowed is a guess round: the fan types a word or a number instead of picking from a board. Send each move with its own helper:

const result = await game.guess("crane");   // or game.guess(1966)
if (result.outcome === "rejected") showReason(result.reason);
else drawRow(result.guessed);

const skipped = await game.skip();           // spends a guess for the next clue
showClue(skipped.guessed?.clue);

On the wire, each is the whole payload: { "op": "guess", "value": "crane" } or { "op": "skip" }. A guess round refuses a pick with pick_not_allowed, and a pick round refuses guess and skip with guess_not_enabled.

result.guessed is the move the Engine marked:

FieldTypeWhen it is thereWhat it means
guessstring, number or nullalwaysThe guess as compared, in capitals for a word. null for a skip
correctbooleanalwaysTrue on the guess that matched the answer
markslist of { letter, mark }a word round with letter feedbackEach letter and its colour: correct, present or absent, with repeated letters marked as Wordle marks them
directionhigher, lower or correcta number round with higher or lower feedbackWhere the answer is from this guess
cluestringa wrong guess or a skip, while clues remainThe next clue, earned by this move

Every move so far is in round_state.progress.guesses, so a page redraws the board after a reload from the state alone. Once the round is finished, round_state.progress also holds answer, share (a grid of marks that never contains the answer) and share_score, such as 3/6, or X/6 for a loss.

When a guess is refused, the outcome is rejected, the guess spends nothing, and reason says why:

reasonCauseWhat the page does
guess_wrong_lengthThe word has more or fewer letters than the answerAsk for a word of the right length
guess_not_a_wordThe guess has characters other than lettersAsk for letters only
guess_not_in_word_listThe round accepts only real words, and this one is not in the listAsk for another word
guess_not_a_numberA number round received something other than a plain number, such as 1,966Ask for a number
guess_repeatedThe fan already tried this guessSay it has been tried
guess_missingA word round received no textSend the text the fan typed

The answer and any clue not yet earned never reach the browser. Studio withholds round_guess_answer and round_guess_clues from the feeds a page reads, and the Engine sends a clue only to the fan who earned it.

Player state and profile

Container state holds attempts, mistakes, progress, score, score revision, finish state and an optional spoiler-safe share card.

The profile crosses containers: played, won, current and maximum streaks, distribution and any cross-container constraints.

Score belongs to the game. Platform points and settlement belong to the ledger and are separate concerns.

A fan's streak across every game in the tier is neither of those counts: the Loyalty Layer works it out server-side and serves it at GET /api/loyalty/v1/me/streak, and the client reads it with game.streak(). Pass the space root the Loyalty Layer answers on -- the same baseUrl the Hub's loyalty read takes -- and the read uses the same token every Engine call uses:

const game = await start({ loyalty: { baseUrl: spaceRoot } });

const streak = await game.streak();
// { current: 4, best: 12, lastDay: "2026-11-02", proved: true, nextMilestone: 7 }

game.streak() never throws and never retries. It answers the figures above, or null when the fan is not signed in, the game configured no loyalty, the space runs a Loyalty Layer too old to serve the route, or the call failed. A page shows the number only when proved is true and current is at least 1: until the Loyalty Layer stands behind the run, the number can be revised, and no qualifier a page can add makes a revised number honest.

Comments

Comments come with the Publisher and Enterprise plans. On Starter, game.comments is null and a game shows none, whatever its manifest asks for. Your plan's page in Stage (Usage, then Services) says whether your workspace has them; ask Monterosa about moving up.

Turn them on in gamestage.yaml. Every game has one topic:

services:
  comments:
    topic: game

Show them with the comment tray

The quickest way to a comments screen fans know how to use is Gamestage UI's comment tray: a bar at the foot of the screen that opens into a sheet, newest first, with hearts, replies, a long-press menu and a "new comments" chip.

npx gamestage-ui add comment-tray
<CommentTray
  comments={trayComments}
  canPost={canPost}
  onPost={(text, { replyTo }) => send(text, replyTo)}
  onHeart={(id) => heart(id)}
  onShowReplies={(id) => loadReplies(id)}
  onReport={(id) => game.comments?.report(id)}
  onDelete={(id) => game.comments?.remove(id)}
  onSignIn={() => game.signIn.request()}
/>

The tray stores and calls nothing: your page reads game.comments, hands the tray its comments, and updates them when a fan posts or hearts. Add a fan's comment the moment onPost fires, with status: "sending", then set it to published, or failed if post answers null. Its props and words are in the comment tray's page. Avatars are off unless you pass avatars.

Or draw your own

Show a game's comments to everyone and let a signed-in fan post one:

const comments = game.comments; // null when comments are off for this game

if (comments) {
  for (const c of await comments.list()) addComment(c.user_name, c.text);

  if (await comments.canPost()) {
    showBox((text) => comments.post(text));
  } else if (game.signIn.requiredFor("comment")) {
    showButton(studioLabel, () => game.signIn.request());
  }
}

Anyone can read comments, and reading needs no sign-in. Posting, hearting, reporting and deleting need a signed-in fan in every game. The Engine enforces this: it issues the token those need only to a signed-in fan, so a guest who tries anyway is refused. canPost() answers that question for the fan in front of you. When it is false, show a sign-in prompt in the producer's words instead of a box. game.signIn.request() asks the fan to sign in.

CallAnswersWhen it fails
game.commentsThe game's comments, or nullnull when comments are off for the game, its plan, or its organisation
list()Published comments, oldest first, each with reaction_counts and thread_reply_count[]
canPost()true for a signed-in fanfalse
post(text, { parentId?, avatarUrl? }){ message_id }; with parentId, a reply to that commentnull when refused, a guest included
react(id){ count, reacted }: a heart, added or taken back. Sent as "❤️", the glyph Talkbox counts every fan's heart undernull
myReactions()A map of comment id to the reactions this fan holdsan empty map, a guest included
replies(id)A comment's replies, oldest first[]
report(id, reason?)true once the report is on record, a repeat included. reason defaults to "other"false
remove(id)true when the fan's own comment is deletedfalse, someone else's comment included
me()The fan's name and state in the topicnull for a guest
setName(name){ display_name }null when refused
game.signIn.requiredFor(action)true for "comment"Never throws
game.signIn.request()The sign-in state reached"off" where the game has no sign-in

Hearts, replies, report and remove need Gamestage client 0.117.0 or later (npx gamestage client).

Render a comment's text with textContent, never as HTML.

Leaderboard

Show a board and tell a fan where they came:

const board = await client.getLeaderboard();

for (const row of board.entries) {
  addRow(row.rank, row.display_name, row.score, row.player_id === board.me?.player_id);
}

if (board.me && !board.truncated) {
  showPlace(`You are ${board.me.rank} of ${board.total}`);
}

getLeaderboard() is the current round's board. getEditionLeaderboard() is the same shape for the current edition, with each player's total across its rounds. A response looks like this:

{
  "server_time": "2026-11-14T19:07:00.000Z",
  "snapshot": "9c1f0e7a",
  "round_id": "a2f48a02-b232-46d2-b9db-186ce2c38f77",
  "order": "high_first",
  "tie_break": "earliest_play",
  "total": 900,
  "truncated": false,
  "entries": [
    { "rank": 1, "player_id": "b_4f2a91c07d", "display_name": "Swift Otter", "avatar_url": "https://…/otter.png", "score": 120 },
    { "rank": 2, "player_id": "b_91d0c3aa52", "display_name": "Calm Heron", "avatar_url": "https://…/heron.png", "score": 110 }
  ],
  "me": { "rank": 40, "player_id": "anon:ie4JPJ", "display_name": "Bold Lynx", "avatar_url": "https://…/lynx.png", "score": 65 }
}

The board

FieldTypeRequiredWhat it holds
server_timestringyesWhen the Engine answered.
snapshotstringyesWhich version of the game's settings the answer was served under.
round_idstringon a round boardThe round the board ranks.
scoperound or editionnoedition on an edition board. Absent means a round.
edition_idstringon an edition boardThe edition the board totals.
orderhigh_first or low_firstyes, default high_firstWhich way the game is scored. low_first is a game where the lowest number wins, such as fewest guesses. entries already arrive in this order, so draw them as given and never re-sort.
tie_breakearliest_play, fewest_attempts or noneyes, default noneHow equal scores are separated.
tie_break_questionstringnoThe question whose result separates players on equal points, on a round that has one.
entrieslist of rowsyes, may be emptyThe top of the board, at most 100 rows. There is no way to ask for more or for a later page.
totalnumberyes, default 0How many players are ranked, which is usually more than entries holds.
truncatedbooleanyes, default falseTrue when the Engine could not read every score, so players are missing and ranks may be too high. Do not show a rank when it is true.
meone rownoThe calling player's own row. See Your own rank.

A row

FieldTypeRequiredWhat it holds
ranknumber, 1 or moreyesThe player's place. Players who tie share a rank and the next rank is skipped: 1, 1, 3.
player_idstringyesUse it only as a row key and to find the caller's own row. For every player but the caller it is a stand-in made for this board, the same on every reload, and never their account id.
display_namestringnoThe name to show. The player's chosen name when they have one, otherwise a generated one. Text, never HTML.
avatarstringnoThe id of the avatar the player chose. Absent when they chose none.
avatar_urlstringnoA picture to draw: the chosen avatar, or a default face for a player who chose none.
exactbooleannoTrue when the play landed exactly on the target, in a game scored by how close you get. Show it as a badge.
scorenumberyesThe player's score for the round, or their total on an edition board.

Your own rank

me is the row of the player whose session the request carries (the x-gamestage-player header, which the generated client sends for you), with their rank among everybody ranked. It is there whether or not they are in the entries you were sent, so a fan who came 40th of 900 gets rank: 40 beside a top 100 they are in, and a fan who came 400th gets rank: 400 beside a top 100 they are not in.

The callerme
Has a score on this boardTheir row, with their rank.
Has not played this round, or has no score yetAbsent. Show the board with no place.
Sent no session: a direct call to the route with no x-gamestage-player headerAbsent. The generated client always sends the player's session, so this is only a caller that built the request itself.
Is a test player, a play sent with x-gamestage-test: 1Absent, and they are not in entries or total either. Test plays are scored and never ranked.

Compare player_id with board.me.player_id to mark the caller's row in entries. Do not compare names: two players can show the same one.

Ties

Two players tie only when their score, their tie-breaker distance where the round has one, and the moment they played are all equal. Otherwise the earlier play ranks higher, whichever way the game is scored. So most equal scores are ranked apart, and tie_break says by what.

How fresh it is

Everybody else's rows can be up to five seconds old. The caller's own row is read fresh on every request, so a fan who has just played sees their new score and place at once, even when the rows around them have not caught up.

When it fails

What you getWhat happenedWhat to do
entries: [], total: 0, no meNobody has a score on this board yet, or the game has no current round.Show an empty board that says nobody has played yet.
truncated: trueThe board is missing players.Show the rows, hide every rank, and try again shortly.
An error with retryable: trueThe Engine could not read the board, or could not read the caller's own score. It answers an error rather than a board with a wrong place on it.Wait and ask again.

Identity

Without a real identity token, the client asks the Engine for a signed anonymous session and stores it for later visits. The page never invents a player id.

For an identified player:

  1. The App Manifest declares identity.provider: jwt, a JWKS URI, and an issuer when its tokens carry one.
  2. The game supplies a current token source to start({ identity }) or createPlayerClient({ identity }).
  3. The client sends it as Authorization: Bearer <token>.
  4. The Engine validates it against the game's key set, and its issuer when it names one.

gamestage dev plays as an anonymous test player, so prove identified play on the deployed game.

The anonymous session travels separately in x-gamestage-player. Do not put a JWT in that header. Gamestage does not provide a fan login system at any plan.

Step 4 is implemented by the shared JWT validator and exercised by the local --as harness. A deployed Engine reads the game's own identity.jwt, carried with its round from the manifest, and falls back to the deployment's own environment only for a game that names none; a deployment with neither still refuses every token rather than trusting one.

Let a player choose a name

Every player has a name from the start, worked out from their id, such as Quiet Lynx. Offer a picker so they can choose their own: two words, one from each of the Engine's lists. A player cannot type a name, so nothing rude can reach a leaderboard beside a sponsor.

const options = await game.client.getIdentityOptions();
// Show options.adjectives and options.animals as two lists, and options.avatars as pictures.
const profile = await game.client.setIdentity({
  name: { adjective: "Swift", animal: "Otter" },
  avatar: "peep-afro-smile",
});
// profile.display_name is "Swift Otter"; profile.name_chosen is true.
CallReturnsWhat it does
game.client.getIdentityOptions(){ adjectives, animals, avatars }The words and pictures on offer. The same for every player, so cache it
game.client.setIdentity(choice)the profileStores the choice. Send name, avatar or both
game.client.getProfile()the profiledisplay_name is always filled; name_chosen says whether the player picked it
game.client.getNameTicket(){ ticket, expires_at }The chosen name, signed for this game. Arcade only; see below

When a choice is refused, setIdentity throws a PlayerApiError with the code not_offered: a word or avatar that is not on the lists. Offer the lists again.

Put a chosen name on an arcade board

An arcade board belongs to the Arcade Engine, and it shows each fan as Player 3F9A1C until it is handed a name. It takes a name only as a name ticket: the player's chosen name, signed by this Engine. The board checks that signature before accepting the name. On an arcade game you do not handle tickets yourself. After setIdentity with a name, the client asks for a ticket and sends it to the board before it returns, and at start it sends one for a returning fan who already has a name.

POST /play/v1/games/{game}/name-ticket takes no body and answers for the caller, whoever their session or token says they are:

{ "ticket": "eyJhbGciOiJFUzI1NiIs...", "expires_at": "2026-10-20T12:10:00.000Z" }
FieldTypeMeaning
ticketstringAn ES256 JWT. Pass it, unread, to the Arcade Engine's PUT /games/{game}/me/name as { "ticket": "..." }
expires_atISO timeTen minutes after issue. Ask for a new ticket rather than keeping one

The ticket's claims, for anyone checking one:

ClaimValue
issgamestage-name
audgame:<game id>
subThe player as the Arcade Engine knows them: anon:<id> for a guest, id:<sub> for a signed-in fan
nameThe name the player chose
iat, expIssued at, and ten minutes later

It is signed with the same key as a game token, so it checks against /play/v1/game-token-keys. It is never accepted as a game token.

When there is no ticket to give, the route answers:

StatuscodeWhat it means
404no_chosen_nameThe player has not chosen a name. Nothing to send; the board keeps its own label
401session_requiredNo valid session or token. Start a session first
404not_foundNo such game, or an arcade game that signs its players in itself
503unavailableThis deployment cannot sign tickets. Try again later

A ticket the board refuses, or a board that does not answer, never stops play: the client logs it and carries on, and tries again on the fan's next visit.

Get a player's progress back on another device

An anonymous player's progress lives with the session on one browser. Clear the browser or change phone and it is gone, unless the player saved a recovery code. Give every game with anonymous players both halves of this:

import { mountRecovery, start } from "./gamestage.js";

const game = await start({ /* ... */ });
// A "Your progress" button in the footer, opening a dialog with both halves.
mountRecovery(game, document.getElementById("progress"), {
  onRestored: () => location.reload(),
});

mountRecovery draws the dialog in any page. A Gamestage UI game adds the recovery-code component instead (npx gamestage-ui add recovery-code), which draws the same two screens from the calls below:

CallReturnsWhat it does
game.client.getRecoveryStatus(){ has_code, issued_at }Whether this player has a code
game.client.issueRecoveryCode(){ code, issued_at, replaced }Issues a code, shown once. Issuing again replaces the old one, which stops working
game.client.restoreFromRecoveryCode(code){ player_id, previous_player: "kept" }Switches this device to the player the code belongs to

A code is four words and two digits, such as RIVER-CABLE-ORBIT-MAPLE-42. The Engine accepts it in any case, with spaces or hyphens. It stores only a keyed fingerprint of the code, never the code itself, and limits how often a device can try one.

When a code is refused, restoreFromRecoveryCode throws a PlayerApiError with the code code_not_recognised. A mistyped code and an unknown one get the same answer, so a refusal says nothing about which codes exist. Tell the player to check it against the one they saved.

Three limits to design around:

  • Anonymous players only. A player signed in through your own login already has their progress on their account.
  • Restoring does not merge. The progress this device had before stays with the player it belonged to; the device now plays as the restored player.
  • A code is effectively a password. Anyone who has it can play as the player. Say so where it is shown, and never store it in your own analytics.

The words on both screens are Studio settings (recovery_*), filled in on the first deploy from gamestage.settings.json.

Errors

Non-play failures use an error envelope with a stable code, a human-readable message and a retryable boolean. Branch on the code and retryable flag, not on prose.

The generated client throws PlayerApiError with HTTP status, code and retryability preserved.

Deployment packaging

deploy --file index.html uploads both generated clients beside the page. deploy --dir . uploads the directory as it exists. Run gamestage client before a directory deploy and verify that imports resolve.