@underpostnet/cyberia 3.3.73 → 3.3.77

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 (269) hide show
  1. package/.env.example +17 -5
  2. package/.github/workflows/coverall.cyberia.ci.yml +10 -0
  3. package/.github/workflows/docker-image.cyberia-client.ci.yml +1 -1
  4. package/.github/workflows/docker-image.cyberia-client.dev.ci.yml +1 -1
  5. package/.github/workflows/docker-image.cyberia-server.ci.yml +1 -1
  6. package/.github/workflows/docker-image.cyberia-server.dev.ci.yml +1 -1
  7. package/.github/workflows/docker-image.engine-cyberia.ci.yml +1 -1
  8. package/.github/workflows/docker-image.engine-cyberia.dev.ci.yml +1 -1
  9. package/.github/workflows/engine-cyberia.ci.yml +1 -1
  10. package/.github/workflows/publish.cyberia.ci.yml +44 -0
  11. package/AGENTS.md +61 -12
  12. package/CHANGELOG.md +159 -161
  13. package/CLI-HELP.md +20 -13
  14. package/Dockerfile +1 -1
  15. package/Dockerfile.dev +1 -1
  16. package/Dockerfile.test +2 -2
  17. package/README.md +28 -28
  18. package/bin/build.js +96 -21
  19. package/bin/cyberia.js +1247 -1373
  20. package/bin/index.js +1247 -1373
  21. package/compose.env +17 -5
  22. package/conf.js +7 -4
  23. package/deploy/cyberia-client/deploy.sh +10 -11
  24. package/deploy/cyberia-client/package.sh +0 -1
  25. package/deploy/cyberia-client/state.sh +3 -2
  26. package/deploy/cyberia-server/deploy.sh +10 -11
  27. package/deploy/cyberia-server/package.sh +0 -1
  28. package/deploy/cyberia-server/state.sh +3 -2
  29. package/deploy/dd-cyberia/deploy.sh +5 -5
  30. package/deploy/dd-cyberia/init.sh +15 -14
  31. package/deploy/dd-cyberia/package.sh +0 -1
  32. package/deploy/dd-cyberia/state.sh +2 -2
  33. package/deploy/dd-cyberia/sync-deploy.sh +139 -75
  34. package/deploy/lib/config.sh +29 -0
  35. package/deploy/lib/github-actions-logging.sh +92 -76
  36. package/deploy/lib/host.sh +28 -19
  37. package/deploy/lib/state.sh +4 -1
  38. package/deploy/pwa-microservices-template/deploy.sh +10 -8
  39. package/deploy/release/deploy.sh +0 -2
  40. package/deployment.yaml +1 -1
  41. package/docker-compose.yml +23 -17
  42. package/docs/coverage/cyberia/api/cyberia-instance/cyberia-fallback-capture.js.html +1591 -0
  43. package/docs/coverage/cyberia/api/cyberia-instance/index.html +116 -0
  44. package/docs/coverage/cyberia/api/cyberia-server-defaults/cyberia-server-defaults.js.html +4138 -0
  45. package/docs/coverage/cyberia/api/cyberia-server-defaults/index.html +116 -0
  46. package/docs/coverage/cyberia/api/object-layer/index.html +116 -0
  47. package/docs/coverage/cyberia/api/object-layer/object-layer.model.js.html +1393 -0
  48. package/docs/coverage/cyberia/base.css +362 -0
  49. package/docs/coverage/cyberia/block-navigation.js +82 -0
  50. package/docs/coverage/cyberia/favicon.png +0 -0
  51. package/docs/coverage/cyberia/index.html +161 -0
  52. package/docs/coverage/cyberia/prettify.css +101 -0
  53. package/docs/coverage/cyberia/prettify.js +937 -0
  54. package/docs/coverage/cyberia/projects/cyberia/atlas-sprite-sheet-generator.js.html +1315 -0
  55. package/docs/coverage/cyberia/projects/cyberia/index.html +176 -0
  56. package/docs/coverage/cyberia/projects/cyberia/instance-backup.js.html +715 -0
  57. package/docs/coverage/cyberia/projects/cyberia/instance-data.js.html +2182 -0
  58. package/docs/coverage/cyberia/projects/cyberia/shape-generator.js.html +3265 -0
  59. package/docs/coverage/cyberia/projects/cyberia/stat-balance.js.html +328 -0
  60. package/docs/coverage/cyberia/sort-arrow-sprite.png +0 -0
  61. package/docs/coverage/cyberia/sorter.js +205 -0
  62. package/hardhat/package-lock.json +2 -2
  63. package/hardhat/package.json +1 -1
  64. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
  65. package/manifests/cronjobs/dd-cron/dd-cron-vultr.yaml +1 -1
  66. package/manifests/deployment/dd-cyberia-development/deployment.yaml +1 -1
  67. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  68. package/manifests/deployment/mongo-express/deployment.yaml +46 -27
  69. package/manifests/deployment/mongo-express/kustomization.yaml +9 -0
  70. package/manifests/deployment/mongo-express/mongo-express-nodeport.yaml +18 -0
  71. package/manifests/deployment/mongo-express/service.yaml +16 -0
  72. package/manifests/deployment/mongo-express-no-auth/disable-mongodb-auth.yaml +16 -0
  73. package/manifests/deployment/mongo-express-no-auth/kustomization.yaml +16 -0
  74. package/package.json +19 -17
  75. package/scripts/test-monitor.sh +3 -3
  76. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.controller.js +14 -9
  77. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.model.js +36 -5
  78. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.router.js +5 -0
  79. package/src/api/atlas-sprite-sheet/atlas-sprite-sheet.service.js +88 -184
  80. package/src/api/cyberia-action/cyberia-action.router.js +2 -2
  81. package/src/api/cyberia-action/cyberia-action.service.js +3 -4
  82. package/src/api/cyberia-audio/cyberia-audio.controller.js +6 -0
  83. package/src/api/cyberia-audio/cyberia-audio.model.js +61 -0
  84. package/src/api/cyberia-audio/cyberia-audio.router.js +21 -0
  85. package/src/api/cyberia-audio/cyberia-audio.service.js +220 -0
  86. package/src/api/cyberia-client-hints/cyberia-client-hints.controller.js +1 -3
  87. package/src/api/cyberia-client-hints/cyberia-client-hints.model.js +10 -19
  88. package/src/api/cyberia-client-hints/cyberia-client-hints.router.js +12 -34
  89. package/src/api/cyberia-client-hints/cyberia-client-hints.service.js +15 -32
  90. package/src/api/cyberia-dialogue/cyberia-dialogue.model.js +1 -1
  91. package/src/api/cyberia-dialogue/cyberia-dialogue.router.js +1 -1
  92. package/src/api/cyberia-entity/cyberia-entity.model.js +2 -0
  93. package/src/api/cyberia-entity/cyberia-entity.service.js +1 -1
  94. package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.controller.js +8 -2
  95. package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.model.js +31 -20
  96. package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.router.js +16 -1
  97. package/src/api/cyberia-entity-type-default/cyberia-entity-type-default.service.js +466 -3
  98. package/src/api/cyberia-instance/cyberia-fallback-capture.js +87 -51
  99. package/src/api/cyberia-instance/cyberia-fallback-world.js +21 -40
  100. package/src/api/cyberia-instance/cyberia-instance-boot.service.js +5 -5
  101. package/src/api/cyberia-instance/cyberia-instance-items.js +98 -0
  102. package/src/api/cyberia-instance/cyberia-instance-map.service.js +34 -141
  103. package/src/api/cyberia-instance/cyberia-instance.controller.js +1 -4
  104. package/src/api/cyberia-instance/cyberia-instance.model.js +0 -14
  105. package/src/api/cyberia-instance/cyberia-instance.router.js +3 -16
  106. package/src/api/cyberia-instance/cyberia-instance.service.js +3 -43
  107. package/src/api/cyberia-instance/cyberia-world-generator.js +8 -13
  108. package/src/api/cyberia-instance-conf/cyberia-instance-conf.model.js +49 -75
  109. package/src/api/cyberia-instance-conf/cyberia-instance-conf.service.js +74 -1
  110. package/src/api/cyberia-map/cyberia-map.service.js +6 -2
  111. package/src/api/cyberia-map-audio-conf/cyberia-map-audio-conf.controller.js +31 -0
  112. package/src/api/cyberia-map-audio-conf/cyberia-map-audio-conf.model.js +56 -0
  113. package/src/api/cyberia-map-audio-conf/cyberia-map-audio-conf.router.js +33 -0
  114. package/src/api/cyberia-map-audio-conf/cyberia-map-audio-conf.service.js +189 -0
  115. package/src/api/cyberia-quest/cyberia-quest.router.js +3 -3
  116. package/src/api/cyberia-quest/cyberia-quest.service.js +3 -3
  117. package/src/api/cyberia-quest-progress/cyberia-quest-progress.model.js +1 -1
  118. package/src/api/cyberia-server-defaults/cyberia-server-defaults.js +403 -188
  119. package/src/api/cyberia-skill/cyberia-skill.model.js +6 -6
  120. package/src/api/file/file.ref.js +153 -0
  121. package/src/api/file/file.ref.json +11 -2
  122. package/src/api/object-layer/object-layer.model.js +47 -12
  123. package/src/api/object-layer/object-layer.router.js +10 -3
  124. package/src/api/object-layer/object-layer.service.js +113 -120
  125. package/src/cli/app.js +12 -1
  126. package/src/cli/client.js +2 -2
  127. package/src/cli/cluster.js +80 -18
  128. package/src/cli/deploy.js +215 -34
  129. package/src/cli/docker-compose.js +1 -1
  130. package/src/cli/fs-selection.js +115 -0
  131. package/src/cli/fs.js +158 -342
  132. package/src/cli/index.js +22 -10
  133. package/src/cli/release.js +3 -1
  134. package/src/cli/repository.js +35 -9
  135. package/src/cli/run.js +80 -199
  136. package/src/cli/test.js +4 -0
  137. package/src/cli/wireguard.js +32 -31
  138. package/src/client/components/core/Badge.js +0 -1
  139. package/src/client/components/core/CssCore.js +8 -1
  140. package/src/client/components/core/Docs.js +77 -100
  141. package/src/client/components/core/Modal.js +77 -23
  142. package/src/client/components/core/ToolTip.js +15 -0
  143. package/src/client/components/cryptokoyn/AppShellCryptokoyn.js +0 -2
  144. package/src/client/components/cyberia/ActionEngineCyberia.js +12 -36
  145. package/src/client/components/cyberia/EntityEngineCyberia.js +492 -121
  146. package/src/client/components/cyberia/InstanceEngineCyberia.js +129 -160
  147. package/src/client/components/cyberia/InstanceSelectionView.js +7 -1
  148. package/src/client/components/cyberia/MapEngineCyberia.js +175 -69
  149. package/src/client/components/cyberia/ObjectLayerEngine.js +1011 -97
  150. package/src/client/components/cyberia/ObjectLayerEngineModal.js +81 -155
  151. package/src/client/components/cyberia/ObjectLayerEngineViewer.js +113 -98
  152. package/src/client/components/cyberia/SharedDefaultsCyberia.js +215 -56
  153. package/src/client/components/cyberia-portal/AppShellCyberiaPortal.js +0 -34
  154. package/src/client/components/cyberia-portal/CssCyberiaPortal.js +1 -1
  155. package/src/client/components/cyberia-portal/MainBodyCyberiaPortal.js +712 -76
  156. package/src/client/components/cyberia-portal/RouterCyberiaPortal.js +0 -4
  157. package/src/client/components/cyberia-portal/TranslateCyberiaPortal.js +0 -4
  158. package/src/client/components/default/AppShellDefault.js +1 -4
  159. package/src/client/components/itemledger/AppShellItemledger.js +0 -2
  160. package/src/client/components/underpost/AppShellUnderpost.js +1 -1
  161. package/src/client/public/cyberia-docs/ARCHITECTURE.md +15 -15
  162. package/src/client/public/cyberia-docs/CYBERIA-CLI.md +280 -24
  163. package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +51 -29
  164. package/src/client/public/cyberia-docs/CYBERIA-SAGA.md +52 -53
  165. package/src/client/public/cyberia-docs/CYBERIA-SERVER.md +16 -11
  166. package/src/client/public/cyberia-docs/CYBERIA.md +28 -28
  167. package/src/client/public/cyberia-docs/ENTITY-PROFILE.md +11 -5
  168. package/src/client/public/cyberia-docs/ROADMAP.md +1 -1
  169. package/src/client/public/cyberia-docs/STATS-PROGRESSION.md +217 -0
  170. package/src/client/public/cyberia-docs/WHITE-PAPER.md +20 -12
  171. package/src/client/services/cyberia-audio/cyberia-audio.service.js +99 -0
  172. package/src/client/services/cyberia-entity-type-default/cyberia-entity-type-default.service.js +38 -0
  173. package/src/client/services/cyberia-instance/cyberia-instance.management.js +5 -4
  174. package/src/client/services/cyberia-instance/cyberia-instance.service.js +0 -40
  175. package/src/client/services/cyberia-map/cyberia-map.management.js +5 -4
  176. package/src/client/services/cyberia-map-audio-conf/cyberia-map-audio-conf.service.js +138 -0
  177. package/src/client/services/object-layer/object-layer.management.js +6 -10
  178. package/src/client/services/object-layer/object-layer.service.js +3 -1
  179. package/src/client/ssr/views/Cyberia404.js +3 -3
  180. package/src/client-builder/client-build-docs.js +52 -52
  181. package/src/client-builder/client-build.js +67 -44
  182. package/src/client-builder/client-bundle.js +347 -0
  183. package/src/db/mongo/MongoExpress.js +187 -0
  184. package/src/grpc/cyberia/grpc-server.js +5 -7
  185. package/src/index.js +1 -1
  186. package/src/projects/cyberia/atlas-sprite-sheet-generator.js +143 -146
  187. package/src/projects/cyberia/atlas-sprite-sheet-store.js +391 -0
  188. package/src/projects/cyberia/besu-genesis-generator.js +5 -14
  189. package/src/projects/cyberia/boot-contract-fixtures.js +32 -0
  190. package/src/projects/cyberia/catalog-cyberia.js +3 -2
  191. package/src/projects/cyberia/gemini-client.js +3 -3
  192. package/src/projects/cyberia/generate-saga.js +4 -11
  193. package/src/projects/cyberia/hot-reload-trigger.js +17 -28
  194. package/src/projects/cyberia/instance-backup.js +210 -0
  195. package/src/projects/cyberia/instance-data.js +177 -257
  196. package/src/projects/cyberia/map-preview-generator.js +32 -68
  197. package/src/projects/cyberia/object-layer.js +152 -319
  198. package/src/projects/cyberia/seed-audio.js +139 -0
  199. package/src/projects/cyberia/semantic-layer-generator-skin.js +2 -8
  200. package/src/projects/cyberia/semantic-layer-generator.js +2 -18
  201. package/src/projects/cyberia/stat-balance.js +81 -0
  202. package/src/projects/cyberia/stat-commands.js +23 -0
  203. package/src/projects/cyberia/stat-contract-generator.js +101 -0
  204. package/src/runtime/cyberia-client/Dockerfile +8 -4
  205. package/src/runtime/cyberia-client/Dockerfile.dev +5 -2
  206. package/src/runtime/cyberia-server/Dockerfile +9 -2
  207. package/src/runtime/cyberia-server/Dockerfile.dev +8 -1
  208. package/src/runtime/engine-cyberia/Dockerfile +1 -1
  209. package/src/runtime/engine-cyberia/Dockerfile.dev +1 -1
  210. package/src/runtime/engine-cyberia/Dockerfile.test +2 -2
  211. package/src/runtime/engine-cyberia/compose.env +17 -5
  212. package/src/runtime/engine-cyberia/docker-compose.yml +23 -17
  213. package/src/server/build/coverage.js +113 -42
  214. package/src/server/build/package.js +55 -12
  215. package/src/server/build/testing.js +59 -9
  216. package/src/server/network/middlewares.js +8 -2
  217. package/src/server/network/underpost-gateway.js +113 -14
  218. package/src/server/ops/logger.js +70 -35
  219. package/src/server/runtime/conf.js +40 -9
  220. package/src/server/runtime/start.js +11 -2
  221. package/src/server/storage/data-query.js +16 -0
  222. package/src/server/storage/downloader.js +62 -14
  223. package/src/server/storage/zip.js +153 -0
  224. package/test/integration/app/cyberia/atlas-sprite-sheet-store.test.js +402 -0
  225. package/test/integration/app/cyberia/atlas-sprite-sheet.test.js +86 -0
  226. package/test/integration/app/cyberia/cyberia-cli-plain-reads.test.js +34 -0
  227. package/test/integration/app/cyberia/cyberia-entity-type-default.test.js +842 -0
  228. package/test/integration/app/cyberia/cyberia-instance-conf-coerce.test.js +53 -0
  229. package/test/integration/app/cyberia/cyberia-instance-conf-defaults.test.js +16 -22
  230. package/test/integration/app/cyberia/cyberia-instance-items.test.js +90 -0
  231. package/test/integration/app/cyberia/cyberia-load.test.js +6 -7
  232. package/test/integration/app/cyberia/cyberia-map-audio-conf.test.js +256 -0
  233. package/test/integration/app/cyberia/cyberia-stats.test.js +150 -0
  234. package/test/integration/app/cyberia/fallback-world-capture.test.js +87 -2
  235. package/test/integration/app/cyberia/object-layer-item-selection.test.js +56 -0
  236. package/test/integration/app/cyberia/object-layer-natural-key.test.js +32 -0
  237. package/test/integration/app/cyberia/seed-audio.test.js +275 -0
  238. package/test/integration/infra/2-network/wireguard-cli.test.js +33 -9
  239. package/test/integration/infra/2-network/wireguard-edge.test.js +58 -18
  240. package/test/integration/infra/3-cluster/mongo-express-deploy.test.js +156 -0
  241. package/test/integration/infra/4-ingress/api-cross-origin.test.js +79 -0
  242. package/test/integration/infra/4-ingress/underpost-ingress.test.js +1 -1
  243. package/test/unit/catalog.test.js +13 -2
  244. package/test/unit/client-build-docs.test.js +97 -70
  245. package/test/unit/client-bundle.test.js +313 -0
  246. package/test/unit/conf-resolution.test.js +58 -7
  247. package/test/unit/coverage-artifact.test.js +120 -29
  248. package/test/unit/cyberia/instance-backup.test.js +183 -0
  249. package/test/unit/cyberia/instance-data.test.js +314 -0
  250. package/test/unit/cyberia/instance-object-layer-items.test.js +46 -0
  251. package/test/unit/cyberia/publish-workflow.test.js +22 -0
  252. package/test/unit/cyberia/stat-balance.test.js +69 -0
  253. package/test/unit/deploy-legacy-gateway-sweep.test.js +63 -0
  254. package/test/unit/deploy-log-table.test.js +76 -5
  255. package/test/unit/downloader-integrity.test.js +98 -0
  256. package/test/unit/file-reference-registry.test.js +141 -0
  257. package/test/unit/fs-storage-paths.test.js +596 -0
  258. package/test/unit/gateway-pod-fetch.test.js +95 -0
  259. package/test/unit/letsencrypt-issuer.test.js +101 -0
  260. package/test/unit/logger-redaction.test.js +29 -0
  261. package/test/unit/package.test.js +70 -16
  262. package/test/unit/prepare-host.test.js +84 -1
  263. package/test/unit/release-bump.test.js +3 -1
  264. package/test/unit/start-options.test.js +12 -0
  265. package/test/unit/test-tiers.test.js +27 -0
  266. package/test/unit/zip-archive.test.js +142 -0
  267. package/vitest.config.js +11 -3
  268. package/src/api/cyberia-instance/cyberia-fallback-default-items.js +0 -63
  269. package/src/client/components/cyberia/FallbackWorldEngineCyberia.js +0 -368
