npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iwsdk/scene-composition

v0.5.3

Published

IWSDK native scene document schema, validation, patching, and authoring helpers

Readme

@iwsdk/scene-composition

IWSDK-native scene document primitives for declarative scene authoring.

This package owns the browser-independent scene JSON contract used by the native scene editor and agentic scene composition tools. It intentionally does not import three, Vite, Playwright, or IWSDK runtime packages.

Exports include:

  • SCENE_DOCUMENT_JSON_SCHEMA and SCENE_DOCUMENT_SCHEMA_ID
  • scene document TypeScript types
  • parser, serializer, and runtime validator
  • deterministic, resolver-driven scene module composition for Node and browsers
  • reversible scene patch operations and command history
  • deterministic lookAt, snap-to-grid, and bounds-aware alignment helpers
  • deterministic, browser-independent RGBA generation and hashes for versioned periodic procedural PBR maps

The package accepts one closed scene format: iwsdk.scene.v1. The exported schema, TypeScript types, parser, serializer, and validator all describe that same contract; there are no legacy readers or migration APIs.

Scene modules

Any v1 document may declare ordered imports:

{
  "imports": [
    {
      "id": "furniture",
      "src": "./modules/furniture.scene.json",
      "transform": { "position": [0, 0, -2] }
    }
  ]
}

Import IDs start with an ASCII letter and contain only letters, digits, _, or -. composeSceneDocument(root, { source, resolve }) recursively asks the provided resolver for { source, document }, where source is the canonical URL or path of the returned module. The resolver receives the declared src, the canonical importer when known, and the full namespace. It may return parsed JSON or JSON text and may use fetch, filesystem APIs, an in-memory map, or another application-specific transport.

Composition preserves declaration order. Imported node, resource, prefab, and component-schema IDs and their references use slash namespaces such as furniture/chair; nested imports use room/furniture/chair. Each import creates a group wrapper named for its namespace segment, and its optional transform is applied to that wrapper. Module asset URIs are rebased against the resolver's canonical module source. Only the root document contributes environment, authoring, and document metadata.

The result contains { document, dependencies }. The composed document has no remaining imports and is validated before return. Dependencies are a stable, declaration-order preorder traversal with each import's id, full namespace, declared src, resolved canonical source, and canonical importer when known. Canonical resolved sources are also the cycle-detection identity.

The material contract supports standard, physical, and basic models. Nodes may mark rendered infrastructure with framingRole: "support"; the default content role keeps ordinary nodes in content-only camera framing bounds. Standard and physical materials may declare independently seeded procedural albedo, emissive, roughness, metalness, ambient-occlusion, alpha, normal, or bump maps using the bounded periodic-fbm-v1 algorithm. Capability snapshots advertise the supported channels, algorithms, per-dimension limit, total texel budget, and total sample budget; validation enforces those limits before runtime lowering.

Scene review rounds are zero-based: round 0 is the initial review and the configured maxCorrectionRounds is the inclusive correction ceiling. Configured round-limit stop reason is valid only at that ceiling. Configured review lenses and recorded evidence use the canonical layout, geometry, final order; a later configured lens cannot pass until every earlier one passes. The assisted finalizer computes deterministic acceptance statuses and revision identity from the active document. Failed nonterminal reviews use continue-refining; that reason is invalid on a passing review, so it cannot weaken the final publish gate.

The closed schema caps configured and recorded correction rounds at 10. Persistence requires every round above zero to link by exact path and SHA-256 to the adjacent immutable predecessor. Review waivers are portable data, but the editor server rejects them until a trusted user-approval artifact exists; an authorizedBy: "user" literal alone is not an authorization boundary.

Composition provenance is complete over declared inputs: it includes SHA-256 of the exact UTF-8 prompt and each reference's declared digest. Prompt identity is recomputed. External reference bytes are not claimed as verified without a trusted byte provider.