Shared foundation infrastructure — the dependency-free base of every other package. Part of fourJS.
Implements §6a (component model), §6b (eventing), and the §83/§85 error model from docs/SPECIFICATION.md; shipped in Phase 1 (§104), with later hoists of shared utilities.
EventEmitter — the one typed emitter API used by nodes and the application (§6b); re-entrant emissions queue and defer.Component, ComponentType, ComponentHost, and ComponentRegistry; one component per type per host.FourError / FourErrorCode / isFourError (§83, §85).Disposable and disposeAll.SeededRandom — xorshift128 with splitmix32 seeding; the deterministic RNG the §33–34 machinery relies on (@fourjs/motion and @fourjs/particles re-export it).JsonValue and cloneJsonValue (refuses payloads carrying a __proto__ own key).DEFAULT_GRAVITY_Y — the shared gravity convention (§7a: right-handed Y-up world; gravity is negative Y in both 2D and 3D).SpaceMode, SPACE_MODES, DEFAULT_SPACE_MODE, isSimulationSpaceMode. Vocabulary only, hoisted here for the DEFAULT_GRAVITY_Y reason: §8's two halves belong to pillars that may not import each other. @fourjs/physics is the one consumer today (RigidBody.space); no renderer places a node by a §8 mode — read the header of src/space.ts before authoring one.UnitSystem, SI_UNITS, resolveUnitSystem, and the …ToDisplay / …FromDisplay / format… helpers. Display and authoring conversion only (spec rev 1.3): declaring a unit system changes nothing the engine computes — every API signature stays radians, seconds, and world units, and the helpers are barred from simulation paths because their arithmetic is inexact in the last bits (§33–§34). Read the header of src/units.ts before using them.@fourjs/physics reading scale.lengthToMeters for the §41 precision envelope (2026-08-07)."90°" → radians) — the numeric direction (angleFromDisplay) is what §40 asks for; a locale-aware parser is not (2026-08-07).NodeSpace component. Blocked on its §79 serializer: a component class carries a static typeName, and one with no registered serializer makes serializeScene throw, so the class and its registration in registerSceneNodeTypes (umbrella package) must land together, with the render-side consumer that gives screen/viewport/camera/billboard a meaning (2026-08-09, PH-12).Unit tests are colocated in tests/ per §92.
Workspace name @fourjs/core; publishes as @danielsimonjr/fourjs-core.