@kvyverse/world-runtime 0.5.0 → 0.6.1

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 (29) hide show
  1. package/dist/{BallCollider-3L5vOrcL.js → BallCollider-DdxrnexK.js} +3 -3
  2. package/dist/{CapsuleCollider-CBTsR-Ys.js → CapsuleCollider-XlGZqg_O.js} +3 -3
  3. package/dist/{ChatModule-2tiWS_Yr.js → ChatModule-DzNY_v-3.js} +4 -4
  4. package/dist/{Collider-CPUCG3RA.js → Collider-ElnvKET2.js} +2 -2
  5. package/dist/{ConeCollider-C3XU3Y9X.js → ConeCollider-CQfGphDa.js} +3 -3
  6. package/dist/{ConvexMeshCollider-DzNV4HTO.js → ConvexMeshCollider-0Q2u7QAL.js} +2 -2
  7. package/dist/{CuboidCollider-Dp1DZoFM.js → CuboidCollider-Cm7kKRMA.js} +2 -2
  8. package/dist/{CylinderCollider-C0h_nhB5.js → CylinderCollider-P2oZeEyb.js} +3 -3
  9. package/dist/{FpsCameraController-2GNWJM5D.js → FpsCameraController-CuYDbMHJ.js} +1 -1
  10. package/dist/{MeshInstansing-Bxij0Yc9.js → MeshInstansing-CSd1gjpu.js} +1 -1
  11. package/dist/{PointerLockCameraControls-DYxxMeSw.js → PointerLockCameraControls-Cq0m2NLS.js} +2 -2
  12. package/dist/{RapierDebugRenderer-BQy_m-3C.js → RapierDebugRenderer-BSsFENi2.js} +1 -1
  13. package/dist/{RapierFpsPlayerController-DthD8dw9.js → RapierFpsPlayerController-By_mnB5m.js} +1 -1
  14. package/dist/{RapierPhysics-CU6X--c7.js → RapierPhysics-C22OXUaE.js} +3 -3
  15. package/dist/{Rigidbody-DLhN8ddv.js → Rigidbody-BHRxJKXd.js} +1 -1
  16. package/dist/{ScalingToFro-BD-E5-uR.js → ScalingToFro-CmXQHfR5.js} +1 -1
  17. package/dist/{SightInteractableArea-DrqyB41W.js → SightInteractableArea-C7xBqoQo.js} +1 -1
  18. package/dist/{SimpleWASDMovement-C2m53YYH.js → SimpleWASDMovement-BYu0AFeG.js} +1 -1
  19. package/dist/{Spinning-sgUhHld8.js → Spinning-DDhlLF3g.js} +1 -1
  20. package/dist/{StartAnimation-B9eomOS2.js → StartAnimation-BbY1HgSj.js} +1 -1
  21. package/dist/{TrimeshCollider-7dIs_xtZ.js → TrimeshCollider-CGirnNOf.js} +1 -1
  22. package/dist/{chat.module-descriptor-BTsep-Kq.js → chat.module-descriptor-BMy5jpOU.js} +3 -3
  23. package/dist/{get-scale-from-obj-B7JlVPni.js → get-scale-from-obj-bFMquHMV.js} +1 -1
  24. package/dist/index.js +69 -66
  25. package/dist/{lib-registry-D1VyVPBg.js → lib-registry-B-NnzKUx.js} +1 -1
  26. package/dist/modules/EnvModule.d.ts +7 -5
  27. package/dist/modules/contracts/env.module-api.d.ts +11 -2
  28. package/dist/version.gen.d.ts +1 -1
  29. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { n as getRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
2
- import { t as Collider } from "./Collider-CPUCG3RA.js";
3
- //#region packages/world-runtime/src/behaviours/physics/BallCollider.ts
1
+ import { n as getRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
2
+ import { t as Collider } from "./Collider-ElnvKET2.js";
3
+ //#region src/behaviours/physics/BallCollider.ts
4
4
  var BallCollider = class extends Collider {
5
5
  type = "Ball";
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
2
- import { t as Collider } from "./Collider-CPUCG3RA.js";
3
- //#region packages/world-runtime/src/behaviours/physics/CapsuleCollider.ts
1
+ import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
2
+ import { t as Collider } from "./Collider-ElnvKET2.js";
3
+ //#region src/behaviours/physics/CapsuleCollider.ts
4
4
  var CapsuleCollider = class extends Collider {
5
5
  type = "Capsule";
6
6
  /**
@@ -1,10 +1,10 @@
1
- import { t as CHAT_COMMAND_KEY } from "./chat.module-descriptor-BTsep-Kq.js";
1
+ import { t as CHAT_COMMAND_KEY } from "./chat.module-descriptor-BMy5jpOU.js";
2
2
  import { ContextModule, ThreeContextEvents } from "three-start";
3
3
  import van from "vanjs-core";
4
- //#region packages/world-runtime/src/modules/chat/chat.css?inline
4
+ //#region src/modules/chat/chat.css?inline
5
5
  var chat_default = "/* Neutral base for the chat input: only what it breaks without on real devices.\n Looks are left to the world. */\n\n.kvy-chat {\n position: absolute;\n left: 0;\n bottom: 0;\n width: 100%;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n /* On-screen keyboard: ChatDom writes the overlap height here. */\n padding-bottom: var(--kvy-chat-keyboard-inset, 0px);\n /* Click-through like the HUD around it: the root stretches over the whole feed,\n so catching events here would kill clicks on the world behind the messages.\n Only the input takes events back. */\n pointer-events: none;\n}\n\n.kvy-chat__form {\n display: flex;\n margin: 0;\n}\n\n.kvy-chat__input {\n flex: 1 1 auto;\n min-width: 0;\n /* 16px — below that iOS Safari zooms the page on focus. */\n font: inherit;\n font-size: 16px;\n line-height: 1.25;\n color: inherit;\n background: transparent;\n border: 0;\n outline: none;\n padding: 4px 6px;\n -webkit-appearance: none;\n appearance: none;\n border-radius: 0;\n /* The one interactive part of the chat. */\n pointer-events: auto;\n /* No 300ms delay and no double-tap zoom on the input. */\n touch-action: manipulation;\n}\n\n/* The message feed is a TTL queue, not a scroll container. It sticks to the\n bottom and extra lines are cut from the top — no scrollbar here by design. */\n.kvy-chat__feed {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n max-height: 40vh;\n overflow: hidden;\n /* Belt and braces: the root is already click-through, but a world restyling it\n must not accidentally make messages catch clicks. */\n pointer-events: none;\n}\n\n.kvy-chat__line {\n opacity: 1;\n transition: opacity 300ms ease;\n overflow-wrap: anywhere;\n}\n\n/* The line has outlived its time: it fades but stays in the DOM — opening the\n chat shows it again instead of rebuilding the feed. */\n.kvy-chat__line--faded {\n opacity: 0;\n}\n\n/* Hidden submit button: backs up implicit submission in old webviews. */\n.kvy-chat__submit {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n/* Toggle mode: the input is hidden until entered (Enter on the canvas).\n Opacity, not visibility/display: an element hidden by those cannot be focused\n programmatically, leaving nothing to open the chat with. */\n.kvy-chat--idle-hidden .kvy-chat__input {\n opacity: 0;\n pointer-events: none;\n}\n";
6
6
  //#endregion
7
- //#region packages/world-runtime/src/modules/chat/ChatDom.ts
7
+ //#region src/modules/chat/ChatDom.ts
8
8
  var { button, div, form, input } = van.tags;
9
9
  var STYLE_ID = "kvyverse-chat-styles";
10
10
  /**
@@ -299,7 +299,7 @@ var ChatDom = class ChatDom {
299
299
  }
300
300
  };
301
301
  //#endregion
302
- //#region packages/world-runtime/src/modules/chat/ChatModule.ts
302
+ //#region src/modules/chat/ChatModule.ts
303
303
  /**
304
304
  * The world chat as a pluggable ctx module: message history plus its own DOM
305
305
  * input (`dom`), no React. Enabled from `settings.addons.json → modules`; it
@@ -1,7 +1,7 @@
1
- import { t as Rigidbody } from "./Rigidbody-DLhN8ddv.js";
1
+ import { t as Rigidbody } from "./Rigidbody-BHRxJKXd.js";
2
2
  import * as THREE from "three/webgpu";
3
3
  import { Object3DBehaviour, assertDefined, getComponents } from "three-start";
4
- //#region packages/world-runtime/src/behaviours/physics/Collider.ts
4
+ //#region src/behaviours/physics/Collider.ts
5
5
  /** Walk the parent chain (ancestors only); stop when `cb` returns `false`. */
6
6
  function traverseUp(obj, cb) {
7
7
  let cur = obj.parent;
@@ -1,6 +1,6 @@
1
- import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
2
- import { t as Collider } from "./Collider-CPUCG3RA.js";
3
- //#region packages/world-runtime/src/behaviours/physics/ConeCollider.ts
1
+ import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
2
+ import { t as Collider } from "./Collider-ElnvKET2.js";
3
+ //#region src/behaviours/physics/ConeCollider.ts
4
4
  var ConeCollider = class extends Collider {
5
5
  type = "Cone";
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { t as Collider } from "./Collider-CPUCG3RA.js";
2
- //#region packages/world-runtime/src/behaviours/physics/ConvexMeshCollider.ts
1
+ import { t as Collider } from "./Collider-ElnvKET2.js";
2
+ //#region src/behaviours/physics/ConvexMeshCollider.ts
3
3
  var ConvexMeshCollider = class extends Collider {
4
4
  type = "Convex";
5
5
  getDesc(rapier) {
@@ -1,5 +1,5 @@
1
- import { t as Collider } from "./Collider-CPUCG3RA.js";
2
- //#region packages/world-runtime/src/behaviours/physics/CuboidCollider.ts
1
+ import { t as Collider } from "./Collider-ElnvKET2.js";
2
+ //#region src/behaviours/physics/CuboidCollider.ts
3
3
  var CuboidCollider = class extends Collider {
4
4
  type = "Cuboid";
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
2
- import { t as Collider } from "./Collider-CPUCG3RA.js";
3
- //#region packages/world-runtime/src/behaviours/physics/CylinderCollider.ts
1
+ import { t as getHalfheightRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
2
+ import { t as Collider } from "./Collider-ElnvKET2.js";
3
+ //#region src/behaviours/physics/CylinderCollider.ts
4
4
  var CylinderCollider = class extends Collider {
5
5
  type = "Cylinder";
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/controls/FpsCameraController.ts
2
+ //#region src/behaviours/controls/FpsCameraController.ts
3
3
  var FpsCameraController = class extends Object3DBehaviour {
4
4
  sensitivity = .002;
5
5
  mobileSensitivity = .006;
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/utils/MeshInstansing.ts
3
+ //#region src/behaviours/utils/MeshInstansing.ts
4
4
  var MeshInstansing = class MeshInstansing extends Object3DBehaviour {
5
5
  static _totalInstance = 0;
6
6
  geometry = null;
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/controls/PointerLockCameraControls.ts
3
+ //#region src/behaviours/controls/PointerLockCameraControls.ts
4
4
  var _euler = new THREE.Euler(0, 0, 0, "YXZ");
5
5
  var _vector = new THREE.Vector3();
6
6
  var _MOUSE_SENSITIVITY = .002;
@@ -17,7 +17,7 @@ var PointerLockCameraControls = class extends Object3DBehaviour {
17
17
  _detach;
18
18
  onEnable() {
19
19
  const env = this.modules.env;
20
- this._canBeLocked = env.prod && !env.isMobile;
20
+ this._canBeLocked = !env.dev && !env.isMobile;
21
21
  this._isMobile = env.isMobile;
22
22
  const dom = this.ctx.renderer.domElement;
23
23
  const lock = () => {
@@ -1,5 +1,5 @@
1
1
  import * as THREE from "three/webgpu";
2
- //#region packages/world-runtime/src/modules/physics/RapierDebugRenderer.ts
2
+ //#region src/modules/physics/RapierDebugRenderer.ts
3
3
  /**
4
4
  * Draws rapier colliders as lines. Not a ctx module: it lives inside
5
5
  * `RapierPhysics` (`enableDebug`/`disableDebug`) and is pulled dynamically —
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/physics/RapierFpsPlayerController.ts
3
+ //#region src/behaviours/physics/RapierFpsPlayerController.ts
4
4
  var RapierFpsPlayerController = class extends Object3DBehaviour {
5
5
  halfHeight = .85;
6
6
  radius = .5;
@@ -1,6 +1,6 @@
1
- import { a as LibId } from "./lib-registry-D1VyVPBg.js";
1
+ import { a as LibId } from "./lib-registry-B-NnzKUx.js";
2
2
  import { ContextModule, ThreeContextEvents, defineProps, readOnly } from "three-start";
3
- //#region packages/world-runtime/src/modules/physics/RapierPhysics.ts
3
+ //#region src/modules/physics/RapierPhysics.ts
4
4
  var RapierPhysics = class RapierPhysics extends ContextModule {
5
5
  isRapierPhysics;
6
6
  api;
@@ -53,7 +53,7 @@ var RapierPhysics = class RapierPhysics extends ContextModule {
53
53
  }
54
54
  /** Turn on collider debug drawing; the renderer is fetched on demand. */
55
55
  async enableDebug() {
56
- this._debug ??= new (await (import("./RapierDebugRenderer-BQy_m-3C.js"))).RapierDebugRenderer(this.ctx, this);
56
+ this._debug ??= new (await (import("./RapierDebugRenderer-BSsFENi2.js"))).RapierDebugRenderer(this.ctx, this);
57
57
  this._debug.start();
58
58
  }
59
59
  disableDebug() {
@@ -12,7 +12,7 @@ var __exportAll = (all, no_symbols) => {
12
12
  return target;
13
13
  };
14
14
  //#endregion
15
- //#region packages/world-runtime/src/behaviours/physics/Rigidbody.ts
15
+ //#region src/behaviours/physics/Rigidbody.ts
16
16
  var Rigidbody_exports = /* @__PURE__ */ __exportAll({ default: () => Rigidbody });
17
17
  /**
18
18
  * @see {@link https://github.com/vladkrutenyuk/three-kvy-core/blob/main/src/addons/Rigidbody.ts | Source}
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/animation/ScalingToFro.ts
2
+ //#region src/behaviours/animation/ScalingToFro.ts
3
3
  var ScalingToFro = class extends Object3DBehaviour {
4
4
  scale = 1;
5
5
  max = 2;
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/player/SightInteractableArea.ts
3
+ //#region src/behaviours/player/SightInteractableArea.ts
4
4
  var raycaster = new THREE.Raycaster();
5
5
  var SightInteractableArea = class SightInteractableArea extends Object3DBehaviour {
6
6
  static _CURRENT = null;
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/controls/SimpleWASDMovement.ts
2
+ //#region src/behaviours/controls/SimpleWASDMovement.ts
3
3
  var SimpleWASDMovement = class extends Object3DBehaviour {
4
4
  speed = 4;
5
5
  onBeforeRender() {
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/animation/Spinning.ts
2
+ //#region src/behaviours/animation/Spinning.ts
3
3
  var Spinning = class extends Object3DBehaviour {
4
4
  speed = 5;
5
5
  onBeforeRender() {
@@ -1,6 +1,6 @@
1
1
  import * as THREE from "three/webgpu";
2
2
  import { Object3DBehaviour } from "three-start";
3
- //#region packages/world-runtime/src/behaviours/animation/StartAnimation.ts
3
+ //#region src/behaviours/animation/StartAnimation.ts
4
4
  var StartAnimation = class extends Object3DBehaviour {
5
5
  mixer;
6
6
  _action;
@@ -1,5 +1,5 @@
1
1
  import { Object3DBehaviour } from "three-start";
2
- //#region packages/world-runtime/src/behaviours/physics/TrimeshCollider.ts
2
+ //#region src/behaviours/physics/TrimeshCollider.ts
3
3
  var TrimeshCollider = class extends Object3DBehaviour {
4
4
  recursive = false;
5
5
  _detach;
@@ -1,4 +1,4 @@
1
- //#region packages/world-runtime/src/modules/optional-module-descriptor.ts
1
+ //#region src/modules/optional-module-descriptor.ts
2
2
  /**
3
3
  * Keys of the pluggable modules — the same keys as in
4
4
  * `settings.addons.json → modules`. Core modules (`addons`/`env`/`html`/`input`/
@@ -11,7 +11,7 @@ var OptionalModuleId = /* @__PURE__ */ function(OptionalModuleId) {
11
11
  }({});
12
12
  var OPTIONAL_MODULE_IDS = Object.values(OptionalModuleId);
13
13
  //#endregion
14
- //#region packages/world-runtime/src/modules/chat/chat.module-descriptor.ts
14
+ //#region src/modules/chat/chat.module-descriptor.ts
15
15
  /** `Slash` opens the chat with a "/" already typed — the Minecraft command gesture. */
16
16
  var CHAT_COMMAND_KEY = "Slash";
17
17
  var CHAT_INPUT_MODES = ["always", "toggle"];
@@ -49,7 +49,7 @@ var chatModuleDescriptor = {
49
49
  normalize: (raw) => normalizeChat(raw),
50
50
  defaultConfig: () => ({ ...DEFAULTS }),
51
51
  create: async (config) => {
52
- const { ChatModule } = await import("./ChatModule-2tiWS_Yr.js");
52
+ const { ChatModule } = await import("./ChatModule-DzNY_v-3.js");
53
53
  return new ChatModule(config);
54
54
  },
55
55
  schema: {
@@ -1,5 +1,5 @@
1
1
  import * as THREE from "three/webgpu";
2
- //#region packages/world-runtime/src/behaviours/physics/get-scale-from-obj.ts
2
+ //#region src/behaviours/physics/get-scale-from-obj.ts
3
3
  var _hrScale = {
4
4
  radius: 1,
5
5
  halfHeight: 1
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { a as OPTIONAL_MODULE_IDS, i as normalizeChat, n as CHAT_INPUT_MODES, o as OptionalModuleId, r as chatModuleDescriptor } from "./chat.module-descriptor-BTsep-Kq.js";
2
- import { a as LibId, c as libByRequireKey, i as LIB_IDS, n as LIBS, o as OPTIONAL_LIB_DESCRIPTORS, r as LIB_DESCRIPTORS, s as OPTIONAL_LIB_IDS, t as BUILTIN_LIB_DESCRIPTORS } from "./lib-registry-D1VyVPBg.js";
3
- import { n as getRadiusScale, t as getHalfheightRadiusScale } from "./get-scale-from-obj-B7JlVPni.js";
1
+ import { a as OPTIONAL_MODULE_IDS, i as normalizeChat, n as CHAT_INPUT_MODES, o as OptionalModuleId, r as chatModuleDescriptor } from "./chat.module-descriptor-BMy5jpOU.js";
2
+ import { a as LibId, c as libByRequireKey, i as LIB_IDS, n as LIBS, o as OPTIONAL_LIB_DESCRIPTORS, r as LIB_DESCRIPTORS, s as OPTIONAL_LIB_IDS, t as BUILTIN_LIB_DESCRIPTORS } from "./lib-registry-B-NnzKUx.js";
3
+ import { n as getRadiusScale, t as getHalfheightRadiusScale } from "./get-scale-from-obj-bFMquHMV.js";
4
4
  import * as THREE from "three/webgpu";
5
5
  import { BufferGeometryLoader, LoadingManager, TextureLoader } from "three/webgpu";
6
6
  import * as ThreeStartNS from "three-start";
@@ -15,7 +15,7 @@ import { clone } from "three/examples/jsm/utils/SkeletonUtils.js";
15
15
  import EventEmitter from "eventemitter3";
16
16
  import * as nanostores from "nanostores";
17
17
  import { atom } from "nanostores";
18
- //#region packages/world-runtime/src/world-events.ts
18
+ //#region src/world-events.ts
19
19
  /**
20
20
  * World lifecycle events, emitted on `game.emitter` (`world.events` in scripts)
21
21
  * during classic-load. The entry script runs BEFORE them (step 9) — subscriptions
@@ -31,7 +31,7 @@ var WorldEvent = /* @__PURE__ */ function(WorldEvent) {
31
31
  return WorldEvent;
32
32
  }({});
33
33
  //#endregion
34
- //#region packages/world-runtime/src/World.ts
34
+ //#region src/World.ts
35
35
  /**
36
36
  * A loaded world is a three-start app with the scene already assembled.
37
37
  * Mounting and starting are manual: `mount(container)` attaches the canvas and
@@ -66,7 +66,7 @@ var World = class extends ThreeStart {
66
66
  }
67
67
  };
68
68
  //#endregion
69
- //#region packages/world-runtime/src/utils/lazy.ts
69
+ //#region src/utils/lazy.ts
70
70
  /**
71
71
  * Object that forwards every access to `resolve()`. For script globals that are
72
72
  * shortcuts into something created later (`modules` → `ctx.modules`): the script
@@ -100,7 +100,7 @@ function lazy(factory) {
100
100
  } };
101
101
  }
102
102
  //#endregion
103
- //#region packages/world-runtime/src/resources/loaders.ts
103
+ //#region src/resources/loaders.ts
104
104
  var LOADING_MANAGER = new LoadingManager();
105
105
  LOADING_MANAGER.onError = (url) => {
106
106
  console.error(`Loading asset failed: ${url}`);
@@ -174,7 +174,7 @@ var AssetLoaders = {
174
174
  })
175
175
  };
176
176
  //#endregion
177
- //#region packages/world-runtime/src/rendering/renderer-apply.ts
177
+ //#region src/rendering/renderer-apply.ts
178
178
  var SHADOW_MAP_TYPES$1 = {
179
179
  Basic: THREE.BasicShadowMap,
180
180
  PCF: THREE.PCFShadowMap,
@@ -210,7 +210,7 @@ function applyRendererConfig(renderer, cfg) {
210
210
  renderer.setPixelRatio(window.devicePixelRatio * pixelResolution);
211
211
  }
212
212
  //#endregion
213
- //#region packages/world-runtime/src/rendering/SceneBloom.ts
213
+ //#region src/rendering/SceneBloom.ts
214
214
  /** BloomNode loads as a chunk only when bloom is enabled. */
215
215
  var lazyBloomModule = lazy(() => import("three/addons/tsl/display/BloomNode.js"));
216
216
  /**
@@ -296,7 +296,7 @@ function finiteOr(value, fallback) {
296
296
  return typeof value === "number" && Number.isFinite(value) ? value : fallback;
297
297
  }
298
298
  //#endregion
299
- //#region packages/world-runtime/src/modules/controls/KeyboardControlsDriver.ts
299
+ //#region src/modules/controls/KeyboardControlsDriver.ts
300
300
  /** A diagonal must not be faster than a straight line. */
301
301
  var DIAGONAL = Math.SQRT1_2;
302
302
  /**
@@ -328,7 +328,7 @@ var KeyboardControlsDriver = class {
328
328
  }
329
329
  };
330
330
  //#endregion
331
- //#region packages/world-runtime/src/modules/controls/ControlsModule.ts
331
+ //#region src/modules/controls/ControlsModule.ts
332
332
  /**
333
333
  * The player's movement intent — what they want to do, whatever the hardware is.
334
334
  * Input sources register as drivers (`addDriver`); the module polls them once a
@@ -441,8 +441,8 @@ var ControlsModule = class extends ContextModule {
441
441
  }
442
442
  };
443
443
  //#endregion
444
- //#region packages/world-runtime/src/behaviours/physics/_required-patch.ts
445
- var lazyRapierPhysicsModule = lazy(async () => (await import("./RapierPhysics-CU6X--c7.js")).default);
444
+ //#region src/behaviours/physics/_required-patch.ts
445
+ var lazyRapierPhysicsModule = lazy(async () => (await import("./RapierPhysics-C22OXUaE.js")).default);
446
446
  /** The only place the physics module is created — called by the registry
447
447
  * descriptor. The module itself takes rapier from `ctx.modules.addons` on awake. */
448
448
  async function createRapierPhysicsModule(config) {
@@ -468,7 +468,7 @@ async function applyRapierPhysicsPatch(starter) {
468
468
  starter.addModules({ rapier: module });
469
469
  }
470
470
  //#endregion
471
- //#region packages/world-runtime/src/modules/physics/physics.module-descriptor.ts
471
+ //#region src/modules/physics/physics.module-descriptor.ts
472
472
  var PHYSICS_ENGINES = ["rapier"];
473
473
  /** Physics defaults: the rapier engine, debug off. */
474
474
  function normalizePhysics(value) {
@@ -521,7 +521,7 @@ var physicsModuleDescriptor = {
521
521
  }
522
522
  };
523
523
  //#endregion
524
- //#region packages/world-runtime/src/modules/optional-modules.ts
524
+ //#region src/modules/optional-modules.ts
525
525
  /**
526
526
  * Table of contents for the world's pluggable modules: what can be enabled from
527
527
  * `settings.addons.json → modules`. The descriptors themselves live next to
@@ -538,7 +538,7 @@ function getOptionalModuleDescriptor(id) {
538
538
  return descriptor;
539
539
  }
540
540
  //#endregion
541
- //#region packages/world-runtime/src/modules/is-mobile-device.ts
541
+ //#region src/modules/is-mobile-device.ts
542
542
  function isMobileDevice() {
543
543
  if (typeof navigator === "undefined" || typeof window === "undefined") return false;
544
544
  const ua = navigator.userAgent || navigator.vendor || window.opera;
@@ -549,22 +549,24 @@ function isMobileDevice() {
549
549
  return "ontouchstart" in window || navigator.maxTouchPoints && navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
550
550
  }
551
551
  //#endregion
552
- //#region packages/world-runtime/src/modules/EnvModule.ts
552
+ //#region src/modules/EnvModule.ts
553
553
  var EnvModule = class extends ContextModule {
554
- dev = true;
555
- prod = true;
556
554
  mode;
555
+ dev;
556
+ prod;
557
+ selfHosted;
557
558
  isMobile;
558
559
  constructor(mode) {
559
560
  super();
560
561
  this.mode = mode;
561
562
  this.dev = mode === "dev";
562
563
  this.prod = mode === "prod";
564
+ this.selfHosted = mode === "selfhosted";
563
565
  this.isMobile = isMobileDevice();
564
566
  }
565
567
  };
566
568
  //#endregion
567
- //#region packages/world-runtime/src/modules/HtmlHudModule.ts
569
+ //#region src/modules/HtmlHudModule.ts
568
570
  var { div } = van.tags;
569
571
  var LAYER_STYLE = "position:fixed;inset:0;pointer-events:none;";
570
572
  var HtmlHudModule = class extends ContextModule {
@@ -620,7 +622,7 @@ var HtmlHudModule = class extends ContextModule {
620
622
  };
621
623
  };
622
624
  //#endregion
623
- //#region packages/world-runtime/src/modules/InputSystemModule.ts
625
+ //#region src/modules/InputSystemModule.ts
624
626
  var InputSystemModule = class extends ContextModule {
625
627
  _dom;
626
628
  _keys = /* @__PURE__ */ new Set();
@@ -687,6 +689,7 @@ var InputSystemModule = class extends ContextModule {
687
689
  onAwake() {
688
690
  const ctx = this.ctx;
689
691
  this._dom = ctx.renderer.domElement;
692
+ this._dom.style.outline = "none";
690
693
  window.addEventListener("resize", this.onWindowResize);
691
694
  window.addEventListener("scroll", this.onWindowScroll);
692
695
  window.addEventListener("blur", this.onBlur);
@@ -872,7 +875,7 @@ function isUiKeyboardTarget(target) {
872
875
  }
873
876
  }
874
877
  //#endregion
875
- //#region packages/world-runtime/src/modules/SoundsModule.ts
878
+ //#region src/modules/SoundsModule.ts
876
879
  var SoundsModule = class extends ContextModule {
877
880
  global = Howler;
878
881
  /** three-start ContextModule has no onDestroy; teardown is explicit. */
@@ -881,7 +884,7 @@ var SoundsModule = class extends ContextModule {
881
884
  }
882
885
  };
883
886
  //#endregion
884
- //#region packages/world-runtime/src/modules/UtilsModule.ts
887
+ //#region src/modules/UtilsModule.ts
885
888
  var UtilsModule = class extends ContextModule {
886
889
  cloneObject3D;
887
890
  mergeGeometries;
@@ -892,7 +895,7 @@ var UtilsModule = class extends ContextModule {
892
895
  }
893
896
  };
894
897
  //#endregion
895
- //#region packages/world-runtime/src/modules/index.ts
898
+ //#region src/modules/index.ts
896
899
  /**
897
900
  * Assembles the world's ctx modules: core ones always, pluggable ones per config.
898
901
  * Pluggable classes are pulled dynamically, so a disabled module never reaches
@@ -925,100 +928,100 @@ async function createWorldModules(mode = "prod", options) {
925
928
  return modules;
926
929
  }
927
930
  //#endregion
928
- //#region packages/world-runtime/src/behaviours/registry.ts
931
+ //#region src/behaviours/registry.ts
929
932
  var entries = [
930
933
  {
931
934
  uuid: "spinning",
932
935
  name: "Spinning",
933
- load: () => loadDefault(import("./Spinning-sgUhHld8.js"))
936
+ load: () => loadDefault(import("./Spinning-DDhlLF3g.js"))
934
937
  },
935
938
  {
936
939
  uuid: "scalingtofro",
937
940
  name: "ScalingToFro",
938
- load: () => loadDefault(import("./ScalingToFro-BD-E5-uR.js"))
941
+ load: () => loadDefault(import("./ScalingToFro-CmXQHfR5.js"))
939
942
  },
940
943
  {
941
944
  uuid: "startanim",
942
945
  name: "StartAnimation",
943
- load: () => loadDefault(import("./StartAnimation-B9eomOS2.js"))
946
+ load: () => loadDefault(import("./StartAnimation-BbY1HgSj.js"))
944
947
  },
945
948
  {
946
949
  uuid: "pointerlockcameracontrols",
947
950
  name: "PointerLockCameraController",
948
- load: () => loadDefault(import("./PointerLockCameraControls-DYxxMeSw.js"))
951
+ load: () => loadDefault(import("./PointerLockCameraControls-Cq0m2NLS.js"))
949
952
  },
950
953
  {
951
954
  uuid: "simplewasdmovement",
952
955
  name: "SimpleWASDMovement",
953
- load: () => loadDefault(import("./SimpleWASDMovement-C2m53YYH.js"))
956
+ load: () => loadDefault(import("./SimpleWASDMovement-BYu0AFeG.js"))
954
957
  },
955
958
  {
956
959
  uuid: "fpscameracontroller",
957
960
  name: "FpsCameraController",
958
- load: () => loadDefault(import("./FpsCameraController-2GNWJM5D.js"))
961
+ load: () => loadDefault(import("./FpsCameraController-CuYDbMHJ.js"))
959
962
  },
960
963
  {
961
964
  uuid: "sightinteractablearea",
962
965
  name: "SightInteractableArea",
963
- load: () => loadDefault(import("./SightInteractableArea-DrqyB41W.js"))
966
+ load: () => loadDefault(import("./SightInteractableArea-C7xBqoQo.js"))
964
967
  },
965
968
  {
966
969
  uuid: "meshinstansing",
967
970
  name: "MeshInstansing",
968
- load: () => loadDefault(import("./MeshInstansing-Bxij0Yc9.js"))
971
+ load: () => loadDefault(import("./MeshInstansing-CSd1gjpu.js"))
969
972
  },
970
973
  {
971
974
  uuid: "rrb",
972
975
  name: "Rigidbody",
973
- load: () => loadDefault(import("./Rigidbody-DLhN8ddv.js").then((n) => n.n)),
976
+ load: () => loadDefault(import("./Rigidbody-BHRxJKXd.js").then((n) => n.n)),
974
977
  requiredPatch: rapierPhysicsPatch
975
978
  },
976
979
  {
977
980
  uuid: "rapierballcol",
978
981
  name: "BallCollider",
979
- load: () => loadDefault(import("./BallCollider-3L5vOrcL.js")),
982
+ load: () => loadDefault(import("./BallCollider-DdxrnexK.js")),
980
983
  requiredPatch: rapierPhysicsPatch
981
984
  },
982
985
  {
983
986
  uuid: "rapiercapscol",
984
987
  name: "CapsuleCollider",
985
- load: () => loadDefault(import("./CapsuleCollider-CBTsR-Ys.js")),
988
+ load: () => loadDefault(import("./CapsuleCollider-XlGZqg_O.js")),
986
989
  requiredPatch: rapierPhysicsPatch
987
990
  },
988
991
  {
989
992
  uuid: "rapierconecol",
990
993
  name: "ConeCollider",
991
- load: () => loadDefault(import("./ConeCollider-C3XU3Y9X.js")),
994
+ load: () => loadDefault(import("./ConeCollider-CQfGphDa.js")),
992
995
  requiredPatch: rapierPhysicsPatch
993
996
  },
994
997
  {
995
998
  uuid: "rapierconvxcol",
996
999
  name: "ConvexMeshCollider",
997
- load: () => loadDefault(import("./ConvexMeshCollider-DzNV4HTO.js")),
1000
+ load: () => loadDefault(import("./ConvexMeshCollider-0Q2u7QAL.js")),
998
1001
  requiredPatch: rapierPhysicsPatch
999
1002
  },
1000
1003
  {
1001
1004
  uuid: "rapiercubcol",
1002
1005
  name: "CuboidCollider",
1003
- load: () => loadDefault(import("./CuboidCollider-Dp1DZoFM.js")),
1006
+ load: () => loadDefault(import("./CuboidCollider-Cm7kKRMA.js")),
1004
1007
  requiredPatch: rapierPhysicsPatch
1005
1008
  },
1006
1009
  {
1007
1010
  uuid: "rapiercylcol",
1008
1011
  name: "CylinderCollider",
1009
- load: () => loadDefault(import("./CylinderCollider-C0h_nhB5.js")),
1012
+ load: () => loadDefault(import("./CylinderCollider-P2oZeEyb.js")),
1010
1013
  requiredPatch: rapierPhysicsPatch
1011
1014
  },
1012
1015
  {
1013
1016
  uuid: "rapiertricol",
1014
1017
  name: "TrimeshCollider",
1015
- load: () => loadDefault(import("./TrimeshCollider-7dIs_xtZ.js")),
1018
+ load: () => loadDefault(import("./TrimeshCollider-CGirnNOf.js")),
1016
1019
  requiredPatch: rapierPhysicsPatch
1017
1020
  },
1018
1021
  {
1019
1022
  uuid: "rapierfpsplayercontroller",
1020
1023
  name: "RapierFpsPlayerController",
1021
- load: () => loadDefault(import("./RapierFpsPlayerController-DthD8dw9.js")),
1024
+ load: () => loadDefault(import("./RapierFpsPlayerController-By_mnB5m.js")),
1022
1025
  requiredPatch: rapierPhysicsPatch
1023
1026
  }
1024
1027
  ];
@@ -1032,7 +1035,7 @@ async function loadDefault(module) {
1032
1035
  return (await module).default;
1033
1036
  }
1034
1037
  //#endregion
1035
- //#region packages/world-runtime/src/resources/font.ts
1038
+ //#region src/resources/font.ts
1036
1039
  var FORMAT_BY_MIME = {
1037
1040
  "font/ttf": "truetype",
1038
1041
  "font/otf": "opentype",
@@ -1094,7 +1097,7 @@ function createFont(url, family, mime, name) {
1094
1097
  return source;
1095
1098
  }
1096
1099
  //#endregion
1097
- //#region packages/world-runtime/src/addons/builtin-libs.ts
1100
+ //#region src/addons/builtin-libs.ts
1098
1101
  /**
1099
1102
  * Libraries the runtime bundles itself: `require("<key>")` hands these back in
1100
1103
  * every world, no config and no importer involved. Metadata (keys, labels) is
@@ -1121,7 +1124,7 @@ var BUILTIN_GLOBALS = {
1121
1124
  van
1122
1125
  };
1123
1126
  //#endregion
1124
- //#region packages/world-runtime/src/addons/required-libs.ts
1127
+ //#region src/addons/required-libs.ts
1125
1128
  /**
1126
1129
  * Libs the world needs beyond what `libs` lists: an enabled module or a built-in
1127
1130
  * behaviour on the scene declares them itself (`requiredLibs`), so physics keeps
@@ -1144,7 +1147,7 @@ function collectRequiredLibs(addons, usedBuiltinUuids = []) {
1144
1147
  return [...required];
1145
1148
  }
1146
1149
  //#endregion
1147
- //#region packages/world-runtime/src/addons/AddonsRuntime.ts
1150
+ //#region src/addons/AddonsRuntime.ts
1148
1151
  /**
1149
1152
  * External dependencies of the world: libs and external scripts. Built-in libs
1150
1153
  * are registered right away (the runtime bundles them), optional ones are loaded
@@ -1251,7 +1254,7 @@ function unwrapLib(id, module) {
1251
1254
  return module.default ?? module;
1252
1255
  }
1253
1256
  //#endregion
1254
- //#region packages/world-runtime/src/world-stores.ts
1257
+ //#region src/world-stores.ts
1255
1258
  /**
1256
1259
  * Shared reactive key-value state of a world (`world.stores` in scripts) — the
1257
1260
  * state counterpart of the `world.events` bus. Stores are created lazily on
@@ -1312,7 +1315,7 @@ var WorldStores = class {
1312
1315
  }
1313
1316
  };
1314
1317
  //#endregion
1315
- //#region packages/world-runtime/src/WorldRuntime.ts
1318
+ //#region src/WorldRuntime.ts
1316
1319
  /**
1317
1320
  * Owner of the world's runtime state: assets, script execution, ctx access.
1318
1321
  * The only object the generated code receives.
@@ -1574,10 +1577,10 @@ function isAbsoluteUrl(url) {
1574
1577
  return /^(?:[a-z]+:)?\/\//i.test(url) || url.startsWith("data:");
1575
1578
  }
1576
1579
  //#endregion
1577
- //#region packages/world-runtime/src/version.gen.ts
1578
- var RUNTIME_VERSION = "0.5.0";
1580
+ //#region src/version.gen.ts
1581
+ var RUNTIME_VERSION = "0.6.1";
1579
1582
  //#endregion
1580
- //#region packages/world-runtime/src/version.ts
1583
+ //#region src/version.ts
1581
1584
  /**
1582
1585
  * Format version of the generated world. The codegen stamps it into the artifact,
1583
1586
  * the runtime checks it on load. A breaking format change = package major bump.
@@ -1591,7 +1594,7 @@ function assertFormatVersion(version) {
1591
1594
  throw new Error(`@kvyverse/world-runtime: world format v${version} is not supported by runtime (expected v1). Re-export the world or pin a matching runtime version.`);
1592
1595
  }
1593
1596
  //#endregion
1594
- //#region packages/world-runtime/src/bootstrap.ts
1597
+ //#region src/bootstrap.ts
1595
1598
  /**
1596
1599
  * World assembly order. The only place where it is fixed: the artifact supplies
1597
1600
  * the data and steps, the runtime owns the sequence. Mirrors the game's
@@ -1642,7 +1645,7 @@ async function createWorld(definition, runtime) {
1642
1645
  scene: new THREE.Scene(),
1643
1646
  autoInitRenderer: false
1644
1647
  }, runtime);
1645
- world.addModules(await createWorldModules("prod", {
1648
+ world.addModules(await createWorldModules("selfhosted", {
1646
1649
  addons: runtime.addons,
1647
1650
  modules: runtime.definition.addons?.modules
1648
1651
  }));
@@ -1660,7 +1663,7 @@ async function createWorld(definition, runtime) {
1660
1663
  return world;
1661
1664
  }
1662
1665
  //#endregion
1663
- //#region packages/world-runtime/src/define-world.ts
1666
+ //#region src/define-world.ts
1664
1667
  /**
1665
1668
  * Entry point of the generated artifact: world definition → public `loadWorld`.
1666
1669
  * The codegen prints `export const { loadWorld } = defineWorld({ ... })`.
@@ -1669,7 +1672,7 @@ function defineWorld(definition) {
1669
1672
  return { loadWorld: (options = {}) => bootstrapWorld(definition, options) };
1670
1673
  }
1671
1674
  //#endregion
1672
- //#region packages/world-runtime/src/values.ts
1675
+ //#region src/values.ts
1673
1676
  /**
1674
1677
  * Writes a color into an object field, creating a `Color` if the slot is empty.
1675
1678
  * Mirrors the `$C` branch of `applyValues` — needed by generated code for fields
@@ -1686,7 +1689,7 @@ function setColor(target, key, hex) {
1686
1689
  holder[key] = new THREE.Color(hex);
1687
1690
  }
1688
1691
  //#endregion
1689
- //#region packages/world-runtime/src/resources/default-resources.ts
1692
+ //#region src/resources/default-resources.ts
1690
1693
  /**
1691
1694
  * Built-in engine resources with fixed uuids: world values reference them via
1692
1695
  * a regular ref (`{$A:"6"}`), so the identifiers must never change.
@@ -1757,7 +1760,7 @@ function isDefaultResourceId(uuid) {
1757
1760
  return DEFAULT_RESOURCE_IDS.includes(uuid);
1758
1761
  }
1759
1762
  //#endregion
1760
- //#region packages/world-runtime/src/resources/texture.ts
1763
+ //#region src/resources/texture.ts
1761
1764
  /**
1762
1765
  * World texture defaults: clamp wrapping switches to repeat, color space
1763
1766
  * is sRGB. Identical in the editor, the game and the exported world.
@@ -1775,7 +1778,7 @@ async function loadTexture(url, name) {
1775
1778
  return texture;
1776
1779
  }
1777
1780
  //#endregion
1778
- //#region packages/world-runtime/src/resources/model.ts
1781
+ //#region src/resources/model.ts
1779
1782
  /** Parses model bytes into a hierarchy. `data`: ArrayBuffer, for obj — text. */
1780
1783
  async function parseModel(data, format, name) {
1781
1784
  let root;
@@ -1844,7 +1847,7 @@ function collectModelSubResources(root) {
1844
1847
  };
1845
1848
  }
1846
1849
  //#endregion
1847
- //#region packages/world-runtime/src/resources/hdr.ts
1850
+ //#region src/resources/hdr.ts
1848
1851
  /** Parses hdr/exr into a `DataTexture` with environment defaults (equirect, no mipmaps). */
1849
1852
  async function parseHdr(data, format, name) {
1850
1853
  let texture;
@@ -1872,7 +1875,7 @@ async function loadHdr(url, format, name) {
1872
1875
  return parseHdr(await response.arrayBuffer(), format, name);
1873
1876
  }
1874
1877
  //#endregion
1875
- //#region packages/world-runtime/src/resources/geometry.ts
1878
+ //#region src/resources/geometry.ts
1876
1879
  /** Geometry from our json format (`BufferGeometry.toJSON`). */
1877
1880
  function parseGeometryJson(json, name) {
1878
1881
  const geometry = AssetLoaders.bufferGeometry.get().parse(json);
@@ -1886,7 +1889,7 @@ async function loadGeometry(url, name) {
1886
1889
  return parseGeometryJson(await response.json(), name);
1887
1890
  }
1888
1891
  //#endregion
1889
- //#region packages/world-runtime/src/resources/audio.ts
1892
+ //#region src/resources/audio.ts
1890
1893
  /**
1891
1894
  * Audio asset source: a `Howl` with identity — this is what scripts get
1892
1895
  * from `require("/Sounds/...")`.
@@ -1919,7 +1922,7 @@ function createAudio(url, format, name) {
1919
1922
  });
1920
1923
  }
1921
1924
  //#endregion
1922
- //#region packages/world-runtime/src/resources/video.ts
1925
+ //#region src/resources/video.ts
1923
1926
  /**
1924
1927
  * Video asset source: a `<video>` with identity — this is what scripts get
1925
1928
  * from `require("/Videos/...")` (and `THREE.VideoTexture` from `element`).
@@ -1976,7 +1979,7 @@ async function createVideo(url, name) {
1976
1979
  return source;
1977
1980
  }
1978
1981
  //#endregion
1979
- //#region packages/world-runtime/src/rendering/tsl-node.ts
1982
+ //#region src/rendering/tsl-node.ts
1980
1983
  /**
1981
1984
  * World TSL node: the built graph node + its uniform nodes. This is what
1982
1985
  * `require("/Shaders/....tsl")` returns, so the method set matches the editor's
@@ -2019,7 +2022,7 @@ function createTslNode(uniforms, build, name) {
2019
2022
  return new TslNode(uniforms, build, name);
2020
2023
  }
2021
2024
  //#endregion
2022
- //#region packages/world-runtime/src/rendering/tsl-uniforms.ts
2025
+ //#region src/rendering/tsl-uniforms.ts
2023
2026
  var UNIFORM_TYPES = [
2024
2027
  "float",
2025
2028
  "int",
@@ -2080,10 +2083,10 @@ var UNIFORM_DEFAULTS = {
2080
2083
  texture: () => getDefaultResource(DefaultResourceId.Texture)
2081
2084
  };
2082
2085
  //#endregion
2083
- //#region packages/world-runtime/src/addons/externals.ts
2086
+ //#region src/addons/externals.ts
2084
2087
  var EXTERNAL_TYPES = ["umd", "module"];
2085
2088
  //#endregion
2086
- //#region packages/world-runtime/src/rendering/renderer-options.ts
2089
+ //#region src/rendering/renderer-options.ts
2087
2090
  /**
2088
2091
  * String names for renderer options set as words in the config and mapped to
2089
2092
  * THREE constants at runtime (game). Single source for the JSON schema
@@ -1,4 +1,4 @@
1
- //#region packages/world-runtime/src/addons/lib-registry.ts
1
+ //#region src/addons/lib-registry.ts
2
2
  /**
3
3
  * Registry of the libraries scripts can `require`. One entry describes one
4
4
  * library; the flags say how it gets into the world:
@@ -1,11 +1,13 @@
1
1
  import { ContextModule } from "three-start";
2
2
  import type { EnvModuleApi } from "./contracts/env.module-api";
3
- /** Where the world runs: `dev` — testplay from the editor, `prod` — the game. */
3
+ /** Where the world runs: `dev` — editor testplay, `prod` — platform game,
4
+ * `selfhosted` — self-hosted export. */
4
5
  export type EnvMode = EnvModuleApi["mode"];
5
6
  export declare class EnvModule extends ContextModule implements EnvModuleApi {
6
- dev: boolean;
7
- prod: boolean;
8
- mode: EnvMode;
9
- isMobile: boolean;
7
+ readonly mode: EnvMode;
8
+ readonly dev: boolean;
9
+ readonly prod: boolean;
10
+ readonly selfHosted: boolean;
11
+ readonly isMobile: boolean;
10
12
  constructor(mode: EnvMode);
11
13
  }
@@ -1,7 +1,16 @@
1
- /** Public API of the `env` module — environment flags (dev/prod, mobile). */
1
+ /**
2
+ * Public API of the `env` module — where the world runs. Exactly one of
3
+ * `dev`/`prod`/`selfHosted` is true, matching `mode`. For "any real run, not
4
+ * editor testplay" use `!env.dev`.
5
+ */
2
6
  export interface EnvModuleApi {
7
+ /** Editor testplay run. */
3
8
  readonly dev: boolean;
9
+ /** Published game on the Kvyverse platform. */
4
10
  readonly prod: boolean;
5
- readonly mode: "dev" | "prod";
11
+ /** Self-hosted export, running outside the Kvyverse platform. */
12
+ readonly selfHosted: boolean;
13
+ /** Precise runtime context. */
14
+ readonly mode: "dev" | "prod" | "selfhosted";
6
15
  readonly isMobile: boolean;
7
16
  }
@@ -1 +1 @@
1
- export declare const RUNTIME_VERSION = "0.5.0";
1
+ export declare const RUNTIME_VERSION = "0.6.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvyverse/world-runtime",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Runtime for worlds exported from the Kvyverse platform for self-hosting",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Vladislav Kruteniuk",