Skip to main content

Crate thread_manifest

Crate thread_manifest 

Source
Expand description

§World Manifest — the document format of the Thread

The Thread is the open, spatial, present, time-aware successor to the web: worlds are pearls strung along one Thread, linked by portals (veils you step through). This crate defines the World Manifest — the “HTML” of the Thread: an open, renderer-agnostic description of a place that any browser (Infinite is the first) can resolve and render.

Design principles (mirroring why the web won):

  • Narrow waist. Every browser implements this format or nothing interops.
  • Renderer-agnostic. Geometry is glTF + prefab refs + a standard material model — never a specific engine’s internals.
  • Static-first, presence-optional. A world is just files (host it anywhere). Presence (shared, multi-user) is an upgrade you opt into by naming a relay; without one, the world gracefully degrades to solo.
  • Meaning is native. Anything can link to a canonical [Codex] entry.
  • Time is an axis. A world declares a year; the same place is addressable across time.

See world-manifest-v0.1 for the normative specification — that document is the standard, and this crate is one implementation of it.

Modules§

arch
arch — the shared architecture math of the Thread
lint
World lint — the quality eye that runs before any screenshot
markup
Thread markup — the HTML/CSS authoring surface for worlds.
model
Model — the agent-native 3D format of the Thread
plan
Plan — a level design, before it knows what it is made of
shape
Shape — procedural geometry as manifest data
texture
Texture — procedural PBR materials as manifest data

Structs§

Animate
Declarative idle motion for a placement. Kinds (v0.1): "spin" (rotate about the object’s own Y axis), "bob" (rise and fall around the base position), and "path" (travel a looping polyline of points, offsets from the placement’s position — a patrol, a tour, a journey retraced). speed scales time (metres/second for path); amp is metres of travel for bob. Browsers phase-shift instances so fields of movers don’t march in lockstep.
Asset
External content referenced by id.
Behavior
A sandboxed WASM behavior module the world runs.
Bounds
Axis-aligned world bounds (advisory).
Environment
Environmental setup: time, sky, bounds, and the game mechanics this place enforces.
Identity
A portable, provider-agnostic identity (the open form of the Passport).
Interaction
A declarative, codeless interaction a creator attaches to a placed object.
LightEmitter
A point light emitted from a placement’s position. Declarative, like everything else in a manifest: worlds say what glows; the browser’s deferred lighting pass decides how the glow falls on surfaces.
Locator
A parsed Locator. Round-trips through Locator::parse / [Locator::to_string].
MaterialRef
Standard PBR material (renderer-agnostic). Texture fields are Asset ids.
MeshRef
How a prefab’s geometry is sourced. Exactly one field should be set.
Placement
One placed instance of a prefab.
Portal
A veil to another world — the hyperlink of the Thread.
Prefab
A unique renderable prefab (mesh + optional material), keyed by StructuredId.
Presence
Presence policy — the (optional) upgrade from a solo world to a shared one.
Sky
A simple gradient sky (zenith→horizon) with an optional sun direction.
Spawn
An arrival point.
StructuredId
The prefab/item id scheme, re-exported so consumers of the manifest don’t need a direct thread-id dependency. A structured decimal ID encoding category, subcategory, and item number.
StyleRule
A CSS-like style rule: a selector + the properties it attaches to matching placements. Lets a world define behaviour by type / .class / #id once, instead of inline on every placement — restyle everything from one rule.
TextLink
One hyperlink in a TextPanel: text is the phrase inside the panel’s content it anchors to (first occurrence); to is any Locator.
TextPanel
Readable text a browser typesets onto a placement’s surface (a quad prefab is the natural carrier). The browser owns fonts and layout — the world ships only the words, exactly like the old web shipping text and letting the browser render it.
WorldManifest
A World Manifest — one place on the Thread.
WorldMeta
Identity + descriptive metadata for the world.
WorldRules
Opt-in game mechanics a world enforces. Default all off — the browser ships these as capabilities; a place turns on only what it needs (like a page opting into pointer lock). Interact/inspect are always available and are NOT gated here — only the game-y mechanics are.

Enums§

AssetKind
What an Asset is.
InteractionEffect
One outcome of a completed Interaction. Deliberately small + declarative; serialized snake_case (unit variants as bare strings) so manifests read clean.
ManifestError
An error parsing or validating a manifest.
PreviewPolicy
Portal preview fidelity.

Constants§

SCHEME
The URL scheme of the Thread.
THREAD_VERSION
The format version tag carried in every manifest’s thread field.

Functions§

effective_mode_of
Presence::effective_mode for callers holding raw JSON.
well_known_url
The canonical .well-known manifest URL for a host + world path — https://<host>/.well-known/thread[/<path>]/world.json. This is the decentralized, zero-registry convention: serve a world here and any browser can reach it at thread://<host>[/<path>]. Single source of truth shared by the browser resolver and the thread CLI.

Type Aliases§

Extra
Fields this build doesn’t know about, carried through untouched.