@holoscript/core 6.0.3 → 7.0.0

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 (244) hide show
  1. package/README.md +40 -40
  2. package/dist/codebase/index.d.ts +25 -0
  3. package/dist/compiler/index.d.ts +82 -0
  4. package/dist/constants.d.ts +4 -0
  5. package/dist/coordinators/index.d.ts +189 -0
  6. package/dist/entries/interop.d.ts +9 -0
  7. package/dist/entries/scripting.d.ts +7 -0
  8. package/dist/index.d.ts +520 -19
  9. package/dist/paper-0c-spike/index.d.ts +29 -0
  10. package/dist/reconstruction/index.d.ts +78 -0
  11. package/dist/self-improvement/index.d.ts +0 -48
  12. package/dist/storage/index.d.ts +24 -0
  13. package/dist/tools/index.d.ts +33 -0
  14. package/dist/traitDocs/traitDocs.d.ts +69 -0
  15. package/dist/traits/index.d.ts +61 -0
  16. package/package.json +102 -19
  17. package/dist/GLTFPipeline-3KLWWUQO.cjs +0 -34
  18. package/dist/GLTFPipeline-LYII2ZVQ.js +0 -13
  19. package/dist/HoloScriptPlusParser-BZR5DELQ.js +0 -692
  20. package/dist/HoloScriptPlusParser-SBMYDNXO.cjs +0 -697
  21. package/dist/USDZExporter-MHEHXZB4.cjs +0 -709
  22. package/dist/USDZExporter-YA55ZS35.js +0 -707
  23. package/dist/chunk-26TLYBFD.js +0 -309
  24. package/dist/chunk-27LWW5FU.cjs +0 -410
  25. package/dist/chunk-2UX5LRAP.cjs +0 -833
  26. package/dist/chunk-32TWR3HE.js +0 -70
  27. package/dist/chunk-3FXV5S25.cjs +0 -633
  28. package/dist/chunk-3FYZOR7S.cjs +0 -69
  29. package/dist/chunk-3KEU5QYY.cjs +0 -175
  30. package/dist/chunk-4FCZDTD5.js +0 -610
  31. package/dist/chunk-4KJ2R7VP.cjs +0 -507
  32. package/dist/chunk-4SMUJFHL.js +0 -1213
  33. package/dist/chunk-54FHG2MX.js +0 -655
  34. package/dist/chunk-56IF4NTA.js +0 -56
  35. package/dist/chunk-5GLCTO44.js +0 -161
  36. package/dist/chunk-5TOFIR6L.js +0 -407
  37. package/dist/chunk-65RFOWZI.js +0 -765
  38. package/dist/chunk-6OQBLABR.js +0 -5240
  39. package/dist/chunk-6WNCRE6F.js +0 -126
  40. package/dist/chunk-74YCHHTE.js +0 -1872
  41. package/dist/chunk-7H5UNJZD.cjs +0 -1973
  42. package/dist/chunk-7KPI4EKH.cjs +0 -701
  43. package/dist/chunk-7LCYLPW2.cjs +0 -663
  44. package/dist/chunk-7N3JIJMT.js +0 -1395
  45. package/dist/chunk-7X2IEJIE.cjs +0 -2526
  46. package/dist/chunk-A6GO3DPZ.cjs +0 -1002
  47. package/dist/chunk-AC4BSHFV.js +0 -765
  48. package/dist/chunk-AIUXRS74.cjs +0 -3681
  49. package/dist/chunk-ARNKA274.cjs +0 -130
  50. package/dist/chunk-AW7WAELW.js +0 -975
  51. package/dist/chunk-BKIGPPVM.js +0 -629
  52. package/dist/chunk-BO2OKHIY.js +0 -6055
  53. package/dist/chunk-BU5ZAFMC.js +0 -115
  54. package/dist/chunk-BY3B7ZYV.cjs +0 -457
  55. package/dist/chunk-C2QHVHZF.js +0 -4066
  56. package/dist/chunk-C7BNX4XJ.js +0 -1043
  57. package/dist/chunk-CLYEIWA5.cjs +0 -408
  58. package/dist/chunk-CMYAWUX3.js +0 -4455
  59. package/dist/chunk-CN4NOESF.cjs +0 -416
  60. package/dist/chunk-CNVM7J3M.js +0 -883
  61. package/dist/chunk-CO2VM2DK.js +0 -1965
  62. package/dist/chunk-CQDOF3G7.cjs +0 -1404
  63. package/dist/chunk-DH5G2JUA.cjs +0 -614
  64. package/dist/chunk-DIEDKX5B.cjs +0 -660
  65. package/dist/chunk-DN7UFU63.cjs +0 -172
  66. package/dist/chunk-DXVCEFZB.js +0 -2027
  67. package/dist/chunk-EGIZHYJP.cjs +0 -85
  68. package/dist/chunk-EJA7G2C4.cjs +0 -428
  69. package/dist/chunk-ELLQPFAF.js +0 -830
  70. package/dist/chunk-EMO7HAKJ.cjs +0 -1875
  71. package/dist/chunk-ENV7K6XA.js +0 -282
  72. package/dist/chunk-EPWRXL6S.js +0 -2522
  73. package/dist/chunk-EUFLX2PI.js +0 -56956
  74. package/dist/chunk-F5LVGHNT.js +0 -449
  75. package/dist/chunk-FEFHPUEM.cjs +0 -6122
  76. package/dist/chunk-FF3Q7ADR.js +0 -380
  77. package/dist/chunk-GC3YU46J.js +0 -762
  78. package/dist/chunk-H6WMMLQK.cjs +0 -4492
  79. package/dist/chunk-H7XMORZI.js +0 -2731
  80. package/dist/chunk-HAN4V3PF.cjs +0 -2037
  81. package/dist/chunk-HBZYCASG.js +0 -4208
  82. package/dist/chunk-HF4OFY25.cjs +0 -4097
  83. package/dist/chunk-HHS6FMOU.cjs +0 -3813
  84. package/dist/chunk-HJJLD366.js +0 -1169
  85. package/dist/chunk-HKCVM6OK.cjs +0 -2237
  86. package/dist/chunk-HUFNKFA6.js +0 -698
  87. package/dist/chunk-I3XGTIHM.cjs +0 -1505
  88. package/dist/chunk-I6XZ5DZF.cjs +0 -488
  89. package/dist/chunk-IHOUYQIA.js +0 -406
  90. package/dist/chunk-ILRBGFVD.cjs +0 -72
  91. package/dist/chunk-KDB6BUMB.js +0 -3666
  92. package/dist/chunk-KUJRR4FJ.js +0 -657
  93. package/dist/chunk-KYM4XRFG.js +0 -421
  94. package/dist/chunk-L3Z2HIWJ.cjs +0 -793
  95. package/dist/chunk-LBPEZQAF.js +0 -2232
  96. package/dist/chunk-LER4WXW5.cjs +0 -286
  97. package/dist/chunk-LK5IAVH6.cjs +0 -1173
  98. package/dist/chunk-M6FU6S22.js +0 -2911
  99. package/dist/chunk-MWEFR6YQ.js +0 -1857
  100. package/dist/chunk-N5FTS757.cjs +0 -415
  101. package/dist/chunk-NCUHGRTZ.js +0 -752
  102. package/dist/chunk-NKRKT6V2.js +0 -69
  103. package/dist/chunk-NLPSZT4C.js +0 -630
  104. package/dist/chunk-NRUB55IT.cjs +0 -771
  105. package/dist/chunk-NTMZSDXM.cjs +0 -633
  106. package/dist/chunk-ODGMVILH.js +0 -9662
  107. package/dist/chunk-PBA6NXCT.cjs +0 -1216
  108. package/dist/chunk-PHENW4MQ.js +0 -65
  109. package/dist/chunk-PJMOXFPR.cjs +0 -1861
  110. package/dist/chunk-PLMYCCA4.js +0 -504
  111. package/dist/chunk-PPULB4GG.cjs +0 -9728
  112. package/dist/chunk-PQLGZKMC.cjs +0 -755
  113. package/dist/chunk-Q56TT7IL.js +0 -483
  114. package/dist/chunk-QHVVVN47.cjs +0 -2033
  115. package/dist/chunk-QWKUKVRE.js +0 -2026
  116. package/dist/chunk-RE3OKSYF.cjs +0 -424
  117. package/dist/chunk-RT7LJRSF.cjs +0 -57378
  118. package/dist/chunk-SPDELRRV.cjs +0 -319
  119. package/dist/chunk-SUCBB66F.js +0 -229
  120. package/dist/chunk-TSWTWZ42.cjs +0 -4214
  121. package/dist/chunk-UITWA6DV.cjs +0 -2829
  122. package/dist/chunk-UQW6SLM5.js +0 -172
  123. package/dist/chunk-V2ILLPHK.cjs +0 -237
  124. package/dist/chunk-V42NTCFH.js +0 -3645
  125. package/dist/chunk-VJ3L7CHT.cjs +0 -169
  126. package/dist/chunk-VJVCD5T5.cjs +0 -769
  127. package/dist/chunk-VK5AXKO3.js +0 -746
  128. package/dist/chunk-VSXOIUCF.cjs +0 -473
  129. package/dist/chunk-VZNKJZTT.cjs +0 -749
  130. package/dist/chunk-W76ETJTI.js +0 -678
  131. package/dist/chunk-WFJIDI2N.cjs +0 -424
  132. package/dist/chunk-WN3YF33G.cjs +0 -118
  133. package/dist/chunk-WUXIRGZP.cjs +0 -2915
  134. package/dist/chunk-WYH4GVZ5.js +0 -1488
  135. package/dist/chunk-X4YVN7H3.cjs +0 -888
  136. package/dist/chunk-X67XRI2T.js +0 -410
  137. package/dist/chunk-XDXZM3ZP.cjs +0 -1046
  138. package/dist/chunk-XH7SE4HH.cjs +0 -72
  139. package/dist/chunk-XNMEH2BI.js +0 -126
  140. package/dist/chunk-XSF76QRU.js +0 -468
  141. package/dist/chunk-XSUZMPVQ.cjs +0 -682
  142. package/dist/chunk-XUILI4KB.cjs +0 -430
  143. package/dist/chunk-Y5MUAYTO.js +0 -167
  144. package/dist/chunk-Y7VK5TH3.cjs +0 -129
  145. package/dist/chunk-YCMQQQ5U.cjs +0 -5244
  146. package/dist/chunk-YYXH45E2.js +0 -426
  147. package/dist/chunk-ZGTGVSTZ.js +0 -422
  148. package/dist/chunk-ZL6VJ6SN.js +0 -421
  149. package/dist/cli/holoscript-runner.cjs +0 -2258
  150. package/dist/cli/holoscript-runner.js +0 -2233
  151. package/dist/codebase/index.cjs +0 -336
  152. package/dist/codebase/index.js +0 -331
  153. package/dist/compiler/agent-inference.cjs +0 -29
  154. package/dist/compiler/agent-inference.js +0 -6
  155. package/dist/compiler/android-xr.cjs +0 -20
  156. package/dist/compiler/android-xr.js +0 -10
  157. package/dist/compiler/android.cjs +0 -21
  158. package/dist/compiler/android.js +0 -11
  159. package/dist/compiler/ar.cjs +0 -21
  160. package/dist/compiler/ar.js +0 -9
  161. package/dist/compiler/babylon.cjs +0 -18
  162. package/dist/compiler/babylon.js +0 -12
  163. package/dist/compiler/coco.cjs +0 -27
  164. package/dist/compiler/coco.js +0 -4
  165. package/dist/compiler/domain-block-utils.cjs +0 -595
  166. package/dist/compiler/domain-block-utils.js +0 -9
  167. package/dist/compiler/dtdl.cjs +0 -25
  168. package/dist/compiler/dtdl.js +0 -9
  169. package/dist/compiler/gltf-pipeline.cjs +0 -39
  170. package/dist/compiler/gltf-pipeline.js +0 -4
  171. package/dist/compiler/godot.cjs +0 -16
  172. package/dist/compiler/godot.js +0 -10
  173. package/dist/compiler/incremental.cjs +0 -30
  174. package/dist/compiler/incremental.js +0 -5
  175. package/dist/compiler/index.cjs +0 -1522
  176. package/dist/compiler/index.js +0 -1321
  177. package/dist/compiler/ios.cjs +0 -21
  178. package/dist/compiler/ios.js +0 -11
  179. package/dist/compiler/multi-layer.cjs +0 -27
  180. package/dist/compiler/multi-layer.js +0 -12
  181. package/dist/compiler/nodetoy.cjs +0 -23
  182. package/dist/compiler/nodetoy.js +0 -4
  183. package/dist/compiler/openxr.cjs +0 -16
  184. package/dist/compiler/openxr.js +0 -10
  185. package/dist/compiler/playcanvas.cjs +0 -17
  186. package/dist/compiler/playcanvas.js +0 -11
  187. package/dist/compiler/r3f.cjs +0 -35
  188. package/dist/compiler/r3f.js +0 -13
  189. package/dist/compiler/remotion.cjs +0 -23
  190. package/dist/compiler/remotion.js +0 -4
  191. package/dist/compiler/reproducibility.cjs +0 -39
  192. package/dist/compiler/reproducibility.js +0 -4
  193. package/dist/compiler/sdf.cjs +0 -22
  194. package/dist/compiler/sdf.js +0 -10
  195. package/dist/compiler/semantic-scene.cjs +0 -31
  196. package/dist/compiler/semantic-scene.js +0 -4
  197. package/dist/compiler/state.cjs +0 -18
  198. package/dist/compiler/state.js +0 -8
  199. package/dist/compiler/trait-composition.cjs +0 -27
  200. package/dist/compiler/trait-composition.js +0 -6
  201. package/dist/compiler/unity.cjs +0 -16
  202. package/dist/compiler/unity.js +0 -10
  203. package/dist/compiler/unreal.cjs +0 -20
  204. package/dist/compiler/unreal.js +0 -10
  205. package/dist/compiler/urdf.cjs +0 -46
  206. package/dist/compiler/urdf.js +0 -10
  207. package/dist/compiler/usd-physics.cjs +0 -24
  208. package/dist/compiler/usd-physics.js +0 -7
  209. package/dist/compiler/visionos.cjs +0 -16
  210. package/dist/compiler/visionos.js +0 -10
  211. package/dist/compiler/vrchat.cjs +0 -20
  212. package/dist/compiler/vrchat.js +0 -10
  213. package/dist/compiler/vrr.cjs +0 -22
  214. package/dist/compiler/vrr.js +0 -10
  215. package/dist/compiler/wasm.cjs +0 -34
  216. package/dist/compiler/wasm.js +0 -10
  217. package/dist/compiler/webgpu.cjs +0 -16
  218. package/dist/compiler/webgpu.js +0 -10
  219. package/dist/debugger.cjs +0 -21
  220. package/dist/debugger.js +0 -8
  221. package/dist/entries/interop.cjs +0 -62
  222. package/dist/entries/interop.js +0 -5
  223. package/dist/entries/scripting.cjs +0 -67
  224. package/dist/entries/scripting.js +0 -10
  225. package/dist/index.cjs +0 -61703
  226. package/dist/index.js +0 -58652
  227. package/dist/math/vec3.cjs +0 -57
  228. package/dist/math/vec3.js +0 -4
  229. package/dist/parser.cjs +0 -26
  230. package/dist/parser.js +0 -9
  231. package/dist/playwright-7DTEQCBD.cjs +0 -98673
  232. package/dist/playwright-BIZXMLD2.js +0 -98660
  233. package/dist/post-quantum-JTTAAGO3.cjs +0 -6
  234. package/dist/post-quantum-RVPVDEPI.js +0 -4
  235. package/dist/runtime.cjs +0 -16
  236. package/dist/runtime.js +0 -7
  237. package/dist/storage/index.cjs +0 -37
  238. package/dist/storage/index.js +0 -4
  239. package/dist/traits/index.cjs +0 -14331
  240. package/dist/traits/index.js +0 -12126
  241. package/dist/type-checker.cjs +0 -18
  242. package/dist/type-checker.js +0 -5
  243. package/dist/wot/index.cjs +0 -29
  244. package/dist/wot/index.js +0 -4
