@scene-grid/shared
v0.2.2
Published
Shared domain types, telemetry transport, and strict TypeScript utilities for the SceneGrid platform.
Maintainers
Readme
@scene-grid/shared
Foundation types, telemetry transport, and mathematical utilities for SceneGrid
@scene-grid/shared is the absolute foundation of the SceneGrid ecosystem. It enforces strict vocabulary, domain types, and mathematical consistency across the entire platform, guaranteeing that the engine, CLI, Inspector UI, and external AI agents speak the exact same language.
Installation
npm install @scene-grid/sharedArchitecture & Data Flow
Because this is a library of shared utilities, it has no standalone execution flow. Instead, it provides the critical inputs and outputs used by all other packages:
- Strict Branded Types: Exposes utility types (e.g.,
SoundId,BusId,EventId) that prevent primitive string interchangeability. This ensures aSoundIdcannot accidentally be passed into a function expecting aBusId, preventing category errors at compile time. - Telemetry Bridges: Defines the exact TypeScript interfaces and constants required for the engine to broadcast JSON payloads to the Inspector or MCP server without duplicating data structures.
- Mathematical Evaluators: Provides deterministic curve evaluations (Linear, Logarithmic, S-Curve, Exponential). By keeping these functions in the shared package, both the
engine(when processing DSP) and theinspector(when rendering UI visualizations) generate the exact same mathematical trajectory for a given parameter change, ensuring visual parity with audible results.
Constraints & Limitations
- Zero Dependencies: To guarantee absolute portability across vastly different environments, this package heavily restricts external dependencies.
- Environment Agnostic: Code in this package is strictly isomorphic TypeScript/JavaScript. It must never reference environment-specific globals like
window,document, orprocess. - Side-Effect Free: All math evaluators and data transformers are pure functions.
License
MIT © Igor Zabrodin