Worker-safe leaf. Owns the shape ofDocumentation Index
Fetch the complete documentation index at: https://openturn.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
manifest.json emitted by @openturn/deploy and read back by the cloud shell. Both sides depend on this package so the schema stays a single source of truth.
Install
Types
OpenturnDeploymentManifest
The on-disk manifest for a deployed game:
deploymentID / projectID are optional because the build-time manifest may not know them yet; the cloud control plane fills them in when the manifest is promoted to a deployment record.
OpenturnInspectorPolicy
allowedRoles further restricts access within the chosen mode.
OpenturnMultiplayerManifest
targetCapacity players in [minPlayers, maxPlayers]; the running game sees match.players filtered to the seated subset.
OpenturnAvailableBot
game.bots (see @openturn/lobby). The cloud Durable Object reads this list to build LobbyEnv.knownBots, which the lobby UI uses to render the per-seat bot picker.
OpenturnShellControlsConfig
undefined means “default-on when the host adapter supports it”; set false to hide a control even if the adapter implements it. Used by the bridge’s isShellControlEnabled.
Shell control IDs
SHELL_CONTROLS in @openturn/bridge), and the runtime gating helper all derive from the same source. To add a new control: add the id here, then map it to its adapter method / label / placement in @openturn/bridge’s SHELL_CONTROLS. The satisfies constraint in bridge fails to compile until the registry is updated.
Scalar type aliases
The string-literal unions used inside the manifest types — exported separately so consumers can narrow on them or build their own UIs around the same vocabulary.Validation
parseDeploymentManifest(value)
Zod-parses unknown JSON into an OpenturnDeploymentManifest, or throws. Multiplayer deployments must include a multiplayer block; local deployments must omit it.
OpenturnDeploymentManifestSchema / OpenturnMultiplayerManifestSchema / OpenturnShellControlsConfigSchema / OpenturnAvailableBotSchema / OpenturnInspectorPolicySchema
The underlying Zod schemas if you need .safeParse or composition — for example, wrapping the manifest inside your own control-plane response envelope:
Lifecycle
The manifest schema is the single source of truth shared across three boundaries:- Build time.
@openturn/deployemitsmanifest.jsonbeside the built assets.deploymentIDandprojectIDare typically absent at this stage; the cloud control plane fills them in when it promotes the build to a deployment record. - Serve time. The cloud shell reads the manifest and passes it to
createDeploymentHTMLto generate the iframe’sindex.html. Themultiplayerblock (if present) tells the shell to issue a room token instead of rendering a local session. - Dispatch time. The
serverBundleDigestis how the cloud pins the game-worker bundle in Cloudflare. TheschemaVersionis what gates profile migrations and determines whether an older stored snapshot can be replayed on the current deployment.
HTML generation
createDeploymentHTML({ manifest, assetBaseURL? })
Produces the static index.html that bootstraps the game bundle. Pass assetBaseURL when serving the HTML and assets from different origins (e.g. cloud serves from a CDN prefix); omit it when index.html lives beside its assets.
normalizeAssetPath(asset)
Strip a leading ./ or / from an asset path. Used internally when resolving manifest entries against an assetBaseURL; exported for tooling that needs to match the same normalization rule the HTML generator uses.
See also
- Reference: deploy for the build tool that writes manifests.
- Reference: bridge for the wire contract used once the deployed iframe is live.