mjswan 0.6.0 → 0.7.0-beta.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 (35) hide show
  1. package/README.md +19 -1
  2. package/dist/assets/{index-CfYNGtHq.js → index-Bx4wz487.js} +414 -414
  3. package/dist/assets/{mujoco-BSW5sYi-.js → mujoco-CSmtoTxq.js} +1 -1
  4. package/dist/index.html +1 -1
  5. package/dist/mjswan-engine-BrqJA_5D.wasm +0 -0
  6. package/dist/mjswan-engine-C887KxcQ.wasm +0 -0
  7. package/dist/mjswan-engine-CmckSge4.wasm +0 -0
  8. package/dist/mjswan.js +78332 -0
  9. package/dist/mujoco--NkVzcP_.js +4618 -0
  10. package/dist/mujoco-5FTsXq0z.js +4614 -0
  11. package/lib.d.ts +22 -0
  12. package/package.json +17 -5
  13. package/src/core/appConfig.ts +132 -0
  14. package/src/core/command/TrackingCommand.ts +52 -2
  15. package/src/core/dsl/interpreter.ts +80 -0
  16. package/src/core/dsl/primitives.ts +549 -0
  17. package/src/core/dsl/types.ts +23 -0
  18. package/src/core/engine/runtime.ts +122 -25
  19. package/src/core/event/DslEvent.ts +185 -0
  20. package/src/core/event/EventManager.ts +16 -0
  21. package/src/core/event/events.ts +3 -154
  22. package/src/core/observation/DslObservation.ts +86 -0
  23. package/src/core/observation/ObservationBase.ts +3 -0
  24. package/src/core/observation/observations.ts +8 -1245
  25. package/src/core/policy/PolicyRunner.ts +63 -8
  26. package/src/core/policy/PolicyStateBuilder.ts +44 -0
  27. package/src/core/policy/types.ts +14 -5
  28. package/src/core/scene/npz.ts +34 -1
  29. package/src/core/scene/scene.ts +3 -3
  30. package/src/core/termination/DslTermination.ts +45 -0
  31. package/src/core/termination/TerminationManager.ts +24 -1
  32. package/src/core/termination/terminations.ts +4 -87
  33. package/src/core/utils/mujocoAssetCollector.ts +4 -2
  34. package/src/core/utils/pathUtils.ts +20 -0
  35. package/src/core/observation/CommandObservation.ts +0 -223
package/README.md CHANGED
@@ -31,6 +31,24 @@ A React + TypeScript application that runs MuJoCo physics simulations entirely i
31
31
  npm install mjswan
32
32
  ```
33
33
 
34
+ ## Embedding a published simulation (`mount`)
35
+
36
+ The package ships a self-contained library build (`dist/mjswan.js`) that renders
37
+ a published mjswan simulation into any element. It bundles every dependency and
38
+ co-locates its WASM, so it can be loaded directly from a CDN:
39
+
40
+ ```js
41
+ const { mount } = await import(
42
+ 'https://cdn.jsdelivr.net/npm/mjswan@<version>/dist/mjswan.js'
43
+ );
44
+ // configUrl points at a published simulation's config.json; every other asset
45
+ // (scene.mjz, policy.onnx/json, motion.npz, splats) resolves relative to it.
46
+ await mount(container, 'https://cdn.mjswan.com/mjswan/scenes/<id>/config.json');
47
+ ```
48
+
49
+ It runs single-threaded by default (no COOP/COEP needed) and works cross-origin.
50
+ See mjswan-cloud ADR 0001.
51
+
34
52
  ## Development
35
53
 
36
54
  ```bash
@@ -150,4 +168,4 @@ Apache-2.0
150
168
  ## Links
151
169
 
152
170
  - **Repository**: [github.com/ttktjmt/mjswan](https://github.com/ttktjmt/mjswan)
153
- - **Author**: Tatsuki Tsujimoto (tatsuki.tsujimoto@gmail.com)
171
+ - **Author**: Tatsuki Tsujimoto