@@ -0,0 +1,142 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @module zip-archive.test
5
+ * @description Covers the JSZip-backed archive helpers shared by the file-storage CLI and the
6
+ * client builder: local-file archiving, full and single-entry extraction, entry lookup by
7
+ * basename, and the guard that keeps an archive path from escaping the extraction root.
8
+ *
9
+ * Uses 'chai' for assertions.
10
+ */
11
+
12
+ import { expect } from 'chai';
13
+ import fs from 'fs-extra';
14
+ import JSZip from 'jszip';
15
+ import * as dir from 'path';
16
+ import {
17
+ extractZipEntryTo,
18
+ extractZipTo,
19
+ findZipEntry,
20
+ isZipBuffer,
21
+ loadZip,
22
+ readZipEntry,
23
+ zipFromLocalFiles,
24
+ } from '../../src/server/storage/zip.js';
25
+
26
+ describe('zip archive helpers', () => {
27
+ let fixturePath;
28
+
29
+ beforeEach(() => {
30
+ fixturePath = fs.mkdtempSync('/tmp/engine-zip-archive-');
31
+ fs.mkdirSync(`${fixturePath}/src/nested`, { recursive: true });
32
+ fs.writeFileSync(`${fixturePath}/src/index.html`, '<h1>index</h1>'.repeat(200), 'utf8');
33
+ fs.writeFileSync(`${fixturePath}/src/nested/app.js`, 'console.log(1);'.repeat(200), 'utf8');
34
+ fs.writeFileSync(`${fixturePath}/src/run.sh`, '#!/bin/sh\necho run\n', 'utf8');
35
+ fs.chmodSync(`${fixturePath}/src/run.sh`, 0o755);
36
+ });
37
+
38
+ afterEach(() => {
39
+ fs.removeSync(fixturePath);
40
+ });
41
+
42
+ const buildFixtureArchive = () =>
43
+ zipFromLocalFiles([
44
+ { localPath: `${fixturePath}/src/index.html`, entryName: 'index.html' },
45
+ { localPath: `${fixturePath}/src/nested/app.js`, entryName: 'nested/app.js' },
46
+ { localPath: `${fixturePath}/src/run.sh`, entryName: 'run.sh' },
47
+ ]);
48
+
49
+ it('writes a deflated archive that keeps the requested entry names', async () => {
50
+ const archive = await buildFixtureArchive();
51
+ const rawBytes = ['src/index.html', 'src/nested/app.js', 'src/run.sh'].reduce(
52
+ (total, relativePath) => total + fs.statSync(`${fixturePath}/${relativePath}`).size,
53
+ 0,
54
+ );
55
+
56
+ expect(isZipBuffer(archive)).to.equal(true);
57
+ expect(archive.length).to.be.below(rawBytes);
58
+ const entries = Object.values((await loadZip(archive)).files);
59
+ expect(entries.filter((entry) => entry.dir).map((entry) => entry.name)).to.deep.equal(['nested/']);
60
+ expect(
61
+ entries
62
+ .filter((entry) => !entry.dir)
63
+ .map((entry) => entry.name)
64
+ .sort(),
65
+ ).to.deep.equal(['index.html', 'nested/app.js', 'run.sh']);
66
+ });
67
+
68
+ it('round-trips an archive through extraction, preserving content and executable bits', async () => {
69
+ const outputPath = `${fixturePath}/out`;
70
+ await extractZipTo(await buildFixtureArchive(), outputPath);
71
+
72
+ expect(fs.readFileSync(`${outputPath}/nested/app.js`, 'utf8')).to.equal(
73
+ fs.readFileSync(`${fixturePath}/src/nested/app.js`, 'utf8'),
74
+ );
75
+ expect(fs.statSync(`${outputPath}/run.sh`).mode & 0o777).to.equal(0o755);
76
+ });
77
+
78
+ it('extracts from an archive path as well as from a buffer', async () => {
79
+ const archivePath = `${fixturePath}/build.zip`;
80
+ fs.writeFileSync(archivePath, await buildFixtureArchive());
81
+ await extractZipTo(archivePath, `${fixturePath}/from-path`);
82
+
83
+ expect(fs.existsSync(`${fixturePath}/from-path/nested/app.js`)).to.equal(true);
84
+ });
85
+
86
+ it('resolves an entry by exact name, by basename, and by single-entry fallback', async () => {
87
+ const nested = await loadZip(await buildFixtureArchive());
88
+ expect(findZipEntry(nested, 'nested/app.js').name).to.equal('nested/app.js');
89
+ expect(findZipEntry(nested, 'app.js').name).to.equal('nested/app.js');
90
+ expect(findZipEntry(nested, 'absent.js')).to.equal(null);
91
+
92
+ const single = await loadZip(
93
+ await zipFromLocalFiles([{ localPath: `${fixturePath}/src/index.html`, entryName: 'deep/path/index.html' }]),
94
+ );
95
+ expect(findZipEntry(single, 'absent.js').name).to.equal('deep/path/index.html');
96
+ });
97
+
98
+ it('reads a wrapped entry out of a single-file archive', async () => {
99
+ const inner = await buildFixtureArchive();
100
+ fs.writeFileSync(`${fixturePath}/inner.zip`, inner);
101
+ const wrapper = await zipFromLocalFiles([
102
+ { localPath: `${fixturePath}/inner.zip`, entryName: 'wrapped/inner.zip' },
103
+ ]);
104
+
105
+ expect(await readZipEntry(wrapper, 'inner.zip')).to.deep.equal(inner);
106
+ });
107
+
108
+ it('flattens a single extracted entry into the target directory', async () => {
109
+ const archive = await zipFromLocalFiles([
110
+ { localPath: `${fixturePath}/src/index.html`, entryName: 'deep/path/index.html' },
111
+ ]);
112
+ const targetDir = `${fixturePath}/pull`;
113
+ const written = await extractZipEntryTo(archive, 'index.html', targetDir);
114
+
115
+ expect(written).to.equal(dir.resolve(targetDir, 'index.html'));
116
+ expect(fs.readFileSync(written, 'utf8')).to.equal(fs.readFileSync(`${fixturePath}/src/index.html`, 'utf8'));
117
+ });
118
+
119
+ it('rejects a missing entry rather than writing an empty file', async () => {
120
+ const archive = await buildFixtureArchive();
121
+ let thrown;
122
+ await extractZipEntryTo(archive, 'index.html', `${fixturePath}/missing`).catch((error) => (thrown = error));
123
+ expect(thrown).to.equal(undefined);
124
+
125
+ await extractZipEntryTo(await buildFixtureArchive(), 'absent.js', `${fixturePath}/missing`).catch(
126
+ (error) => (thrown = error),
127
+ );
128
+ expect(thrown?.message).to.match(/Zip entry not found/);
129
+ });
130
+
131
+ it('blocks an archive entry that resolves outside the extraction root', async () => {
132
+ const escaping = new JSZip();
133
+ escaping.file('../escaped.txt', 'escaped');
134
+ const archive = await escaping.generateAsync({ type: 'nodebuffer' });
135
+
136
+ let thrown;
137
+ await extractZipTo(archive, `${fixturePath}/guarded`).catch((error) => (thrown = error));
138
+
139
+ expect(thrown?.message).to.match(/Blocked zip entry outside extraction directory/);
140
+ expect(fs.existsSync(`${fixturePath}/escaped.txt`)).to.equal(false);
141
+ });
142
+ });
package/vitest.config.js CHANGED
@@ -2,13 +2,16 @@ import { defineConfig } from 'vitest/config';
2
2
  import {
3
3
  UNDERPOST_TESTING,
4
4
  coverageIncludeFactory,
5
+ coverageReportKey,
5
6
  coverageThresholdFactory,
6
7
  testProjectsFactory,
8
+ vitestProjectSelector,
7
9
  } from './src/server/build/testing.js';