@@ -1,85 +0,0 @@
1
- 'use strict';
2
-
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __typeError = (msg) => {
10
- throw TypeError(msg);
11
- };
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
14
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
15
- }) : x)(function(x) {
16
- if (typeof require !== "undefined") return require.apply(this, arguments);
17
- throw Error('Dynamic require of "' + x + '" is not supported');
18
- });
19
- var __esm = (fn, res) => function __init() {
20
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
21
- };
22
- var __commonJS = (cb, mod) => function __require2() {
23
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
- };
25
- var __export = (target, all) => {
26
- for (var name in all)
27
- __defProp(target, name, { get: all[name], enumerable: true });
28
- };
29
- var __copyProps = (to, from, except, desc) => {
30
- if (from && typeof from === "object" || typeof from === "function") {
31
- for (let key of __getOwnPropNames(from))
32
- if (!__hasOwnProp.call(to, key) && key !== except)
33
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
- }
35
- return to;
36
- };
37
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
38
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
39
- // If the importer is in node compatibility mode or this is not an ESM
40
- // file that has been converted to a CommonJS file using a Babel-
41
- // compatible transform (i.e. "__esModule" has not been set), then set
42
- // "default" to the CommonJS "module.exports" for node compatibility.
43
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
44
- mod
45
- ));
46
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
47
- var __decorateClass = (decorators, target, key, kind) => {
48
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
49
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
50
- if (decorator = decorators[i])
51
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
52
- if (kind && result) __defProp(target, key, result);
53
- return result;
54
- };
55
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
56
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
57
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
58
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
59
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
60
- var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
61
- var __privateWrapper = (obj, member, setter, getter) => ({
62
- set _(value) {
63
- __privateSet(obj, member, value, setter);
64
- },
65
- get _() {
66
- return __privateGet(obj, member, getter);
67
- }
68
- });
69
-
70
- exports.__commonJS = __commonJS;
71
- exports.__decorateClass = __decorateClass;
72
- exports.__esm = __esm;
73
- exports.__export = __export;
74
- exports.__privateAdd = __privateAdd;
75
- exports.__privateGet = __privateGet;
76
- exports.__privateMethod = __privateMethod;
77
- exports.__privateSet = __privateSet;
78
- exports.__privateWrapper = __privateWrapper;
79
- exports.__publicField = __publicField;
80
- exports.__reExport = __reExport;
81
- exports.__require = __require;
82
- exports.__toCommonJS = __toCommonJS;
83
- exports.__toESM = __toESM;
84
- //# sourceMappingURL=chunk-EGIZHYJP.cjs.map
85
- //# sourceMappingURL=chunk-EGIZHYJP.cjs.map
@@ -1,428 +0,0 @@
1
- 'use strict';
2
-
3
- // src/compiler/SemanticSceneGraph.ts
4
- var DEFAULT_CONTEXT = {
5
- "@vocab": "https://holoscript.dev/schema/",
6
- schema: "https://schema.org/",
7
- hs: "https://holoscript.dev/schema/",
8
- xsd: "http://www.w3.org/2001/XMLSchema#",
9
- rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
10
- };
11
- function generateSemanticSceneGraph(composition, options = {}) {
12
- const generator = new SceneGraphGenerator(options);
13
- const graph = generator.convert(composition);
14
- return JSON.stringify(graph, null, options.pretty !== false ? 2 : void 0);
15
- }
16
- function generateSemanticSceneGraphObject(composition, options = {}) {
17
- const generator = new SceneGraphGenerator(options);
18
- return generator.convert(composition);
19
- }
20
- var SceneGraphGenerator = class {
21
- constructor(options = {}) {
22
- this.idCounter = 0;
23
- this.baseURI = options.baseURI ?? "urn:holoscript:";
24
- this.includeSourceLocations = options.includeSourceLocations ?? false;
25
- this.includeMetadata = options.includeMetadata ?? true;
26
- this.maxDepth = options.maxDepth ?? 10;
27
- this.contextExtensions = options.contextExtensions ?? {};
28
- }
29
- /**
30
- * Convert a HoloComposition into a JSON-LD scene graph.
31
- */
32
- convert(composition) {
33
- this.idCounter = 0;
34
- const context = {
35
- ...DEFAULT_CONTEXT,
36
- ...this.contextExtensions
37
- };
38
- const graph = {
39
- "@context": context,
40
- "@type": "hs:Composition",
41
- "@id": this.makeId(composition.name),
42
- "schema:name": composition.name
43
- };
44
- if (composition.objects?.length > 0) {
45
- graph["hs:objects"] = composition.objects.map((obj) => this.convertObject(obj));
46
- }
47
- if (composition.spatialGroups?.length > 0) {
48
- graph["hs:spatialGroups"] = composition.spatialGroups.map(
49
- (g) => this.convertSpatialGroup(g, 0)
50
- );
51
- }
52
- if (composition.lights?.length > 0) {
53
- graph["hs:lights"] = composition.lights.map((l) => this.convertLight(l));
54
- }
55
- if (composition.camera) {
56
- graph["hs:camera"] = this.convertCamera(composition.camera);
57
- }
58
- if (composition.timelines?.length > 0) {
59
- graph["hs:timelines"] = composition.timelines.map((t) => this.convertTimeline(t));
60
- }
61
- if (composition.audio?.length > 0) {
62
- graph["hs:audio"] = composition.audio.map((a) => this.convertAudio(a));
63
- }
64
- if (composition.zones?.length > 0) {
65
- graph["hs:zones"] = composition.zones.map((z) => this.convertZone(z));
66
- }
67
- if (composition.npcs?.length > 0) {
68
- graph["hs:npcs"] = composition.npcs.map((n) => this.convertNPC(n));
69
- }
70
- if ((composition.domainBlocks?.length ?? 0) > 0) {
71
- graph["hs:domainBlocks"] = composition.domainBlocks.map((d) => this.convertDomainBlock(d));
72
- }
73
- if (composition.shapes?.length > 0) {
74
- graph["hs:shapes"] = composition.shapes.map((s) => this.convertShape(s));
75
- }
76
- if (this.includeMetadata && composition.environment) {
77
- const envProps = {};
78
- for (const prop of composition.environment.properties) {
79
- envProps[prop.key] = this.serializeValue(prop.value);
80
- }
81
- graph["hs:environment"] = {
82
- "@type": "hs:Environment",
83
- ...envProps
84
- };
85
- }
86
- if (this.includeMetadata && composition.state) {
87
- const stateProps = {};
88
- for (const prop of composition.state.properties) {
89
- stateProps[prop.key] = this.serializeValue(prop.value);
90
- }
91
- graph["hs:state"] = {
92
- "@type": "hs:State",
93
- ...stateProps
94
- };
95
- }
96
- return graph;
97
- }
98
- // ---------------------------------------------------------------------------
99
- // Object conversion
100
- // ---------------------------------------------------------------------------
101
- convertObject(obj) {
102
- const node = {
103
- "@type": "hs:Object",
104
- "@id": this.makeId(obj.name),
105
- "schema:name": obj.name
106
- };
107
- if (obj.template) {
108
- node["hs:template"] = obj.template;
109
- }
110
- if (obj.properties?.length > 0) {
111
- const props = {};
112
- for (const prop of obj.properties) {
113
- props[prop.key] = this.serializeValue(prop.value);
114
- }
115
- node["hs:properties"] = props;
116
- }
117
- if (obj.traits?.length > 0) {
118
- node["hs:traits"] = obj.traits.map((t) => this.convertTrait(t));
119
- }
120
- if (obj.children?.length) {
121
- node["hs:children"] = obj.children.map((c) => this.convertObject(c));
122
- }
123
- if (obj.platformConstraint) {
124
- node["hs:platformConstraint"] = {
125
- include: obj.platformConstraint.include,
126
- exclude: obj.platformConstraint.exclude
127
- };
128
- }
129
- if (this.includeSourceLocations && obj.loc) {
130
- node["hs:sourceLocation"] = {
131
- startLine: obj.loc.start.line,
132
- startColumn: obj.loc.start.column,
133
- endLine: obj.loc.end.line,
134
- endColumn: obj.loc.end.column
135
- };
136
- }
137
- return node;
138
- }
139
- // ---------------------------------------------------------------------------
140
- // Trait conversion
141
- // ---------------------------------------------------------------------------
142
- convertTrait(trait) {
143
- const node = {
144
- "@type": "hs:Trait",
145
- "schema:name": trait.name
146
- };
147
- if (trait.config && Object.keys(trait.config).length > 0) {
148
- const config = {};
149
- for (const [key, val] of Object.entries(trait.config)) {
150
- config[key] = this.serializeValue(val);
151
- }
152
- node["hs:config"] = config;
153
- }
154
- return node;
155
- }
156
- // ---------------------------------------------------------------------------
157
- // Spatial group conversion
158
- // ---------------------------------------------------------------------------
159
- convertSpatialGroup(group, depth) {
160
- const node = {
161
- "@type": "hs:SpatialGroup",
162
- "@id": this.makeId(group.name),
163
- "schema:name": group.name
164
- };
165
- if (group.properties?.length > 0) {
166
- const props = {};
167
- for (const prop of group.properties) {
168
- props[prop.key] = this.serializeValue(prop.value);
169
- }
170
- node["hs:properties"] = props;
171
- }
172
- if (group.objects?.length > 0) {
173
- node["hs:objects"] = group.objects.map((o) => this.convertObject(o));
174
- }
175
- if (group.groups?.length && depth < this.maxDepth) {
176
- node["hs:children"] = group.groups.map((g) => this.convertSpatialGroup(g, depth + 1));
177
- }
178
- if (group.platformConstraint) {
179
- node["hs:platformConstraint"] = {
180
- include: group.platformConstraint.include,
181
- exclude: group.platformConstraint.exclude
182
- };
183
- }
184
- return node;
185
- }
186
- // ---------------------------------------------------------------------------
187
- // Light conversion
188
- // ---------------------------------------------------------------------------
189
- convertLight(light) {
190
- const node = {
191
- "@type": "hs:Light",
192
- "@id": this.makeId(light.name),
193
- "schema:name": light.name,
194
- "hs:lightType": light.lightType
195
- };
196
- if (light.properties?.length > 0) {
197
- const props = {};
198
- for (const prop of light.properties) {
199
- props[prop.key] = this.serializeValue(prop.value);
200
- }
201
- node["hs:properties"] = props;
202
- }
203
- return node;
204
- }
205
- // ---------------------------------------------------------------------------
206
- // Camera conversion
207
- // ---------------------------------------------------------------------------
208
- convertCamera(camera) {
209
- const node = {
210
- "@type": "hs:Camera",
211
- "hs:cameraType": camera.cameraType
212
- };
213
- if (camera.properties?.length > 0) {
214
- const props = {};
215
- for (const prop of camera.properties) {
216
- props[prop.key] = this.serializeValue(prop.value);
217
- }
218
- node["hs:properties"] = props;
219
- }
220
- return node;
221
- }
222
- // ---------------------------------------------------------------------------
223
- // Timeline conversion
224
- // ---------------------------------------------------------------------------
225
- convertTimeline(timeline) {
226
- const node = {
227
- "@type": "hs:Timeline",
228
- "@id": this.makeId(timeline.name),
229
- "schema:name": timeline.name
230
- };
231
- if (timeline.autoplay !== void 0) {
232
- node["hs:autoplay"] = timeline.autoplay;
233
- }
234
- if (timeline.loop !== void 0) {
235
- node["hs:loop"] = timeline.loop;
236
- }
237
- if (timeline.entries?.length > 0) {
238
- node["hs:entries"] = timeline.entries.map((e) => this.convertTimelineEntry(e));
239
- }
240
- return node;
241
- }
242
- convertTimelineEntry(entry) {
243
- const node = {
244
- "@type": "hs:TimelineEntry",
245
- "hs:time": entry.time,
246
- "hs:actionKind": entry.action.kind
247
- };
248
- if (entry.action.kind === "animate") {
249
- node["hs:target"] = entry.action.target;
250
- node["hs:animateProperties"] = entry.action.properties;
251
- } else if (entry.action.kind === "emit") {
252
- node["hs:event"] = entry.action.event;
253
- if (entry.action.data !== void 0) {
254
- node["hs:data"] = entry.action.data;
255
- }
256
- } else if (entry.action.kind === "call") {
257
- node["hs:method"] = entry.action.method;
258
- if (entry.action.args) {
259
- node["hs:args"] = entry.action.args;
260
- }
261
- }
262
- return node;
263
- }
264
- // ---------------------------------------------------------------------------
265
- // Audio conversion
266
- // ---------------------------------------------------------------------------
267
- convertAudio(audio) {
268
- const node = {
269
- "@type": "hs:Audio",
270
- "@id": this.makeId(audio.name),
271
- "schema:name": audio.name
272
- };
273
- if (audio.properties?.length > 0) {
274
- const props = {};
275
- for (const prop of audio.properties) {
276
- props[prop.key] = this.serializeValue(prop.value);
277
- }
278
- node["hs:properties"] = props;
279
- }
280
- return node;
281
- }
282
- // ---------------------------------------------------------------------------
283
- // Zone conversion
284
- // ---------------------------------------------------------------------------
285
- convertZone(zone) {
286
- const node = {
287
- "@type": "hs:Zone",
288
- "@id": this.makeId(zone.name),
289
- "schema:name": zone.name
290
- };
291
- if (zone.properties?.length > 0) {
292
- const props = {};
293
- for (const prop of zone.properties) {
294
- props[prop.key] = this.serializeValue(prop.value);
295
- }
296
- node["hs:properties"] = props;
297
- }
298
- if (zone.handlers?.length > 0) {
299
- node["hs:handlers"] = zone.handlers.map((h) => ({
300
- "@type": "hs:EventHandler",
301
- "hs:event": h.event
302
- }));
303
- }
304
- return node;
305
- }
306
- // ---------------------------------------------------------------------------
307
- // NPC conversion
308
- // ---------------------------------------------------------------------------
309
- convertNPC(npc) {
310
- const node = {
311
- "@type": "hs:NPC",
312
- "@id": this.makeId(npc.name),
313
- "schema:name": npc.name
314
- };
315
- if (npc.npcType) node["hs:npcType"] = npc.npcType;
316
- if (npc.model) node["hs:model"] = npc.model;
317
- if (npc.dialogueTree) node["hs:dialogueTree"] = npc.dialogueTree;
318
- if (npc.properties?.length > 0) {
319
- const props = {};
320
- for (const prop of npc.properties) {
321
- props[prop.key] = this.serializeValue(prop.value);
322
- }
323
- node["hs:properties"] = props;
324
- }
325
- if (npc.behaviors?.length > 0) {
326
- node["hs:behaviors"] = npc.behaviors.map((b) => ({
327
- "@type": "hs:Behavior",
328
- "schema:name": b.name,
329
- "hs:trigger": b.trigger,
330
- "hs:priority": b.priority
331
- }));
332
- }
333
- return node;
334
- }
335
- // ---------------------------------------------------------------------------
336
- // Domain block conversion
337
- // ---------------------------------------------------------------------------
338
- convertDomainBlock(block) {
339
- const node = {
340
- "@type": `hs:DomainBlock`,
341
- "@id": this.makeId(block.name),
342
- "schema:name": block.name,
343
- "hs:domain": block.domain,
344
- "hs:keyword": block.keyword
345
- };
346
- if (block.traits?.length > 0) {
347
- node["hs:traits"] = block.traits;
348
- }
349
- if (block.properties && Object.keys(block.properties).length > 0) {
350
- const props = {};
351
- for (const [key, val] of Object.entries(block.properties)) {
352
- props[key] = this.serializeValue(val);
353
- }
354
- node["hs:properties"] = props;
355
- }
356
- if (block.children?.length) {
357
- node["hs:children"] = block.children.map((c) => this.convertObject(c));
358
- }
359
- return node;
360
- }
361
- // ---------------------------------------------------------------------------
362
- // Shape conversion
363
- // ---------------------------------------------------------------------------
364
- convertShape(shape) {
365
- const node = {
366
- "@type": "hs:Shape",
367
- "@id": this.makeId(shape.name),
368
- "schema:name": shape.name,
369
- "hs:shapeType": shape.shapeType
370
- };
371
- if (shape.properties?.length > 0) {
372
- const props = {};
373
- for (const prop of shape.properties) {
374
- props[prop.key] = this.serializeValue(prop.value);
375
- }
376
- node["hs:properties"] = props;
377
- }
378
- return node;
379
- }
380
- // ---------------------------------------------------------------------------
381
- // Utility helpers
382
- // ---------------------------------------------------------------------------
383
- makeId(name) {
384
- const slug = name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
385
- return `${this.baseURI}${slug}-${this.idCounter++}`;
386
- }
387
- serializeValue(value) {
388
- if (value === null || value === void 0) return null;
389
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
390
- return value;
391
- }
392
- if (Array.isArray(value)) {
393
- return value.map((v) => this.serializeValue(v));
394
- }
395
- if (typeof value === "object" && "__bind" in value) {
396
- return {
397
- "@type": "hs:Binding",
398
- "hs:source": value.source,
399
- "hs:transform": value.transform
400
- };
401
- }
402
- if (typeof value === "object") {
403
- const result = {};
404
- for (const [k, v] of Object.entries(value)) {
405
- result[k] = this.serializeValue(v);
406
- }
407
- return result;
408
- }
409
- return value;
410
- }
411
- };
412
- var SemanticSceneGraph = class {
413
- static generate(composition, options) {
414
- return generateSemanticSceneGraph(composition, options);
415
- }
416
- static generateObject(composition, options) {
417
- return generateSemanticSceneGraphObject(composition, options);
418
- }
419
- };
420
- var SemanticSceneGraph_default = SemanticSceneGraph;
421
-
422
- exports.SceneGraphGenerator = SceneGraphGenerator;
423
- exports.SemanticSceneGraph = SemanticSceneGraph;
424
- exports.SemanticSceneGraph_default = SemanticSceneGraph_default;
425
- exports.generateSemanticSceneGraph = generateSemanticSceneGraph;
426
- exports.generateSemanticSceneGraphObject = generateSemanticSceneGraphObject;
427
- //# sourceMappingURL=chunk-EJA7G2C4.cjs.map
428
- //# sourceMappingURL=chunk-EJA7G2C4.cjs.map