@dcl/hammurabi-server 1.0.0-17268386187.commit-b609629 → 1.0.0-17268510028.commit-650bd27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +0 -2
  2. package/package.json +3 -5
  3. package/CLAUDE.md +0 -90
package/README.md CHANGED
@@ -10,8 +10,6 @@ This server can run Decentraland scenes in a headless environment, making it per
10
10
  - **Headless bots** and automated agents
11
11
  - **Performance testing** without browser overhead
12
12
 
13
- **Status: Production Ready** ✅
14
-
15
13
  ## Features
16
14
 
17
15
  - 🏃‍♂️ **Headless 3D Processing** - Full Babylon.js scene simulation without rendering
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/hammurabi-server",
3
- "version": "1.0.0-17268386187.commit-b609629",
3
+ "version": "1.0.0-17268510028.commit-650bd27",
4
4
  "main": "dist/cli.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,9 +40,7 @@
40
40
  ],
41
41
  "files": [
42
42
  "dist/",
43
- "hammurabi",
44
- "README.md",
45
- "CLAUDE.md"
43
+ "README.md"
46
44
  ],
47
45
  "dependencies": {
48
46
  "@babylonjs/core": "^6.4.1",
@@ -69,5 +67,5 @@
69
67
  "ts-jest": "^29.1.0",
70
68
  "typescript": "^5.0.4"
71
69
  },
72
- "commit": "b609629e8d6ca3d5239987b7cbbd300f94c407b6"
70
+ "commit": "650bd27853a1cb15569eead8d2d45e8ba69be868"
73
71
  }
package/CLAUDE.md DELETED
@@ -1,90 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Build Commands
6
-
7
- This project is a headless Node.js server implementation of the Decentraland protocol using Babylon.js NullEngine for 3D scene processing without rendering.
8
-
9
- ```bash
10
- # Build TypeScript to JavaScript
11
- npm run build
12
-
13
- # Run tests
14
- npm run test
15
-
16
- # Start development server
17
- npm start # runs: ./start --realm=localhost:8000
18
-
19
- # Run the server with specific realm
20
- npx @dcl/hammurabi-server --realm=localhost:8000
21
- ```
22
-
23
- The project uses simple TypeScript compilation (`tsc`) instead of complex bundling. The compiled output goes to `dist/` folder.
24
-
25
- ## Project Architecture
26
-
27
- This is the **Hammurabi Server** - a headless implementation of the Decentraland protocol that runs entirely in Node.js without browser dependencies.
28
-
29
- ### Core Architecture Components
30
-
31
- **Engine Initialization (`src/lib/engine-main.ts`)**:
32
- - Entry point that creates Babylon.js NullEngine for headless 3D processing
33
- - Creates guest identity for authentication
34
- - Fetches realm configuration from `/about` endpoint
35
- - Initializes all systems (avatar rendering, scene culling, character controller, etc.)
36
- - Scene loading uses `loadSceneContextFromLocal` with hot reload support
37
-
38
- **Scene Management (`src/lib/babylon/scene/`)**:
39
- - `SceneContext` - Central class managing scene state, CRDT message processing, and entity lifecycle
40
- - `BabylonEntity` - Wrapper around Babylon.js objects with component-based architecture
41
- - **Node.js Runtime**: Uses `connectSceneContextUsingNodeJs` with in-process WebWorker runtime and MemoryTransport (no actual worker threads)
42
- - Hot reload support for local development
43
-
44
- **Communications System (`src/lib/decentraland/communications/`)**:
45
- - **LiveKit Transport** (`transports/livekit.ts`): Uses `@livekit/rtc-node` package for Node.js multiplayer
46
- - Room management without browser-specific APIs
47
- - Uses `connectionState` instead of `state` property
48
- - No `waitForPCInitialConnection()` in Node.js version
49
- - `CommsTransportWrapper` - Transport abstraction layer
50
- - Scene-specific communications via `createSceneComms`
51
- - Local gatekeeper connection at `localhost:3000` for preview scenes
52
-
53
- **Headless Adaptations**:
54
- - **Babylon.js** (`src/lib/babylon/index.ts`): Always uses NullEngine, no canvas/WebGL
55
- - **Avatar Rendering** (`src/lib/babylon/avatars/AvatarRenderer.ts`):
56
- - Skips UI texture creation when `OffscreenCanvas` is undefined
57
- - No emote loading in headless mode
58
- - Avatar components created but not visually rendered
59
- - **Asset Loading**: Custom XMLHttpRequest polyfill in `cli.ts` for GLTF loading
60
- - **Environment**: Simplified lighting without complex visual materials
61
-
62
- ### Key Technical Details
63
-
64
- - **Node.js 18+**: Uses native fetch API, no polyfills needed
65
- - **Error Resilience**: Global uncaught exception handlers prevent server crashes
66
- - **No DOM Dependencies**: All browser-specific code is conditional or removed
67
- - **LiveKit Node SDK**: Direct imports from `@livekit/rtc-node`, no conditional loading
68
- - **Entity Allocation**: Unity-compatible reserved ranges (1 for local player, 32-255 for remote)
69
- - **CRDT Protocol**: Component-based entity system with conflict resolution
70
- - **Profile System**: ADR-204 compliant with Catalyst-based fetching
71
-
72
- ### CLI Structure (`src/cli.ts`)
73
-
74
- The CLI provides:
75
- - XMLHttpRequest polyfill for Babylon.js asset loading
76
- - Argument parsing for `--realm`, `--address`, `--authenticated` flags
77
- - Global error handlers that keep server running despite errors
78
- - Direct execution as npm bin via `dist/cli.js`
79
-
80
- ### GitHub Actions Publishing
81
-
82
- The `.github/workflows/build-release.yaml` workflow:
83
- - Triggers on pushes to main, all PRs, and releases
84
- - Uses `decentraland/oddish-action@master` for npm/S3 publishing
85
- - Creates deterministic snapshots for PR testing
86
- - Publishes to `@dcl/hammurabi-server` on npm
87
-
88
- ### Testing
89
-
90
- The project uses Jest for testing. Integration tests may require the testing realm to be built, though most of that infrastructure has been simplified for the headless server.