cyberia 3.2.9 → 3.2.22
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.
- package/.github/workflows/engine-cyberia.cd.yml +7 -0
- package/.github/workflows/engine-cyberia.ci.yml +14 -2
- package/.github/workflows/ghpkg.ci.yml +1 -0
- package/.github/workflows/npmpkg.ci.yml +10 -5
- package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
- package/.github/workflows/release.cd.yml +1 -0
- package/.vscode/extensions.json +9 -9
- package/.vscode/settings.json +20 -4
- package/CHANGELOG.md +363 -1
- package/CLI-HELP.md +975 -1061
- package/README.md +190 -348
- package/bin/build.js +102 -125
- package/bin/build.template.js +33 -0
- package/bin/cyberia.js +238 -56
- package/bin/deploy.js +16 -3
- package/bin/index.js +238 -56
- package/bump.config.js +26 -0
- package/conf.js +131 -24
- package/deployment.yaml +76 -2
- package/hardhat/package-lock.json +113 -144
- package/hardhat/package.json +4 -3
- package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +2 -2
- package/manifests/cronjobs/dd-cron/dd-cron-dns.yaml +1 -1
- package/manifests/deployment/dd-cyberia-development/deployment.yaml +76 -2
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/kind-config-dev.yaml +8 -0
- package/manifests/lxd/lxd-admin-profile.yaml +12 -3
- package/manifests/mongodb/pv-pvc.yaml +44 -8
- package/manifests/mongodb/statefulset.yaml +55 -68
- package/manifests/mongodb-4.4/headless-service.yaml +10 -0
- package/manifests/mongodb-4.4/kustomization.yaml +3 -1
- package/manifests/mongodb-4.4/mongodb-nodeport.yaml +17 -0
- package/manifests/mongodb-4.4/pv-pvc.yaml +10 -14
- package/manifests/mongodb-4.4/statefulset.yaml +79 -0
- package/manifests/mongodb-4.4/storage-class.yaml +9 -0
- package/manifests/valkey/statefulset.yaml +1 -1
- package/manifests/valkey/valkey-nodeport.yaml +17 -0
- package/package.json +31 -19
- package/scripts/ipxe-setup.sh +52 -49
- package/scripts/k3s-node-setup.sh +81 -46
- package/scripts/link-local-underpost-cli.sh +6 -0
- package/scripts/lxd-vm-setup.sh +193 -8
- package/scripts/maas-nat-firewalld.sh +145 -0
- package/scripts/test-monitor.sh +250 -0
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.router.js +38 -33
- package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +16 -16
- package/src/api/core/core.router.js +19 -14
- package/src/api/core/core.service.js +5 -5
- package/src/api/crypto/crypto.router.js +18 -12
- package/src/api/crypto/crypto.service.js +3 -3
- package/src/api/cyberia-action/cyberia-action.model.js +1 -1
- package/src/api/cyberia-action/cyberia-action.router.js +22 -18
- package/src/api/cyberia-action/cyberia-action.service.js +5 -5
- package/src/api/cyberia-client-hints/cyberia-client-hints.controller.js +74 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.model.js +99 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.router.js +98 -0
- package/src/api/cyberia-client-hints/cyberia-client-hints.service.js +152 -0
- package/src/api/cyberia-dialogue/cyberia-dialogue.router.js +25 -20
- package/src/api/cyberia-dialogue/cyberia-dialogue.service.js +6 -6
- package/src/api/cyberia-entity/cyberia-entity.router.js +22 -18
- package/src/api/cyberia-entity/cyberia-entity.service.js +5 -5
- package/src/api/cyberia-instance/cyberia-fallback-world.js +79 -4
- package/src/api/cyberia-instance/cyberia-instance.router.js +57 -52
- package/src/api/cyberia-instance/cyberia-instance.service.js +10 -10
- package/src/api/cyberia-instance/cyberia-world-generator.js +3 -3
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.model.js +14 -48
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.router.js +22 -18
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.service.js +5 -5
- package/src/api/cyberia-map/cyberia-map.router.js +35 -30
- package/src/api/cyberia-map/cyberia-map.service.js +7 -7
- package/src/api/cyberia-quest/cyberia-quest.model.js +1 -1
- package/src/api/cyberia-quest/cyberia-quest.router.js +22 -18
- package/src/api/cyberia-quest/cyberia-quest.service.js +5 -5
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.router.js +22 -18
- package/src/api/cyberia-quest-progress/cyberia-quest-progress.service.js +5 -5
- package/src/api/cyberia-server-defaults/cyberia-server-defaults.js +458 -0
- package/src/api/default/default.router.js +22 -18
- package/src/api/default/default.service.js +5 -5
- package/src/api/document/document.router.js +28 -23
- package/src/api/document/document.service.js +100 -23
- package/src/api/file/file.router.js +19 -13
- package/src/api/file/file.service.js +9 -7
- package/src/api/instance/instance.router.js +29 -24
- package/src/api/instance/instance.service.js +6 -6
- package/src/api/ipfs/ipfs.router.js +21 -16
- package/src/api/ipfs/ipfs.service.js +8 -8
- package/src/api/object-layer/object-layer.router.js +512 -507
- package/src/api/object-layer/object-layer.service.js +17 -14
- package/src/api/object-layer-render-frames/object-layer-render-frames.router.js +22 -18
- package/src/api/object-layer-render-frames/object-layer-render-frames.service.js +5 -5
- package/src/api/test/test.router.js +17 -12
- package/src/api/types.js +24 -0
- package/src/api/user/guest.service.js +5 -4
- package/src/api/user/user.router.js +297 -288
- package/src/api/user/user.service.js +100 -35
- package/src/cli/baremetal.js +132 -101
- package/src/cli/cluster.js +700 -232
- package/src/cli/db.js +59 -60
- package/src/cli/deploy.js +291 -294
- package/src/cli/env.js +1 -4
- package/src/cli/fs.js +13 -3
- package/src/cli/image.js +58 -4
- package/src/cli/index.js +127 -15
- package/src/cli/ipfs.js +4 -6
- package/src/cli/kubectl.js +4 -1
- package/src/cli/lxd.js +1099 -223
- package/src/cli/monitor.js +396 -9
- package/src/cli/release.js +355 -146
- package/src/cli/repository.js +169 -30
- package/src/cli/run.js +347 -117
- package/src/cli/secrets.js +11 -2
- package/src/cli/test.js +9 -3
- package/src/client/Default.index.js +9 -3
- package/src/client/components/core/Auth.js +5 -0
- package/src/client/components/core/ClientEvents.js +76 -0
- package/src/client/components/core/EventBus.js +4 -0
- package/src/client/components/core/Modal.js +82 -41
- package/src/client/components/core/PanelForm.js +14 -10
- package/src/client/components/core/Worker.js +162 -363
- package/src/client/components/cyberia/MapEngineCyberia.js +1 -1
- package/src/client/components/cyberia/SharedDefaultsCyberia.js +330 -0
- package/src/client/public/cyberia-docs/ACTION-SYSTEM.md +55 -1
- package/src/client/public/cyberia-docs/ARCHITECTURE.md +223 -361
- package/src/client/public/cyberia-docs/CYBERIA-CLI.md +114 -327
- package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +200 -222
- package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +212 -185
- package/src/client/public/cyberia-docs/CYBERIA.md +259 -0
- package/src/client/public/cyberia-docs/OFF-CHAIN-ECONOMY.md +2 -2
- package/src/client/public/cyberia-docs/QUEST-SYSTEM.md +23 -1
- package/src/client/public/cyberia-docs/ROADMAP.md +1 -1
- package/src/client/public/cyberia-docs/UNDERPOST-PLATFORM.md +106 -0
- package/src/client/public/cyberia-docs/WHITE-PAPER.md +1 -1
- package/src/client/services/cyberia-client-hints/cyberia-client-hints.service.js +99 -0
- package/src/client/ssr/views/CyberiaServerMetrics.js +982 -0
- package/src/client/sw/core.sw.js +174 -112
- package/src/db/DataBaseProvider.js +115 -15
- package/src/db/mariadb/MariaDB.js +2 -1
- package/src/db/mongo/MongoBootstrap.js +657 -0
- package/src/db/mongo/MongooseDB.js +130 -21
- package/src/grpc/cyberia/grpc-server.js +25 -57
- package/src/index.js +1 -1
- package/src/runtime/cyberia-client/Dockerfile +10 -7
- package/src/runtime/cyberia-client/Dockerfile.dev +67 -0
- package/src/runtime/cyberia-server/Dockerfile +11 -6
- package/src/runtime/cyberia-server/Dockerfile.dev +47 -0
- package/src/runtime/express/Express.js +2 -2
- package/src/runtime/wp/Dockerfile +3 -3
- package/src/runtime/wp/Wp.js +8 -5
- package/src/server/auth.js +2 -2
- package/src/server/catalog-underpost.js +61 -0
- package/src/server/catalog.js +77 -0
- package/src/server/client-build-docs.js +1 -1
- package/src/server/client-build.js +94 -129
- package/src/server/conf.js +496 -135
- package/src/server/ipfs-client.js +5 -3
- package/src/server/process.js +180 -19
- package/src/server/proxy.js +9 -2
- package/src/server/runtime-status.js +235 -0
- package/src/server/runtime.js +1 -1
- package/src/server/start.js +44 -11
- package/src/server/valkey.js +2 -0
- package/src/ws/IoInterface.js +16 -16
- package/src/ws/core/channels/core.ws.chat.js +11 -11
- package/src/ws/core/channels/core.ws.mailer.js +29 -29
- package/src/ws/core/channels/core.ws.stream.js +19 -19
- package/src/ws/core/core.ws.connection.js +8 -8
- package/src/ws/core/core.ws.server.js +6 -5
- package/src/ws/default/channels/default.ws.main.js +10 -10
- package/src/ws/default/default.ws.connection.js +4 -4
- package/src/ws/default/default.ws.server.js +4 -3
- package/test/deploy-monitor.test.js +251 -0
- package/bin/file.js +0 -202
- package/bin/vs.js +0 -74
- package/bin/zed.js +0 -84
- package/manifests/deployment/dd-test-development/deployment.yaml +0 -254
- package/manifests/deployment/dd-test-development/proxy.yaml +0 -102
- package/src/api/cyberia-instance-conf/cyberia-instance-conf.defaults.js +0 -574
- package/src/client/components/cyberia-portal/CommonCyberiaPortal.js +0 -467
- package/src/client/ssr/email/DefaultRecoverEmail.js +0 -21
- package/src/client/ssr/email/DefaultVerifyEmail.js +0 -17
- package/src/client/ssr/pages/CyberiaServerMetrics.js +0 -461
- /package/src/client/ssr/{offline → views}/Maintenance.js +0 -0
- /package/src/client/ssr/{offline → views}/NoNetworkConnection.js +0 -0
- /package/src/client/ssr/{pages → views}/Test.js +0 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://www.cyberiaonline.com/assets/splash/apple-touch-icon-precomposed.png" alt="CYBERIA Network Object Layer Engine"/>
|
|
4
|
+
|
|
5
|
+
<h1>CYBERIA</h1>
|
|
6
|
+
|
|
7
|
+
**Network Object Layers**
|
|
8
|
+
|
|
9
|
+
_Stackable Rendering Layers as a Unified Tokenized Reality_
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.org/package/cyberia)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
Cyberia is an MMORPG extension built on the Underpost Platform. The platform owns the
|
|
15
|
+
toolchain, deployment surface, PWA delivery, and base infrastructure. Cyberia adds a three-service MMO
|
|
16
|
+
runtime: `engine-cyberia`, `cyberia-server`, and `cyberia-client`.
|
|
17
|
+
|
|
18
|
+
`engine-cyberia` is the **sidecar-backed data layer**: a Node.js sidecar that owns content,
|
|
19
|
+
validation, persistence, the gRPC/REST data services, and asset metadata. It backs the authoritative
|
|
20
|
+
Go server and the WASM client with data — it does not run the simulation or the presentation.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Ecosystem at a glance
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
┌───────────────────────────────────────────────┐
|
|
28
|
+
│ UNDERPOST PLATFORM │
|
|
29
|
+
│ toolchain · deploy · PWA build · static │
|
|
30
|
+
│ delivery · cluster/image/db · monitoring │
|
|
31
|
+
│ │
|
|
32
|
+
│ underpost CLI ──▶ builds & deploys all │
|
|
33
|
+
└───────────────────────────────────────────────┘
|
|
34
|
+
│ hosts / delivers
|
|
35
|
+
▼
|
|
36
|
+
╔═══════════════════════════════ CYBERIA MMO ══════════════════════════════════╗
|
|
37
|
+
║ ║
|
|
38
|
+
║ ┌──────────────────┐ gRPC ┌──────────────────┐ WebSocket ║
|
|
39
|
+
║ │ engine-cyberia │ ────────▶ │ cyberia-server │ ───────────┐ ║
|
|
40
|
+
║ │ (Node.js) │ │ (Go) │ │ ║
|
|
41
|
+
║ │ │ │ │ ▼ ║
|
|
42
|
+
║ │ content │ │ authoritative │ ┌──────────────────┐ ║
|
|
43
|
+
║ │ validation │ │ simulation │ │ cyberia-client │ ║
|
|
44
|
+
║ │ persistence │ │ world tick │ │ (C / WASM) │ ║
|
|
45
|
+
║ │ gRPC/REST data │ │ AOI replication │ │ │ ║
|
|
46
|
+
║ │ asset metadata │ │ │ │ rendering │ ║
|
|
47
|
+
║ └──────────────────┘ └──────────────────┘ │ input │ ║
|
|
48
|
+
║ │ │ prediction │ ║
|
|
49
|
+
║ └──────────────── REST (content/assets) ─────▶│ presentation │ ║
|
|
50
|
+
║ └──────────────────┘ ║
|
|
51
|
+
╚═══════════════════════════════════════════════════════════════════════════════╝
|
|
52
|
+
|
|
53
|
+
One source of truth per concern:
|
|
54
|
+
content & world config ── engine-cyberia
|
|
55
|
+
real-time world state ── cyberia-server
|
|
56
|
+
presentation & input ── cyberia-client
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 1. Toolchain and base infrastructure
|
|
62
|
+
|
|
63
|
+
Underpost Platform is the operational backbone and the source of truth for deploy IDs, runtime
|
|
64
|
+
selection, host/path layout, generated client assets, and environment resolution.
|
|
65
|
+
|
|
66
|
+
| Area | What it owns |
|
|
67
|
+
| --------------- | ------------------------------------------------------------------------------------ |
|
|
68
|
+
| Toolchain | `underpost` CLI, build, deploy, release, metadata, secrets, environment selection |
|
|
69
|
+
| Infrastructure | bare metal, LXD, Kubernetes, K3s, kubeadm, images, SSH, runners |
|
|
70
|
+
| Data operations | MongoDB, MariaDB where needed, backups, cron, monitoring |
|
|
71
|
+
| Delivery | static build, SSR views, PWA packaging, service worker generation, host/path routing |
|
|
72
|
+
|
|
73
|
+
`underpost` is the shared control surface for everything infrastructural. Cyberia-specific work belongs
|
|
74
|
+
in the `cyberia` CLI, never in parallel platform commands. When a concern already exists in `underpost`,
|
|
75
|
+
reuse it instead of forking a Cyberia variant.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 2. PWA workflow
|
|
80
|
+
|
|
81
|
+
Every deployed client ships as a static application shell with PWA support. The pipeline has exactly two
|
|
82
|
+
inputs:
|
|
83
|
+
|
|
84
|
+
- the deploy `ssr` configuration in `conf.dd-*.js` (or `conf.ssr.json`)
|
|
85
|
+
- the service worker source in `src/client/sw/core.sw.js`
|
|
86
|
+
|
|
87
|
+
Everything else — `index.html` pages, `sw.js`, the precache list — is **generated** during the client
|
|
88
|
+
build. Treat them as outputs only; never hand-edit them.
|
|
89
|
+
|
|
90
|
+
Runtime service-worker behavior:
|
|
91
|
+
|
|
92
|
+
| Request | Strategy |
|
|
93
|
+
| ------------- | -------------------------------- |
|
|
94
|
+
| static assets | stale-while-revalidate |
|
|
95
|
+
| API `GET` | network-first + short cache |
|
|
96
|
+
| API mutations | network-only + background replay |
|
|
97
|
+
| navigation | network-first + fallback shells |
|
|
98
|
+
|
|
99
|
+
Fallback selection: offline network → offline fallback view; origin/server failure → maintenance
|
|
100
|
+
fallback view. Only fallback-marked views are guaranteed precached.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 3. Cyberia MMO extension
|
|
105
|
+
|
|
106
|
+
### Responsibility split
|
|
107
|
+
|
|
108
|
+
| Service | Owns | Must not own |
|
|
109
|
+
| ---------------- | ------------------------------------------------------------------------- | --------------------------------------------- |
|
|
110
|
+
| `engine-cyberia` | content, validation, persistence, gRPC/REST data services, asset metadata | authoritative simulation, render policy |
|
|
111
|
+
| `cyberia-server` | authoritative simulation, world tick, gameplay mutation, AOI replication | content authority, presentation metadata |
|
|
112
|
+
| `cyberia-client` | rendering, input, prediction, interpolation, presentation | authoritative world state, gameplay authority |
|
|
113
|
+
|
|
114
|
+
Two boundaries are non-negotiable:
|
|
115
|
+
|
|
116
|
+
- Do not move authoritative logic into the client.
|
|
117
|
+
- Do not move content-authority logic into the Go runtime.
|
|
118
|
+
|
|
119
|
+
### Data flow
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
engine-cyberia ──gRPC──▶ cyberia-server ──WebSocket──▶ cyberia-client
|
|
123
|
+
engine-cyberia ──REST──────────────────────────────▶ cyberia-client
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### `engine-cyberia` as the sidecar-backed data layer
|
|
127
|
+
|
|
128
|
+
`engine-cyberia` is the only Cyberia service that owns content-backed data and asset metadata.
|
|
129
|
+
|
|
130
|
+
- Boot-time world configuration flows from `engine-cyberia` to `cyberia-server` over gRPC `GetFullInstance`.
|
|
131
|
+
- Client-facing assets, object layers, dialogues, and presentation hints flow from `engine-cyberia` to `cyberia-client` over REST.
|
|
132
|
+
- Simulation never migrates into the sidecar, and presentation policy never migrates out of the client.
|
|
133
|
+
|
|
134
|
+
### Runtime / health model
|
|
135
|
+
|
|
136
|
+
Three supervised processes run in parallel, each with its own monitor and reconnect loop. Gameplay is live only when all three are healthy at once.
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
140
|
+
│ SUPERVISION (parallel) │
|
|
141
|
+
│ │
|
|
142
|
+
│ engine-cyberia cyberia-server cyberia-client │
|
|
143
|
+
│ ┌────────────┐ ┌────────────┐ ┌────────────┐ │
|
|
144
|
+
│ │ monitor │ │ monitor │ │ monitor │ │
|
|
145
|
+
│ │ +reconnect │ │ +reconnect │ │ +reconnect │ │
|
|
146
|
+
│ └─────┬──────┘ └─────┬──────┘ └─────┬──────┘ │
|
|
147
|
+
│ │ │ │ │
|
|
148
|
+
│ └──────────┬──────────┴──────────┬──────────┘ │
|
|
149
|
+
│ ▼ ▼ │
|
|
150
|
+
│ all three up & connected? │
|
|
151
|
+
└────────────────────────────┬─────────────────────────────────┘
|
|
152
|
+
│
|
|
153
|
+
┌─────────────────────┼─────────────────────┐
|
|
154
|
+
▼ ▼ ▼
|
|
155
|
+
┌───────────┐ ┌───────────┐ ┌───────────┐
|
|
156
|
+
│ HEALTHY │ │ DEGRADED │ │ STANDBY │
|
|
157
|
+
│ all 3 up │ │ ≥1 service│ │ gameplay │
|
|
158
|
+
│ gameplay │ │ reconnect-│ │ paused │
|
|
159
|
+
│ live │ │ ing / down│ │ until all │
|
|
160
|
+
│ │ │ │ │ 3 healthy │
|
|
161
|
+
└───────────┘ └───────────┘ └───────────┘
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
| State | Meaning |
|
|
165
|
+
| ---------- | -------------------------------------------------------------------- |
|
|
166
|
+
| `healthy` | all three Cyberia services are up and connected |
|
|
167
|
+
| `degraded` | at least one service is reconnecting or unavailable |
|
|
168
|
+
| `standby` | gameplay is paused because the full three-service set is not healthy |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## User commands
|
|
173
|
+
|
|
174
|
+
Use `underpost` for platform, infrastructure, build, and deploy. Use `cyberia` for MMO content and
|
|
175
|
+
extension workflows. Both share the same helpers — never duplicate config, env, or path logic.
|
|
176
|
+
|
|
177
|
+
### Platform (underpost)
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Bootstrap a new app (local app serves on http://localhost:4001)
|
|
181
|
+
underpost new app-name
|
|
182
|
+
|
|
183
|
+
# Build the client bundle / static + PWA output
|
|
184
|
+
underpost client
|
|
185
|
+
npm run build # node bin client
|
|
186
|
+
|
|
187
|
+
# Deploy and operate
|
|
188
|
+
underpost deploy <deploy-id>
|
|
189
|
+
underpost monitor
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Cyberia (cyberia) — `bin/cyberia.js`
|
|
193
|
+
|
|
194
|
+
| Group | Command | Purpose |
|
|
195
|
+
| -------------- | -------------------------------------- | -------------------------------------------------------- |
|
|
196
|
+
| `ol` | `cyberia ol [item-id]` | ObjectLayer import, procedural generation, atlas/sprite |
|
|
197
|
+
| `instance` | `cyberia instance [instance-code]` | export / import / drop a Cyberia instance and its data |
|
|
198
|
+
| `client-hints` | `cyberia client-hints [instance-code]` | per-instance presentation hints (palette, camera, icons) |
|
|
199
|
+
| `chain` | `cyberia chain <sub>` | Hyperledger Besu + ERC-1155 ObjectLayerToken lifecycle |
|
|
200
|
+
| `run-workflow` | `cyberia run-workflow <name>` | named maintenance/build scripts from `scripts/` |
|
|
201
|
+
|
|
202
|
+
Common examples:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Object layer content
|
|
206
|
+
cyberia ol hatchet,sword --import # import specific items
|
|
207
|
+
cyberia ol --import-types skin,floors # batch import by type (or: all)
|
|
208
|
+
cyberia ol floor-desert --generate --seed fx-42 # procedural generation
|
|
209
|
+
cyberia ol hatchet --to-atlas-sprite-sheet # build atlas sprite sheet
|
|
210
|
+
cyberia ol --drop --client-public # drop data + static asset folders
|
|
211
|
+
|
|
212
|
+
# Instance data
|
|
213
|
+
cyberia instance FOREST --export ./backup
|
|
214
|
+
cyberia instance FOREST --import ./backup
|
|
215
|
+
cyberia instance FOREST --drop
|
|
216
|
+
|
|
217
|
+
# Presentation hints
|
|
218
|
+
cyberia client-hints cyberia-main --seed-defaults
|
|
219
|
+
|
|
220
|
+
# Chain / token lifecycle
|
|
221
|
+
cyberia chain deploy --chain-id 777771
|
|
222
|
+
cyberia chain status
|
|
223
|
+
cyberia chain register / mint / transfer / burn / pause / unpause
|
|
224
|
+
|
|
225
|
+
# Named workflows
|
|
226
|
+
cyberia run-workflow import-default-items
|
|
227
|
+
cyberia run-workflow seed-skill-config --instance-code default
|
|
228
|
+
cyberia run-workflow seed-dialogues
|
|
229
|
+
cyberia run-workflow build-manifest
|
|
230
|
+
cyberia run-workflow build-server-dashboard
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Run the MMO services
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# engine-cyberia (Node.js data/content services)
|
|
237
|
+
npm start # node src/server
|
|
238
|
+
|
|
239
|
+
# cyberia-server (Go authoritative simulation)
|
|
240
|
+
cd cyberia-server && go run main.go # dev
|
|
241
|
+
cd cyberia-server && go build -o cyberia-server . && ./cyberia-server
|
|
242
|
+
|
|
243
|
+
# cyberia-client (C / WASM presentation)
|
|
244
|
+
cd cyberia-client && make -f Web.mk clean && make -f Web.mk web
|
|
245
|
+
cd cyberia-client && make -f Web.mk serve-development # serves on :8082
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Operational guardrails
|
|
251
|
+
|
|
252
|
+
- Prefer one source of truth for config, deploy IDs, runtime selection, startup behavior, and generated assets.
|
|
253
|
+
- Reuse existing helpers and conventions instead of creating parallel implementations.
|
|
254
|
+
- Do not duplicate parsing, env resolution, or path normalization logic across modules.
|
|
255
|
+
- Treat generated artifacts (`sw.js`, static pages, atlases, README, manifests) as outputs only.
|
|
256
|
+
- Host-level changes must be idempotent, reversible, and explicit; validate before mutating; keep
|
|
257
|
+
orchestration scripts safe to rerun.
|
|
258
|
+
- `engine-private/` is a private external dependency. Reference it only as private input; never assume
|
|
259
|
+
its contents exist locally.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **Status:** Alpha (sinks disabled by default; all values reset on reconnect).
|
|
6
6
|
> **On-chain bridge:** CKY ERC-1155 token (ID 0) on Hyperledger Besu.
|
|
7
|
-
>
|
|
7
|
+
> The bridge protocol stays aligned with the project's CKY tokenomics model.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -61,7 +61,7 @@ Cyberia Online uses the **Fountain & Sink** economy — the industry standard fo
|
|
|
61
61
|
|
|
62
62
|
Economy parameters live in `CyberiaInstanceConf.economyRules`. A document without an `economyRules` sub-document receives canonical defaults automatically.
|
|
63
63
|
|
|
64
|
-
### 2.1 JavaScript Defaults (`cyberia-
|
|
64
|
+
### 2.1 JavaScript Defaults (`cyberia-server-defaults.js`)
|
|
65
65
|
|
|
66
66
|
```javascript
|
|
67
67
|
economyRules: {
|
|
@@ -10,7 +10,7 @@ The Quest System is a **chain/tree-structured progression framework** linking NP
|
|
|
10
10
|
|
|
11
11
|
Quests are defined server-side as MongoDB documents and delivered to the client through the Engine REST API. Progress is tracked per-player in `CyberiaQuestProgress` documents.
|
|
12
12
|
|
|
13
|
-
> **Implementation status —
|
|
13
|
+
> **Implementation status — Alpha (talk objectives):** The Quest and QuestProgress MongoDB schemas and Engine REST API (`src/api/cyberia-quest`, `src/api/cyberia-quest-progress`) are defined and seeded. The Go server fetches quest definitions at instance init and now evaluates `talk` objectives, grants quests, advances steps, and delivers rewards via FCT on completion (driven by `dlg_complete` — see ACTION-SYSTEM.md). `collect` and `kill` objective evaluation remains planned for a later Alpha increment. Quest progress is authoritative **per Go session** (in-memory) and best-effort mirrored to `POST /api/cyberia-quest-progress`; it resets on reconnect. The C client surfaces it through the **Quest Journal** (see below).
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -168,6 +168,28 @@ On quest completion, the Engine grants each `rewards[].{itemId, quantity}` to th
|
|
|
168
168
|
|
|
169
169
|
---
|
|
170
170
|
|
|
171
|
+
## Quest Journal (client)
|
|
172
|
+
|
|
173
|
+
The C client keeps a local `quest_store` (in `cyberia-client/src/ui/quest_store.c`)
|
|
174
|
+
populated from two server sources — **no extra REST calls**:
|
|
175
|
+
|
|
176
|
+
- `init_data.quests[]` — the player's active/completed snapshot on connect.
|
|
177
|
+
- `dlg_ack.quests[]` — live upserts as quests are granted or completed.
|
|
178
|
+
|
|
179
|
+
The **Quest Journal** modal (`ui/quest_journal.c`) renders this store on the
|
|
180
|
+
right side below the map info modal: a three-section tree (Active / Completed /
|
|
181
|
+
Failed), each section independently collapsible via the shared `ui_toggle`
|
|
182
|
+
component, each with its own 10-per-page pagination cursor. The interaction
|
|
183
|
+
bubble column on the left is collapsible by the same toggle pattern. Both panels
|
|
184
|
+
default collapsed on screens narrower than 600 px. Collapse state is not
|
|
185
|
+
persisted across sessions.
|
|
186
|
+
|
|
187
|
+
Each server quest snapshot entry carries `{ code, title, description, status,
|
|
188
|
+
activeStep, objectivesText }` so the journal can render rows and inline detail
|
|
189
|
+
without re-fetching the quest definition.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
171
193
|
## Indexes
|
|
172
194
|
|
|
173
195
|
```javascript
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Underpost Platform
|
|
2
|
+
|
|
3
|
+
Underpost Platform is the base product. It owns the toolchain, deployment surface, PWA delivery, and operational infrastructure. Cyberia is an MMO extension that runs on top of it; Cyberia is not the platform.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Toolchain and base infrastructure
|
|
8
|
+
|
|
9
|
+
Underpost Platform covers the shared delivery surface for applications and extensions:
|
|
10
|
+
|
|
11
|
+
| Area | What it owns |
|
|
12
|
+
| --------------- | ------------------------------------------------------------------------------------ |
|
|
13
|
+
| Toolchain | `underpost` CLI, build, deploy, release, metadata, secrets, environment selection |
|
|
14
|
+
| Infrastructure | bare metal, LXD, Kubernetes, K3s, kubeadm, images, SSH, runners |
|
|
15
|
+
| Data operations | MongoDB, MariaDB where needed, backups, cron, monitoring |
|
|
16
|
+
| Delivery | static build, SSR views, PWA packaging, service worker generation, host/path routing |
|
|
17
|
+
|
|
18
|
+
The platform is the operational backbone. It should stay the source of truth for deploy IDs, runtime selection, host/path layout, generated client assets, and environment resolution.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Underpost CLI
|
|
23
|
+
|
|
24
|
+
`underpost` is the shared control surface for platform operations. Top-level commands (`underpost <cmd> --help` for options):
|
|
25
|
+
|
|
26
|
+
| Group | Command | Purpose |
|
|
27
|
+
| ------------------ | ----------- | ------------------------------------------------------------- |
|
|
28
|
+
| **Project / repo** | `new` | Initialize a new project, service, or configuration |
|
|
29
|
+
| | `clone` | Clone a GitHub repository into the current directory |
|
|
30
|
+
| | `pull` | Pull latest changes from a repository |
|
|
31
|
+
| | `cmt` | Manage commits (commit types and options) |
|
|
32
|
+
| | `push` | Push committed changes to a remote repository |
|
|
33
|
+
| | `install` | Import Underpost npm dependencies by copying |
|
|
34
|
+
| | `root` | Print the npm installation root path |
|
|
35
|
+
| **Build / config** | `client` | Build client assets / single replicas; sync environment ports |
|
|
36
|
+
| | `static` | Static build of pages, bundles, and documentation |
|
|
37
|
+
| | `env` | Set env vars and config for a deploy ID |
|
|
38
|
+
| | `config` | Manage Underpost configuration via operators |
|
|
39
|
+
| | `metadata` | Import/export cluster metadata |
|
|
40
|
+
| **Deploy / infra** | `cluster` | Manage Kubernetes clusters (defaults to Kind init) |
|
|
41
|
+
| | `deploy` | Manage deployments (defaults to development pods) |
|
|
42
|
+
| | `image` | Build, save, and load Docker images into clusters |
|
|
43
|
+
| | `secret` | Manage secrets across platforms |
|
|
44
|
+
| | `lxd` | Manage LXD VMs as K3s nodes (control plane / workers) |
|
|
45
|
+
| | `baremetal` | Bare-metal provisioning workflows |
|
|
46
|
+
| | `ip` | Show current public machine IP addresses |
|
|
47
|
+
| **Data / ops** | `db` | Database backup / restore and related operations |
|
|
48
|
+
| | `cron` | Run cron jobs or generate/apply K8s CronJob manifests |
|
|
49
|
+
| | `fs` | File storage (defaults to upload) |
|
|
50
|
+
| | `monitor` | Health-server monitoring for deployments |
|
|
51
|
+
| | `ssh` | Manage SSH credentials and sessions for cluster nodes |
|
|
52
|
+
| | `run` | Run scripts via named runners |
|
|
53
|
+
| | `test` | Run the test suites |
|
|
54
|
+
| | `release` | Release orchestrator for building and shipping CLI versions |
|
|
55
|
+
|
|
56
|
+
Cyberia-specific operations belong in `cyberia`, not in parallel platform commands. Use the base CLI for infrastructure and delivery, then layer Cyberia workflows on top.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## PWA delivery model
|
|
61
|
+
|
|
62
|
+
Every deployed client is delivered as a static application shell with PWA support.
|
|
63
|
+
|
|
64
|
+
- SSR views declare which pages exist and which fallbacks are precached.
|
|
65
|
+
- The service worker is generated from the configured view set.
|
|
66
|
+
- Offline and maintenance fallbacks are part of the build output, not hand-maintained runtime artifacts.
|
|
67
|
+
- Generated outputs such as `sw.js`, static pages, and compiled bundles are outputs only; never edit them by hand.
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
conf.dd-*.js / conf.ssr.json + src/client/sw/core.sw.js
|
|
71
|
+
│
|
|
72
|
+
└──── underpost client / build ────▶ generated index.html + sw.js + precache
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Keep those two inputs as the only authored PWA sources.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Cyberia on top of the platform
|
|
80
|
+
|
|
81
|
+
Cyberia adds a three-service MMO runtime on top of the base platform:
|
|
82
|
+
|
|
83
|
+
| Service | Responsibility |
|
|
84
|
+
| ---------------- | ------------------------------------------------------------------------- |
|
|
85
|
+
| `engine-cyberia` | content, validation, persistence, gRPC/REST data services, asset metadata |
|
|
86
|
+
| `cyberia-server` | authoritative simulation and tick processing |
|
|
87
|
+
| `cyberia-client` | rendering, input, prediction, presentation |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Operational rules
|
|
92
|
+
|
|
93
|
+
- Prefer one source of truth for config, deploy IDs, runtime selection, startup behavior, and generated assets.
|
|
94
|
+
- Reuse existing helpers and conventions instead of creating parallel implementations.
|
|
95
|
+
- Do not duplicate parsing, env resolution, or path normalization logic across modules.
|
|
96
|
+
- Treat generated artifacts as outputs only; never hand-edit them.
|
|
97
|
+
- `engine-private/` is a private external dependency. Reference it as private input only and never assume its contents exist locally.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Safety and orchestration
|
|
102
|
+
|
|
103
|
+
- Any host-level change must be idempotent, reversible, and explicit.
|
|
104
|
+
- Never assume mounts, users, groups, namespaces, or volumes already exist.
|
|
105
|
+
- Validate before mutating: check paths, permissions, ownership, and target state first.
|
|
106
|
+
- Keep orchestration scripts resilient to interruption and safe to rerun.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Auth } from '../../components/core/Auth.js';
|
|
2
|
+
import { loggerFactory } from '../../components/core/Logger.js';
|
|
3
|
+
import { getApiBaseUrl, headersFactory, payloadFactory, buildQueryUrl } from '../core/core.service.js';
|
|
4
|
+
const logger = loggerFactory(import.meta);
|
|
5
|
+
logger.info('Load service');
|
|
6
|
+
const endpoint = 'cyberia-client-hints';
|
|
7
|
+
class CyberiaClientHintsService {
|
|
8
|
+
static post = (options = { id: '', body: {} }) =>
|
|
9
|
+
new Promise((resolve, reject) =>
|
|
10
|
+
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
11
|
+
method: 'POST',
|
|
12
|
+
headers: headersFactory(),
|
|
13
|
+
credentials: 'include',
|
|
14
|
+
body: payloadFactory(options.body),
|
|
15
|
+
})
|
|
16
|
+
.then(async (res) => {
|
|
17
|
+
return await res.json();
|
|
18
|
+
})
|
|
19
|
+
.then((res) => {
|
|
20
|
+
logger.info(res);
|
|
21
|
+
return resolve(res);
|
|
22
|
+
})
|
|
23
|
+
.catch((error) => {
|
|
24
|
+
logger.error(error);
|
|
25
|
+
return reject(error);
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
28
|
+
static put = (options = { id: '', body: {} }) =>
|
|
29
|
+
new Promise((resolve, reject) =>
|
|
30
|
+
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
31
|
+
method: 'PUT',
|
|
32
|
+
headers: headersFactory(),
|
|
33
|
+
credentials: 'include',
|
|
34
|
+
body: payloadFactory(options.body),
|
|
35
|
+
})
|
|
36
|
+
.then(async (res) => {
|
|
37
|
+
return await res.json();
|
|
38
|
+
})
|
|
39
|
+
.then((res) => {
|
|
40
|
+
logger.info(res);
|
|
41
|
+
return resolve(res);
|
|
42
|
+
})
|
|
43
|
+
.catch((error) => {
|
|
44
|
+
logger.error(error);
|
|
45
|
+
return reject(error);
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
static get = (options = {}) => {
|
|
49
|
+
const { id, page, limit, filterModel, sortModel, sort, asc, order } = options;
|
|
50
|
+
const url = buildQueryUrl(getApiBaseUrl({ id, endpoint }), {
|
|
51
|
+
page,
|
|
52
|
+
limit,
|
|
53
|
+
filterModel,
|
|
54
|
+
sortModel,
|
|
55
|
+
sort,
|
|
56
|
+
asc,
|
|
57
|
+
order,
|
|
58
|
+
});
|
|
59
|
+
return new Promise((resolve, reject) =>
|
|
60
|
+
fetch(url.toString(), {
|
|
61
|
+
method: 'GET',
|
|
62
|
+
headers: headersFactory(),
|
|
63
|
+
credentials: 'include',
|
|
64
|
+
})
|
|
65
|
+
.then(async (res) => {
|
|
66
|
+
return await res.json();
|
|
67
|
+
})
|
|
68
|
+
.then((res) => {
|
|
69
|
+
logger.info(res);
|
|
70
|
+
return resolve(res);
|
|
71
|
+
})
|
|
72
|
+
.catch((error) => {
|
|
73
|
+
logger.error(error);
|
|
74
|
+
return reject(error);
|
|
75
|
+
}),
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
static delete = (options = { id: '', body: {} }) =>
|
|
79
|
+
new Promise((resolve, reject) =>
|
|
80
|
+
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
81
|
+
method: 'DELETE',
|
|
82
|
+
headers: headersFactory(),
|
|
83
|
+
credentials: 'include',
|
|
84
|
+
body: payloadFactory(options.body),
|
|
85
|
+
})
|
|
86
|
+
.then(async (res) => {
|
|
87
|
+
return await res.json();
|
|
88
|
+
})
|
|
89
|
+
.then((res) => {
|
|
90
|
+
logger.info(res);
|
|
91
|
+
return resolve(res);
|
|
92
|
+
})
|
|
93
|
+
.catch((error) => {
|
|
94
|
+
logger.error(error);
|
|
95
|
+
return reject(error);
|
|
96
|
+
}),
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
export { CyberiaClientHintsService };
|