8
10
 
9
11
  const allureResultsDirectory = process.env[UNDERPOST_TESTING.allureResultsEnvKey];
10
12
  const coverageThreshold = coverageThresholdFactory(process.env);
11
13
  const coverageInclude = coverageIncludeFactory(process.argv);
14
+ const coverageReportDirectory = coverageReportKey(vitestProjectSelector(process.argv));
12
15
 
13
16
  // Spread into every tier: a Vitest project inherits nothing from the root
14
17
  // `test` block, and only `coverage` and `reporters` are read from it.
@@ -33,9 +36,14 @@ export default defineConfig({
33
36
  coverage: {
34
37
  provider: 'v8',
35
38
  reportsDirectory: UNDERPOST_TESTING.coverageDirectory,
36
- // `lcov` is what Coveralls ingests, `json` is what a merged multi-job
37
- // report is assembled from, `text` is what a local run reads.
38
- reporter: ['text', 'lcov', 'json'],
39
+ // `lcovonly` is what Coveralls ingests, `json` is what a merged multi-job
40
+ // report is assembled from, `text` is what a local run reads, and `html` is
41
+ // what a deploy publishes — under the selection's own directory, so the
42
+ // report a deploy declares is the run it names and never the last run made.
43
+ reporter: ['text', 'lcovonly', 'json', ['html', { subdir: coverageReportDirectory }]],
44
+ // The directory holds one report per selection, so a run must not empty it; the
45
+ // runner (`src/cli/test.js`) clears its own selection's report before it starts.
46
+ clean: false,
39
47
  // Written even when the run fails: the coverage workflows upload the report
40
48
  // from a job the threshold step is meant to fail, and without it the badge
41
49
  // freezes at the last passing build instead of moving with the tree.
@@ -1,63 +0,0 @@
1
- /**
2
- * Fallback-world default items — process-local override store.
3
- *
4
- * The procedural fallback world is never persisted, so its default item set
5
- * has no collection to live in. This module holds the set the FallbackWorldEngine
6
- * view composed, in memory, for the lifetime of the engine process:
7
- *
8
- * - written by POST /api/cyberia-instance/fallback-world/hot-reload
9
- * - read by fetchFullInstance()'s fallback branch (instance-data.js) and
10
- * GET /api/cyberia-instance/fallback-world[/default-items]
11
- *
12
- * Deliberately NOT persisted: an engine restart drops back to the code defaults,
13
- * so a stale editor session can never become the permanent shape of the world.
14
- * This keeps the fallback path's "code defaults are authoritative" invariant —
15
- * the only thing an operator can layer on top is this explicit, volatile list.
16
- *
17
- * @module src/api/cyberia-instance/cyberia-fallback-default-items.js
18
- */
19
-
20
- /** @typedef {{ id: string, defaultPlayerInventory: boolean }} FallbackDefaultItem */
21
-
22
- /** @type {FallbackDefaultItem[]} */
23
- let defaultItems = [];
24
-
25
- /**
26
- * Coerce a caller-supplied list into the canonical `{ id, defaultPlayerInventory }`
27
- * shape. Accepts the legacy `string[]` form and drops blank/duplicate ids so the
28
- * world generator never sees a malformed entry.
29
- *
30
- * @param {Array<string|FallbackDefaultItem>} entries
31
- * @returns {FallbackDefaultItem[]}
32
- */
33
- function normalizeFallbackDefaultItems(entries) {
34
- if (!Array.isArray(entries)) return [];
35
- const seen = new Set();
36
- const normalized = [];
37
- for (const entry of entries) {
38
- const raw = typeof entry === 'string' ? { id: entry } : entry;
39
- const id = typeof raw?.id === 'string' ? raw.id.trim() : '';
40
- if (!id || seen.has(id)) continue;
41
- seen.add(id);
42
- normalized.push({ id, defaultPlayerInventory: !!raw.defaultPlayerInventory });
43
- }
44
- return normalized;
45
- }
46
-
47
- /**
48
- * Current override set. Returns a copy so callers cannot mutate the store.
49
- * @returns {FallbackDefaultItem[]}
50
- */
51
- const getFallbackDefaultItems = () => defaultItems.map((entry) => ({ ...entry }));
52
-
53
- /**
54
- * Replace the override set. An empty list clears it, restoring pure code defaults.
55
- * @param {Array<string|FallbackDefaultItem>} entries
56
- * @returns {FallbackDefaultItem[]} The stored set.
57
- */
58
- function setFallbackDefaultItems(entries) {
59
- defaultItems = normalizeFallbackDefaultItems(entries);
60
- return getFallbackDefaultItems();
61
- }
62
-
63
- export { getFallbackDefaultItems, setFallbackDefaultItems, normalizeFallbackDefaultItems };
@@ -1,368 +0,0 @@
1
- /**
2
- * Fallback World Engine — editor for the procedural fallback world's default items.
3
- *
4
- * The fallback world (src/api/cyberia-instance/cyberia-fallback-world.js) is
5
- * generated in memory and never persisted, so it has no CyberiaInstance document
6
- * to edit. This view is the trimmed-down counterpart of InstanceEngineCyberia:
7
- * only the default-items section plus a reload trigger.
8
- *
9
- * The composed item set is staged on the engine process and shipped with the
10
- * reload trigger — it is deliberately volatile (see cyberia-fallback-default-items.js),
11
- * so an engine restart returns the world to pure code defaults.
12
- */
13
-
14
- import { BtnIcon } from '../core/BtnIcon.js';
15
- import { Input } from '../core/Input.js';
16
- import { htmls, s } from '../core/VanillaJs.js';
17
- import { commonModeratorGuard } from '../core/CommonJs.js';
18
- import { NotificationManager } from '../core/NotificationManager.js';
19
- import { DropDown } from '../core/DropDown.js';
20
- import { CyberiaInstanceService } from '../../services/cyberia-instance/cyberia-instance.service.js';
21
- import { ObjectLayerService } from '../../services/object-layer/object-layer.service.js';
22
- import { DefaultCyberiaItems } from './SharedDefaultsCyberia.js';
23
-
24
- const dropdownValueKey = (value = '') => String(value).trim().replaceAll(' ', '-');
25
- const createDropdownOption = (value, onClick = () => {}, display = value, data = value) => ({
26
- value,
27
- display,
28
- data,
29
- onClick,
30
- });
31
-
32
- class FallbackWorldEngineCyberia {
33
- static itemIdsDropdownId = 'fallback-world-engine-item-ids-dropdown';
34
- static itemInventoryListId = 'fallback-world-engine-item-inventory-list';
35
- // itemId → defaultPlayerInventory flag for the currently selected item ids.
36
- static itemInventoryFlags = {};
37
- // Ids the code defaults already ship in an entity's defaultObjectLayers.
38
- // Selecting one and leaving it unchecked REMOVES it from those defaults, so
39
- // the list flags them instead of letting a player lose their starting kit.
40
- static entityDefaultItemIds = [];
41
-
42
- // Current selection, read from the dropdown's `oncheckvalues` (always live —
43
- // it is updated before `_renderSelectedBadges` runs, unlike `.value` which
44
- // lags by one in the option-click path).
45
- static getSelectedItemIds() {
46
- const token = DropDown.Tokens[FallbackWorldEngineCyberia.itemIdsDropdownId];
47
- if (!token) return [];
48
- const fromChecks = Object.values(token.oncheckvalues || {})
49
- .map((v) => v.data)
50
- .filter(Boolean);
51
- if (fromChecks.length > 0) return fromChecks;
52
- return Array.isArray(token.value) ? token.value.filter(Boolean) : [];
53
- }
54
-
55
- /** Payload shape shared with CyberiaInstance.itemIds. */
56
- static getItemIdsPayload() {
57
- return FallbackWorldEngineCyberia.getSelectedItemIds().map((id) => ({
58
- id,
59
- defaultPlayerInventory: !!FallbackWorldEngineCyberia.itemInventoryFlags[id],
60
- }));
61
- }
62
-
63
- // Render the per-item "Default Player Inventory" toggles for every selected
64
- // item id. Kept in sync with the dropdown via a MutationObserver on its badge
65
- // container (see render()).
66
- static renderItemInventoryList(containerId = FallbackWorldEngineCyberia.itemInventoryListId) {
67
- const container = s(`.${containerId}`);
68
- if (!container) return;
69
-
70
- const selected = FallbackWorldEngineCyberia.getSelectedItemIds();
71
-
72
- // Drop flags for items no longer selected so the payload never carries them.
73
- for (const key of Object.keys(FallbackWorldEngineCyberia.itemInventoryFlags)) {
74
- if (!selected.includes(key)) delete FallbackWorldEngineCyberia.itemInventoryFlags[key];
75
- }
76
-
77
- if (selected.length === 0) {
78
- htmls(
79
- `.${containerId}`,
80
- html`<div style="color:#888;font-size:12px;">
81
- No item IDs selected — the fallback world runs on pure code defaults.
82
- </div>`,
83
- );
84
- return;
85
- }
86
-
87
- let listHtml = '';
88
- for (const itemId of selected) {
89
- const isChecked = !!FallbackWorldEngineCyberia.itemInventoryFlags[itemId];
90
- const checked = isChecked ? 'checked' : '';
91
- const strips = !isChecked && FallbackWorldEngineCyberia.entityDefaultItemIds.includes(itemId);
92
- listHtml += html`<div class="fl" style="border-bottom:1px solid #444;padding:4px 0;align-items:center;">
93
- <div class="in fll" style="flex:1;font-size:12px;font-family:monospace;">
94
- ${itemId}
95
- ${strips
96
- ? html`<span
97
- style="color:#d90;font-size:11px;font-family:initial;margin-left:6px;"
98
- title="This id is part of the code entity defaults. Left unchecked, it is removed from them."
99
- ><i class="fa-solid fa-triangle-exclamation"></i> removes from entity defaults</span
100
- >`
101
- : ''}
102
- </div>
103
- <div class="in fll" style="display:flex;align-items:center;justify-content:flex-end;">
104
- <label style="font-size:11px;cursor:pointer;display:flex;align-items:center;gap:5px;">
105
- <input
106
- type="checkbox"
107
- class="fallback-world-engine-item-inv-checkbox"
108
- data-item-id="${itemId}"
109
- ${checked}
110
- style="cursor:pointer;"
111
- />
112
- Default Player Inventory
113
- </label>
114
- </div>
115
- </div>`;
116
- }
117
- htmls(`.${containerId}`, listHtml);
118
-
119
- container.querySelectorAll('.fallback-world-engine-item-inv-checkbox').forEach((cb) => {
120
- cb.onchange = () => {
121
- FallbackWorldEngineCyberia.itemInventoryFlags[cb.dataset.itemId] = cb.checked;
122
- };
123
- });
124
- }
125
-
126
- static syncItemIdsDropdownSelection(itemIds = []) {
127
- const dropdownId = FallbackWorldEngineCyberia.itemIdsDropdownId;
128
- if (!DropDown.Tokens[dropdownId]) return;
129
-
130
- // Accept both the `[{ id, defaultPlayerInventory }]` shape and a plain
131
- // string[], matching what the fallback-world endpoint may return.
132
- const normalized = (itemIds || [])
133
- .map((entry) => (typeof entry === 'string' ? { id: entry, defaultPlayerInventory: false } : entry))
134
- .filter((entry) => entry && entry.id);
135
-
136
- DropDown.Tokens[dropdownId].value = [];
137
- if (s(`.${dropdownId}`)) s(`.${dropdownId}`).value = [];
138
- DropDown.Tokens[dropdownId].oncheckvalues = {};
139
- htmls(`.dropdown-current-${dropdownId}`, '');
140
- htmls(`.${dropdownId}-render-container`, '');
141
-
142
- FallbackWorldEngineCyberia.itemInventoryFlags = {};
143
- const ids = [];
144
- for (const entry of normalized) {
145
- const key = dropdownValueKey(entry.id);
146
- DropDown.Tokens[dropdownId].oncheckvalues[key] = {
147
- data: entry.id,
148
- display: entry.id,
149
- value: entry.id,
150
- };
151
- FallbackWorldEngineCyberia.itemInventoryFlags[entry.id] = !!entry.defaultPlayerInventory;
152
- ids.push(entry.id);
153
- }
154
- DropDown.Tokens[dropdownId].value = [...ids];
155
- if (s(`.${dropdownId}`)) s(`.${dropdownId}`).value = [...ids];
156
- DropDown.Tokens[dropdownId]._renderSelectedBadges?.();
157
- FallbackWorldEngineCyberia.renderItemInventoryList();
158
- }
159
-
160
- static async buildItemIdsDropdown() {
161
- return await DropDown.instance({
162
- id: FallbackWorldEngineCyberia.itemIdsDropdownId,
163
- label: html`Object Layer Item IDs`,
164
- data: [],
165
- type: 'checkbox',
166
- containerClass: 'inl',
167
- excludeSelected: true,
168
- serviceProvider: async (q) => {
169
- const result = await ObjectLayerService.searchItemIds({ q });
170
- if (result.status === 'success' && result.data?.itemIds) {
171
- return result.data.itemIds.map((itemId) => createDropdownOption(itemId));
172
- }
173
- return [];
174
- },
175
- });
176
- }
177
-
178
- static async render(options = {}) {
179
- const { appStore } = options;
180
- const role = appStore?.Data?.user?.main?.model?.user?.role || 'guest';
181
- const canMutate = commonModeratorGuard(role);
182
- const idHotReloadUrl = 'fallback-world-engine-input-hot-reload-url';
183
- const idItemIdsDropdown = FallbackWorldEngineCyberia.itemIdsDropdownId;
184
- const idItemInventoryList = FallbackWorldEngineCyberia.itemInventoryListId;
185
-
186
- setTimeout(async () => {
187
- // Keep the per-item "Default Player Inventory" toggles in sync with the
188
- // item-ids dropdown. Every add/remove/clear re-renders the dropdown badge
189
- // container, so observing it is a reliable change hook (the dropdown
190
- // exposes no onChange callback).
191
- const itemBadgeContainer = s(`.dropdown-current-${idItemIdsDropdown}`);
192
- if (itemBadgeContainer) {
193
- const itemInventoryObserver = new MutationObserver(() => {
194
- FallbackWorldEngineCyberia.renderItemInventoryList();
195
- });
196
- itemInventoryObserver.observe(itemBadgeContainer, { childList: true, subtree: true });
197
- }
198
-
199
- // Load whatever this engine process currently serves, so reopening the
200
- // view shows the live set rather than an empty form.
201
- try {
202
- const result = await CyberiaInstanceService.getFallbackDefaultItems();
203
- if (result?.status === 'success') {
204
- FallbackWorldEngineCyberia.entityDefaultItemIds = result.data?.entityDefaultItemIds || [];
205
- FallbackWorldEngineCyberia.syncItemIdsDropdownSelection(result.data?.itemIds || []);
206
- }
207
- } catch (error) {
208
- NotificationManager.Push({ html: error.message, status: 'error' });
209
- }
210
- FallbackWorldEngineCyberia.renderItemInventoryList();
211
-
212
- if (s(`.btn-fallback-world-engine-load-defaults`))
213
- s(`.btn-fallback-world-engine-load-defaults`).onclick = () => {
214
- // Seed from the canonical registry so an operator starts from the
215
- // same list `import-default-items` creates ObjectLayers for. Ids the
216
- // entity defaults already ship start checked: selecting them
217
- // unchecked would strip them from those defaults, which is never what
218
- // "load the defaults" is asking for.
219
- const flags = Object.fromEntries(
220
- FallbackWorldEngineCyberia.getItemIdsPayload().map((e) => [e.id, e.defaultPlayerInventory]),
221
- );
222
- FallbackWorldEngineCyberia.syncItemIdsDropdownSelection(
223
- DefaultCyberiaItems.map((entry) => ({
224
- id: entry.item.id,
225
- defaultPlayerInventory:
226
- flags[entry.item.id] ?? FallbackWorldEngineCyberia.entityDefaultItemIds.includes(entry.item.id),
227
- })),
228
- );
229
- };
230
-
231
- if (s(`.btn-fallback-world-engine-clear`))
232
- s(`.btn-fallback-world-engine-clear`).onclick = () => {
233
- FallbackWorldEngineCyberia.syncItemIdsDropdownSelection([]);
234
- };
235
-
236
- if (s(`.btn-fallback-world-engine-toggle-hot-reload`))
237
- s(`.btn-fallback-world-engine-toggle-hot-reload`).onclick = () => {
238
- const body = s(`.fallback-world-engine-hot-reload-body`);
239
- const caret = s(`.fallback-world-engine-hot-reload-caret`);
240
- if (body) body.classList.toggle('hide');
241
- if (caret) {
242
- caret.classList.toggle('fa-caret-right');
243
- caret.classList.toggle('fa-caret-down');
244
- }
245
- };
246
-
247
- const triggerHotReload = async (mode) => {
248
- const buttons = [
249
- s(`.btn-fallback-world-engine-hot-reload`),
250
- s(`.btn-fallback-world-engine-hot-reload-incremental`),
251
- ];
252
- const statusSelector = `.fallback-world-engine-hot-reload-status`;
253
- const serverUrl = s(`.${idHotReloadUrl}`)?.value?.trim();
254
- if (!serverUrl) {
255
- NotificationManager.Push({ html: 'Set the cyberia-server URL first.', status: 'warning' });
256
- return;
257
- }
258
-
259
- for (const btn of buttons) if (btn) btn.disabled = true;
260
- if (s(statusSelector))
261
- htmls(statusSelector, html`<span style="color:#888;">Triggering ${mode} hot reload…</span>`);
262
- try {
263
- const result = await CyberiaInstanceService.fallbackHotReload({
264
- body: { serverUrl, mode, itemIds: FallbackWorldEngineCyberia.getItemIdsPayload() },
265
- });
266
- if (result.status === 'error') {
267
- NotificationManager.Push({ html: result.message, status: 'error' });
268
- if (s(statusSelector)) htmls(statusSelector, html`<span style="color:#d66;">${result.message}</span>`);
269
- return;
270
- }
271
- const { transport, durationMs, message, grpcError, itemIds } = result.data || {};
272
- NotificationManager.Push({ html: `Hot reload via ${transport}: ${message}`, status: 'success' });
273
- if (s(statusSelector))
274
- htmls(
275
- statusSelector,
276
- html`<span style="color:#6b6;">
277
- via <b>${transport}</b> · ${durationMs}ms · ${(itemIds || []).length} default item(s) staged ·
278
- ${message} </span
279
- >${grpcError ? html`<div style="color:#a80;">gRPC unavailable: ${grpcError}</div>` : ''}`,
280
- );
281
- } catch (error) {
282
- NotificationManager.Push({ html: error.message, status: 'error' });
283
- if (s(statusSelector)) htmls(statusSelector, html`<span style="color:#d66;">${error.message}</span>`);
284
- } finally {
285
- for (const btn of buttons) if (btn) btn.disabled = false;
286
- }
287
- };
288
-
289
- if (s(`.btn-fallback-world-engine-hot-reload`))
290
- s(`.btn-fallback-world-engine-hot-reload`).onclick = () => triggerHotReload('full');
291
- if (s(`.btn-fallback-world-engine-hot-reload-incremental`))
292
- s(`.btn-fallback-world-engine-hot-reload-incremental`).onclick = () => triggerHotReload('incremental');
293
- });
294
-
295
- return html`
296
- <div class="in fallback-world-engine-container">
297
- <div class="in section-mp" style="color:#888;font-size:12px;">
298
- The fallback world is generated in memory and never persisted, so it has no instance document to edit. Items
299
- selected here are staged on this engine process and applied when a cyberia-server reloads. They are volatile:
300
- an engine restart returns the world to its code defaults.
301
- </div>
302
-
303
- <div class="in section-mp" style="margin-top: 10px;">
304
- <div class="in input-label" style="font-size:14px;margin-bottom:5px;">Default Items</div>
305
- ${await FallbackWorldEngineCyberia.buildItemIdsDropdown()}
306
- </div>
307
- <div class="in section-mp" style="margin-top: 5px;">
308
- <div class="in input-label" style="font-size:13px;margin-bottom:5px;">Default Player Inventory</div>
309
- <div class="in" style="color:#888;font-size:12px;margin-bottom:6px;">
310
- Every selected id is resolved to an atlas at boot. Ids checked here are seeded into each new player's
311
- inventory (inactive, never auto-equipped); unchecked ids are explicitly removed from the player's default
312
- layers.
313
- </div>
314
- <div class="in ${idItemInventoryList}" style="max-height:200px;overflow-y:auto;"></div>
315
- ${canMutate
316
- ? html`<div class="in" style="display:flex;gap:5px;flex-wrap:wrap;margin-top:10px;">
317
- ${await BtnIcon.instance({
318
- class: 'wfa btn-fallback-world-engine-load-defaults',
319
- label: html`<i class="fa-solid fa-list-check"></i> Load Canonical Defaults`,
320
- })}
321
- ${await BtnIcon.instance({
322
- class: 'wfa btn-fallback-world-engine-clear',
323
- label: html`<i class="fa-solid fa-eraser"></i> Clear Selection`,
324
- })}
325
- </div>`
326
- : ''}
327
- </div>
328
-
329
- ${canMutate
330
- ? html`<div class="in section-mp" style="margin-top: 10px;">
331
- ${await BtnIcon.instance({
332
- class: 'wfa btn-fallback-world-engine-toggle-hot-reload',
333
- label: html`<i class="fa-solid fa-caret-right fallback-world-engine-hot-reload-caret"></i> Hot Reload`,
334
- })}
335
- <div class="in fallback-world-engine-hot-reload-body hide">
336
- <div class="in" style="color:#888;font-size:12px;margin:5px 0;">
337
- Stages the items above on this engine, then rebuilds the world of a running cyberia-server so it
338
- re-fetches them. Tries the gRPC control service first and falls back to the REST endpoint. For a
339
- multi-instance deployment, append the variant sub-path so the trigger reaches the right world (e.g.
340
- <code>https://server.cyberiaonline.com/TEST</code>); the default world uses the bare origin.
341
- </div>
342
- ${await Input.instance({
343
- id: idHotReloadUrl,
344
- label: html`<i class="fa-solid fa-server"></i> Cyberia Server URL`,
345
- containerClass: 'in',
346
- placeholder: 'https://server.cyberiaonline.com/TEST',
347
- type: 'text',
348
- })}
349
- <div class="in" style="display:flex;gap:5px;flex-wrap:wrap;margin-top:5px;">
350
- ${await BtnIcon.instance({
351
- class: 'wfa btn-fallback-world-engine-hot-reload',
352
- label: html`<i class="fa-solid fa-rotate"></i> Trigger Hot Reload`,
353
- })}
354
- ${await BtnIcon.instance({
355
- class: 'wfa btn-fallback-world-engine-hot-reload-incremental',
356
- label: html`<i class="fa-solid fa-layer-group"></i> Incremental (assets only)`,
357
- })}
358
- </div>
359
- <div class="in fallback-world-engine-hot-reload-status" style="margin-top:5px;font-size:12px;"></div>
360
- </div>
361
- </div>`
362
- : ''}
363
- </div>
364
- `;
365
- }
366
- }
367
-
368
- export { FallbackWorldEngineCyberia };