# Quest Student Deploy Publishing Guide

Use this guide when deploying a student browser game to Quest Student Deploy.

Quest hosting is static only: HTML, CSS, JavaScript, and assets.

## What To Deploy

Deploy only the browser output:
- `index.html`
- CSS files
- JavaScript files
- image, audio, font, and other browser assets

Do not deploy:
- `node_modules`
- cache folders
- Express servers
- Socket.IO servers
- Colyseus servers
- custom WebSocket servers
- backend-only source files

If the project uses Vite or another build tool, build first and deploy the browser output folder, usually `dist`.

## Required Auth

Quest deploy commands may include a token or other project-specific value.

If the command, token, or target project is missing:
- Ask the student for the exact Quest deploy command from Quest.
- Do not invent placeholder tokens, project ids, versions, or URLs.
- Do not guess the student slug or project slug.

## Deploy Command Rules

Run the Quest-provided deploy command exactly once.

Treat the deploy as successful if the runner prints:

```txt
QUEST_DEPLOY_RESULT {"status":"success",...}
```

Use that structured line as the source of truth over earlier warnings or noisy build output.

If that marker is missing, treat the deploy as successful only if the runner prints all of:
- `Success`
- `Version`
- `Game URL`

Warnings like this are not deploy failures:

```txt
Some chunks are larger than 500 kB after minification
```

Only report `Failed` when:
- The command exits non-zero.
- The runner prints `QUEST_DEPLOY_RESULT {"status":"failed",...}`.
- The runner prints `Student deploy failed:`.

Never invent values like `unknown` or `unavailable`. Copy the exact version and URL printed by the runner.

## Multiplayer During Deploy

If the project needs multiplayer, use the Quest Multiplayer SDK:
- `https://app.joinquest.com/student-deploy/quest-multiplayer.mjs`
- `https://app.joinquest.com/student-deploy/quest-multiplayer.js`

Do not upload custom multiplayer backend code.

## Final Reply Format

Reply with only:

```txt
- Success/Failed
- Version
- Game URL
```

Rate limit response:

```txt
- Failed
- You've hit the limit of 5 game updates/versions in the last 24 hours
```

Upload size response:

```txt
- Failed
- Your Quest upload is over the total upload limit or per-file upload limit; build first and deploy only the browser output folder, then reduce large assets if needed
```

Other failure response:

```txt
- Exact error message
- The command you ran
- Shell used, either macOS/Linux or Windows PowerShell
```
