cyberia 3.0.1 → 3.0.2

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 (49) hide show
  1. package/.github/workflows/engine-cyberia.cd.yml +1 -0
  2. package/CHANGELOG.md +56 -1
  3. package/CLI-HELP.md +2 -4
  4. package/README.md +139 -0
  5. package/bin/build.js +5 -0
  6. package/bin/cyberia.js +385 -71
  7. package/bin/deploy.js +18 -26
  8. package/bin/file.js +3 -0
  9. package/bin/index.js +385 -71
  10. package/conf.js +32 -3
  11. package/deployment.yaml +2 -2
  12. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
  13. package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
  14. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  15. package/manifests/deployment/dd-test-development/deployment.yaml +2 -2
  16. package/manifests/ipfs/configmap.yaml +7 -0
  17. package/package.json +8 -8
  18. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.controller.js +2 -0
  19. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.model.js +7 -0
  20. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +93 -2
  21. package/src/api/file/file.controller.js +3 -13
  22. package/src/api/file/file.ref.json +0 -21
  23. package/src/api/ipfs/ipfs.controller.js +104 -0
  24. package/src/api/ipfs/ipfs.model.js +71 -0
  25. package/src/api/ipfs/ipfs.router.js +31 -0
  26. package/src/api/ipfs/ipfs.service.js +193 -0
  27. package/src/api/object-layer/README.md +139 -0
  28. package/src/api/object-layer/object-layer.controller.js +3 -0
  29. package/src/api/object-layer/object-layer.model.js +15 -1
  30. package/src/api/object-layer/object-layer.router.js +6 -10
  31. package/src/api/object-layer/object-layer.service.js +311 -182
  32. package/src/cli/cluster.js +30 -38
  33. package/src/cli/index.js +0 -1
  34. package/src/cli/run.js +14 -0
  35. package/src/client/components/core/LoadingAnimation.js +2 -3
  36. package/src/client/components/core/Modal.js +1 -1
  37. package/src/client/components/cyberia/ObjectLayerEngineModal.js +4 -5
  38. package/src/client/components/cyberia/ObjectLayerEngineViewer.js +280 -29
  39. package/src/client/services/ipfs/ipfs.service.js +144 -0
  40. package/src/client/services/object-layer/object-layer.management.js +161 -8
  41. package/src/index.js +1 -1
  42. package/src/runtime/express/Express.js +1 -1
  43. package/src/server/auth.js +18 -18
  44. package/src/server/ipfs-client.js +433 -0
  45. package/src/server/object-layer.js +649 -18
  46. package/src/server/semantic-layer-generator.js +1083 -0
  47. package/src/server/shape-generator.js +952 -0
  48. package/test/shape-generator.test.js +457 -0
  49. package/bin/ssl.js +0 -63
@@ -59,6 +59,7 @@ jobs:
59
59
  echo "Starting remote sync and deploy"
60
60
  cd /home/dd/engine
61
61
  sudo -n -- /bin/bash -lc "node bin run pull"
62
+ sudo -n -- /bin/bash -lc "npm run test"
62
63
  sudo -n -- /bin/bash -lc "node bin run sync --kubeadm --deploy-id-cron-jobs none --timeout-response 300000ms dd-cyberia,1,,localhost/rockylinux9-underpost:v2.98.3 --cmd 'npm install -g npm@11.2.0,npm install -g underpost,underpost secret underpost --create-from-file /etc/config/.env.production,underpost start --build --run dd-cyberia production'"
63
64
  init:
64
65
  if: github.repository == 'underpostnet/engine' && startsWith(github.event.head_commit.message, 'cd(ssh-init-engine-cyberia)')
package/CHANGELOG.md CHANGED
@@ -1,6 +1,61 @@
1
1
  # Changelog
2
2
 
3
- ## 2026-02-23
3
+ ## 2026-03-02
4
+
5
+ ### engine-cyberia
6
+
7
+ - Add test in engine-cyberia cd workflow ([642d7e36](https://github.com/underpostnet/engine/commit/642d7e36155b6db5dbd36e19767dd95f146ceaf5))
8
+ - Add build dd-cyberia shape generator exclusive module files ([188f563a](https://github.com/underpostnet/engine/commit/188f563a61d7f6bf36bef93cdd18d4e1304f9747))
9
+ - Fix ObjectLayerEngineViewer return to list button click ([aeaead6f](https://github.com/underpostnet/engine/commit/aeaead6f5c67a03449c63c584976e9a73ccc953d))
10
+ - Improve static generations assets in object layer generation CLI ([06694d92](https://github.com/underpostnet/engine/commit/06694d92ea1ad849e745f561b8ec9a48bfa66056))
11
+ - Implements deterministic object layer generation CLI ([f70c9841](https://github.com/underpostnet/engine/commit/f70c9841ef2efc9187c87427cc465505487766db))
12
+ - Implement shape generator module ([5741a38b](https://github.com/underpostnet/engine/commit/5741a38bcfb8c1c4e0ef5053a2a6a73ff50a3879))
13
+ - Fix remove of ag grid table delete object layer delete logic ([e98953cd](https://github.com/underpostnet/engine/commit/e98953cd29767ca44c2362997f0af40cd538371b))
14
+ - Centralize Object Layer Logic and add js docs ([ff8eefed](https://github.com/underpostnet/engine/commit/ff8eefed08349a1e3390379f760c0d9eb20aecca))
15
+ - ObjectLayer Engine Viewer Enhancements ([0ee052e5](https://github.com/underpostnet/engine/commit/0ee052e5231f7b55576595a817742970c90cd056))
16
+ - Add metada json editor of object layers ([abe7448f](https://github.com/underpostnet/engine/commit/abe7448f5ed7429ba1f5c5d01ed94c5c70323638))
17
+ - Remove helia pyntype logic ([2b443d1c](https://github.com/underpostnet/engine/commit/2b443d1c0ed2261e27d5be54903c9a37cff29dd5))
18
+ - Object Layer Deletion Cleanup IPFS ([a2dcdf23](https://github.com/underpostnet/engine/commit/a2dcdf238c32d5b5237f0650232aca0c0823f044))
19
+ - Add Public GET Access for File Object Atlas ([826317fe](https://github.com/underpostnet/engine/commit/826317fe21dfd0b77196ef343b31461c45b5eb72))
20
+ - Allow Cross-Origin on GET methods file, object-layer, and atlas-sprite-sheet api. ([6801839c](https://github.com/underpostnet/engine/commit/6801839cc461dbec6ca205b035ea844415779e85))
21
+ - Add DISABLE_API_RATE_LIMIT env option ([ae72885c](https://github.com/underpostnet/engine/commit/ae72885c1178846067db52b62455d804dbe4eeba))
22
+
23
+ ### client-core
24
+
25
+ - Fix main-body-btn-container hide logic ([221f8bfc](https://github.com/underpostnet/engine/commit/221f8bfc262048e1ca226f66f0dfab9891db3fd5))
26
+
27
+ ### runtime-express
28
+
29
+ - Fix express rate limit trust proxy ([ed19e729](https://github.com/underpostnet/engine/commit/ed19e729eafb59d46504fb1ebe89e4bd91c05d7e))
30
+
31
+ ### cli-cluster
32
+
33
+ - Remove unused full flag ([13df39f5](https://github.com/underpostnet/engine/commit/13df39f508d65b61378ccfca4f7bfc427dcf5fa5))
34
+
35
+ ### ipfs
36
+
37
+ - Add ipfs client stable json stringify in addJsonToIpfs method ([c2aaf56a](https://github.com/underpostnet/engine/commit/c2aaf56a4bfc4f06147818ec5681567e27967f41))
38
+ - Fix config map IPFS Cluster daemon bind ([7e6df963](https://github.com/underpostnet/engine/commit/7e6df963ba6da1fdc96ac5b6ab844a789901f61b))
39
+ - server ipfs client and object layer atlas sprite sheet ipfs integration ([781e35c4](https://github.com/underpostnet/engine/commit/781e35c4903380df9e7dce7cf5d9275387a46029))
40
+ - Implement ipfs api user-pin and client component service ([1b12e8df](https://github.com/underpostnet/engine/commit/1b12e8df6af21e1dd2edc156e176072f25c9a433))
41
+
42
+ ### cli-run
43
+
44
+ - Implements expose-ipfs runner ([765772b8](https://github.com/underpostnet/engine/commit/765772b8fb1e7b397560464d1dc6dea0b70a9b7f))
45
+
46
+ ### engine-core
47
+
48
+ - Clean up legacy logic and json file model ref ([b4c62a2c](https://github.com/underpostnet/engine/commit/b4c62a2cfe4fea0212be644ce333464a81056f6f))
49
+
50
+ ### bin-build
51
+
52
+ - Add missing packagejson overrides on dd-cyberia build repository workflow ([7ece9ed5](https://github.com/underpostnet/engine/commit/7ece9ed5500e83a1baedc4d78fd889bca6ecac3c))
53
+
54
+ ## New release v:3.0.1 (2026-02-22)
55
+
56
+ ### engine-core
57
+
58
+ - Remove ENABLE_FILE_LOGS to default dev adn test env ([727486dc](https://github.com/underpostnet/engine/commit/727486dc4030921c9d1f6a7035eb1a240569fa74))
4
59
 
5
60
  ### gitlab
6
61
 
package/CLI-HELP.md CHANGED
@@ -1,4 +1,4 @@
1
- ## underpost ci/cd cli v3.0.1
1
+ ## underpost ci/cd cli v3.0.2
2
2
 
3
3
  ### Usage: `underpost [options] [command]`
4
4
  ```
@@ -379,8 +379,6 @@ Options:
379
379
  --dedicated-gpu Initializes the cluster with dedicated
380
380
  GPU base resources and environment
381
381
  settings.
382
- --full Initializes the cluster with all
383
- available statefulsets and services.
384
382
  --ns-use <ns-name> Switches the current Kubernetes context
385
383
  to the specified namespace (creates if
386
384
  it doesn't exist).
@@ -835,7 +833,7 @@ Options:
835
833
  Runs specified scripts using various runners.
836
834
 
837
835
  Arguments:
838
- runner-id The runner ID to run. Options: dev-cluster,metadata,svc-ls,svc-rm,ssh-deploy-info,dev-hosts-expose,dev-hosts-restore,cluster-build,template-deploy,template-deploy-image,clean,pull,release-deploy,ssh-deploy,ide,crypto-policy,sync,stop,ssh-deploy-stop,ssh-deploy-db-rollback,ssh-deploy-db,ssh-deploy-db-status,tz,get-proxy,instance-promote,instance,ls-deployments,host-update,dd-container,ip-info,db-client,git-conf,promote,metrics,cluster,deploy,disk-clean,disk-devices,disk-usage,dev,service,etc-hosts,sh,log,ps,ptls,release-cmt,deploy-test,sync-replica,tf-vae-test,spark-template,rmi,kill,secret,underpost-config,gpu-env,tf-gpu-test,deploy-job.
836
+ runner-id The runner ID to run. Options: dev-cluster,ipfs-expose,metadata,svc-ls,svc-rm,ssh-deploy-info,dev-hosts-expose,dev-hosts-restore,cluster-build,template-deploy,template-deploy-image,clean,pull,release-deploy,ssh-deploy,ide,crypto-policy,sync,stop,ssh-deploy-stop,ssh-deploy-db-rollback,ssh-deploy-db,ssh-deploy-db-status,tz,get-proxy,instance-promote,instance,ls-deployments,host-update,dd-container,ip-info,db-client,git-conf,promote,metrics,cluster,deploy,disk-clean,disk-devices,disk-usage,dev,service,etc-hosts,sh,log,ps,ptls,release-cmt,deploy-test,sync-replica,tf-vae-test,spark-template,rmi,kill,secret,underpost-config,gpu-env,tf-gpu-test,deploy-job.
839
837
  path The input value, identifier, or path for the operation.
840
838
 
841
839
  Options:
package/README.md CHANGED
@@ -24,12 +24,14 @@ Key features:
24
24
 
25
25
  - Walks the asset directory structure and processes PNG/GIF files.
26
26
  - Produces `frame_matrix` and `map_color` arrays from images.
27
+ - **Procedurally generates object layers** from semantic item-id descriptors with deterministic seeds and temporal coherence.
27
28
  - Saves processed objects to the `ObjectLayer` model with top-level references to `ObjectLayerRenderFrames`.
28
29
  - Creates separate `ObjectLayerRenderFrames` documents for render data.
29
30
  - Links ObjectLayers to AtlasSpriteSheet documents via top-level `atlasSpriteSheetId`.
30
31
  - Generates unique UUID v4 seeds (via `crypto.randomUUID()`) for SHA256 hash uniqueness.
31
32
  - Generates SHA256 hash using `fast-json-stable-stringify` for deterministic serialization.
32
33
  - Reconstructs PNG frames from stored tile data for debugging.
34
+ - Writes static asset PNGs, atlas sprite sheets, and metadata to the conventional directory structure.
33
35
 
34
36
  ## Getting Started
35
37
 
@@ -68,6 +70,104 @@ cyberia ol --import skin,floor
68
70
  cyberia ol --import all
69
71
  ```
70
72
 
73
+ ### Procedural generation with `--generate`
74
+
75
+ Produces semantically consistent object layers with controlled, reproducible variation and short-term temporal coherence (consecutive frames stay visually consistent). Uses the parametric shape generator and object layer engine under the hood.
76
+
77
+ ```bash
78
+ # Generate a desert floor tile (single frame, auto seed)
79
+ cyberia ol floor-desert --generate
80
+
81
+ # Full control: 3 frames, explicit seed, density
82
+ cyberia ol floor-desert --generate --count 3 --seed fx-42 --frame-index 0 --frame-count 3 --density 0.5
83
+
84
+ # Grass terrain, sparse, 5 frames
85
+ cyberia ol floor-grass --generate --seed meadow-7 --frame-count 5 --density 0.3
86
+
87
+ # Water surface, dense, high element count
88
+ cyberia ol floor-water --generate --seed ocean-1 --count 5 --density 0.8 --frame-count 4
89
+
90
+ # Stone cobblestone
91
+ cyberia ol floor-stone --generate --seed cobble-99 --count 4 --density 0.6
92
+
93
+ # Lava flow, 3-frame animation
94
+ cyberia ol floor-lava --generate --seed magma-3 --frame-count 3 --density 0.7
95
+ ```
96
+
97
+ **`--generate` options:**
98
+
99
+ | Option | Default | Description |
100
+ |---|---|---|
101
+ | `--seed <str>` | auto UUID | Deterministic seed string. Same seed → same output. |
102
+ | `--count <n>` | `3` | Shape element count multiplier per layer. |
103
+ | `--frame-index <n>` | `0` | Starting frame index. |
104
+ | `--frame-count <n>` | `1` | Number of consecutive frames to generate. |
105
+ | `--density <f>` | `0.5` | Overall density factor (`0`–`1`). Lower = sparser. |
106
+
107
+ **Available semantic item-id prefixes:**
108
+
109
+ | Prefix | Type | Tags | Palette |
110
+ |---|---|---|---|
111
+ | `floor-desert` | floor | sand, dune, arid | warm ochres, sand tones |
112
+ | `floor-grass` | floor | grass, meadow, earth | greens, earth browns |
113
+ | `floor-water` | floor | water, ocean, wave | blues, foam whites |
114
+ | `floor-stone` | floor | stone, rock, cobble | greys, warm/cool stone |
115
+ | `floor-lava` | floor | lava, magma, fire | reds, oranges, dark crust |
116
+ | `skin-*` | skin | character, body | skin tones, clothing darks |
117
+
118
+ #### How generation works
119
+
120
+ Each item-id maps to a **semantic descriptor** that provides `semanticTags`, `paletteHints`, `preferredShapes`, and named **layer specs** (e.g. `base`, `dunes`, `rocks`, `tufts` for `floor-desert`).
121
+
122
+ **Seed derivation** — deterministic at every level:
123
+
124
+ ```
125
+ layerSeed = hash(seed + ':' + itemId + ':' + layerKey)
126
+ frameSeed = hash(layerSeed + ':' + frameIndex)
127
+ ```
128
+
129
+ **Temporal coherence** — shape topology (which shapes, how many, where) is locked to `layerSeed` and never changes between frames. Only smooth, low-frequency noise perturbations (position jitter, slight rotation/scale wobble) are derived from `frameSeed`, so frame N and N+1 differ by ~2% of cells.
130
+
131
+ **Layer naming** — every generated layer gets an id: `<itemId>-<layerKey>` (e.g. `floor-desert-dunes`).
132
+
133
+ **Generation pipeline per layer:**
134
+
135
+ 1. Pick generator type (`noise-field` for base fills, `shape` for element placement).
136
+ 2. Select palette colors deterministically from `paletteHints` with per-element `colorShift`.
137
+ 3. For shape layers: pick shape via weighted `preferredShapes`, compute stable base transform `(x, y, scale, rotation)`, apply frame-level smooth noise.
138
+ 4. Stamp shapes onto a 24×24 grid via `intCoords` rasterization from the parametric shape generator.
139
+ 5. Composite all layers into a final `frame_matrix` + unified `colors` palette.
140
+
141
+ **Variability factors per layer:**
142
+ `scaleVariance`, `rotationVariance`, `colorShift`, `jitter`, `noiseLevel`, `detailLevel`, `sparsity` — small, deterministic variations that keep each generation unique but semantically coherent.
143
+
144
+ #### What `--generate` persists
145
+
146
+ The full pipeline runs automatically:
147
+
148
+ 1. **Static assets** — PNGs written to `./src/client/public/cyberia/assets/{type}/{itemId}/{dirCode}/{frame}.png` + `metadata.json`.
149
+ 2. **MongoDB** — `ObjectLayerRenderFrames` + `ObjectLayer` documents created with SHA-256 hash.
150
+ 3. **Atlas sprite sheet** — generated, saved to `File` + `AtlasSpriteSheet` collections, and linked via `atlasSpriteSheetId`.
151
+
152
+ #### Reproducibility example
153
+
154
+ Running the same command twice produces byte-identical output:
155
+
156
+ ```bash
157
+ # Run 1
158
+ cyberia ol floor-desert --generate --seed fx-42 --count 3 --frame-count 2
159
+
160
+ # Run 2 (identical output)
161
+ cyberia ol floor-desert --generate --seed fx-42 --count 3 --frame-count 2
162
+ ```
163
+
164
+ Different seeds produce different but semantically consistent results:
165
+
166
+ ```bash
167
+ cyberia ol floor-desert --generate --seed fx-42 # variant A
168
+ cyberia ol floor-desert --generate --seed fx-99 # variant B (same style, different arrangement)
169
+ ```
170
+
71
171
  ## Visualize a processed frame
72
172
 
73
173
  Reconstructs and opens a PNG from the database-stored frame data. Requires item-id as the first positional argument, followed by direction and frame index in the format `[direction]_[frameIndex]`.
@@ -178,6 +278,45 @@ cyberia ol anon --to-atlas-sprite-sheet
178
278
  cyberia ol anon --show-atlas-sprite-sheet
179
279
  ```
180
280
 
281
+ ### Procedural Generation Pipeline
282
+
283
+ Generate an object layer entirely from a semantic descriptor — no source PNGs needed:
284
+
285
+ ```bash
286
+ # 1. Generate a 3-frame desert floor with explicit seed
287
+ cyberia ol floor-desert --generate --seed fx-42 --frame-count 3 --density 0.5
288
+
289
+ # 2. Inspect the generated frame
290
+ cyberia ol floor-desert --show-frame 08_0
291
+
292
+ # 3. View the auto-generated atlas
293
+ cyberia ol floor-desert --show-atlas-sprite-sheet
294
+ ```
295
+
296
+ ### Batch Procedural Generation
297
+
298
+ Generate a full tileset family with consistent seeds:
299
+
300
+ ```bash
301
+ cyberia ol floor-desert --generate --seed world-1 --frame-count 3
302
+ cyberia ol floor-grass --generate --seed world-1 --frame-count 3
303
+ cyberia ol floor-water --generate --seed world-1 --frame-count 4
304
+ cyberia ol floor-stone --generate --seed world-1 --frame-count 2
305
+ cyberia ol floor-lava --generate --seed world-1 --frame-count 3
306
+ ```
307
+
308
+ ### Exploring Seed Variations
309
+
310
+ ```bash
311
+ # Same item, different seeds — compare visual output
312
+ cyberia ol floor-desert --generate --seed alpha --frame-count 1
313
+ cyberia ol floor-desert --generate --seed beta --frame-count 1
314
+ cyberia ol floor-desert --generate --seed gamma --frame-count 1
315
+
316
+ # Inspect each
317
+ cyberia ol floor-desert --show-frame 08_0
318
+ ```
319
+
181
320
  ### Debugging Asset Issues
182
321
 
183
322
  ```bash
package/bin/build.js CHANGED
@@ -181,6 +181,9 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
181
181
  '/src/client/ssr/pages/CyberiaServerMetrics.js',
182
182
  '/src/server/object-layer.js',
183
183
  '/src/server/atlas-sprite-sheet-generator.js',
184
+ '/src/server/shape-generator.js',
185
+ '/src/server/semantic-layer-generator.js',
186
+ '/test/shape-generator.test.js',
184
187
  ])
185
188
  fs.copySync(`.${path}`, `${basePath}${path}`);
186
189
 
@@ -217,4 +220,6 @@ const { DefaultConf } = await import(`../conf.${confName}.js`);
217
220
  if (fs.existsSync(`./src/ws/${confName.split('-')[1]}`)) {
218
221
  fs.copySync(`./src/ws/${confName.split('-')[1]}`, `${basePath}/src/ws/${confName.split('-')[1]}`);
219
222
  }
223
+ shellExec(`cd ${basePath} && npm install --ignore-scripts`);
224
+ shellExec(`cd ${basePath} && npm run fix`);
220
225
  }