@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,614 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkHHS6FMOU_cjs = require('./chunk-HHS6FMOU.cjs');
4
- var chunkQHVVVN47_cjs = require('./chunk-QHVVVN47.cjs');
5
- var chunkEGIZHYJP_cjs = require('./chunk-EGIZHYJP.cjs');
6
-
7
- // src/compiler/VRChatCompiler.ts
8
- var VRChatCompiler_exports = {};
9
- chunkEGIZHYJP_cjs.__export(VRChatCompiler_exports, {
10
- VRChatCompiler: () => exports.VRChatCompiler,
11
- compileToVRChat: () => compileToVRChat
12
- });
13
- function compileToVRChat(composition, options) {
14
- const compiler = new exports.VRChatCompiler(options);
15
- return Promise.resolve(compiler.compile(composition, ""));
16
- }
17
- exports.VRChatCompiler = void 0;
18
- var init_VRChatCompiler = chunkEGIZHYJP_cjs.__esm({
19
- "src/compiler/VRChatCompiler.ts"() {
20
- chunkQHVVVN47_cjs.init_CompilerBase();
21
- chunkQHVVVN47_cjs.init_ANSNamespace();
22
- chunkHHS6FMOU_cjs.init_DomainBlockCompilerMixin();
23
- exports.VRChatCompiler = class extends chunkQHVVVN47_cjs.CompilerBase {
24
- constructor(options = {}) {
25
- super();
26
- this.compilerName = "VRChatCompiler";
27
- this.lines = [];
28
- this.indentLevel = 0;
29
- this.udonScripts = /* @__PURE__ */ new Map();
30
- this.interactableObjects = [];
31
- this.options = {
32
- namespace: options.namespace || "HoloWorld",
33
- className: options.className || "GeneratedWorld",
34
- worldName: options.worldName || "HoloScript World",
35
- indent: options.indent || " ",
36
- sdkVersion: options.sdkVersion || "3.5",
37
- useUdonSharp: options.useUdonSharp ?? true
38
- };
39
- }
40
- getRequiredCapability() {
41
- return chunkQHVVVN47_cjs.ANSCapabilityPath.VRCHAT;
42
- }
43
- compile(composition, agentToken, outputPath) {
44
- this.validateCompilerAccess(agentToken, outputPath);
45
- this.lines = [];
46
- this.udonScripts.clear();
47
- this.interactableObjects = [];
48
- this.indentLevel = 0;
49
- const mainScript = this.generateMainScript(composition);
50
- this.generateUdonScripts(composition);
51
- const prefabHierarchy = this.generatePrefabHierarchy(composition);
52
- const worldDescriptor = this.generateWorldDescriptor(composition);
53
- return {
54
- mainScript,
55
- udonScripts: this.udonScripts,
56
- prefabHierarchy,
57
- worldDescriptor
58
- };
59
- }
60
- generateMainScript(composition) {
61
- this.lines = [];
62
- this.indentLevel = 0;
63
- this.emit("// Auto-generated by HoloScript VRChatCompiler");
64
- this.emit(
65
- `// Source: composition "${this.escapeStringValue(composition.name, "CSharp")}"`
66
- );
67
- this.emit(`// VRChat SDK: ${this.options.sdkVersion}`);
68
- this.emit("// Do not edit manually \xE2\u20AC\u201D regenerate from .holo source");
69
- this.emit("");
70
- this.emit("using UdonSharp;");
71
- this.emit("using UnityEngine;");
72
- this.emit("using VRC.SDKBase;");
73
- this.emit("using VRC.Udon;");
74
- this.emit("using VRC.SDK3.Components;");
75
- if (composition.audio?.length) {
76
- this.emit("using VRC.SDK3.Components.Audio;");
77
- }
78
- this.emit("");
79
- this.emit(`namespace ${this.options.namespace}`);
80
- this.emit("{");
81
- this.indentLevel++;
82
- this.emit("[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]");
83
- this.emit(`public class ${this.options.className} : UdonSharpBehaviour`);
84
- this.emit("{");
85
- this.indentLevel++;
86
- if (composition.state) {
87
- this.emit("// === Synced State ===");
88
- for (const prop of composition.state.properties) {
89
- const csType = this.toCSharpType(prop.value);
90
- const csVal = this.toCSharpValue(prop.value);
91
- this.emit(
92
- `[UdonSynced] public ${csType} ${this.escapeStringValue(prop.key, "CSharp")} = ${csVal};`
93
- );
94
- }
95
- this.emit("");
96
- }
97
- this.emit("// === Object References ===");
98
- this.emit('[Header("Scene Objects")]');
99
- const objects = composition.objects || [];
100
- for (const obj of objects) {
101
- const varName = this.sanitizeName(obj.name);
102
- this.emit(`public GameObject ${varName};`);
103
- }
104
- this.emit("");
105
- this.emit("void Start()");
106
- this.emit("{");
107
- this.indentLevel++;
108
- this.emit('Debug.Log("[HoloWorld] World initialized");');
109
- if (composition.environment) {
110
- this.compileEnvironment(composition.environment);
111
- }
112
- this.indentLevel--;
113
- this.emit("}");
114
- this.emit("");
115
- this.emit("public override void OnDeserialization()");
116
- this.emit("{");
117
- this.indentLevel++;
118
- this.emit("// Handle synced state updates");
119
- this.emit("UpdateVisuals();");
120
- this.indentLevel--;
121
- this.emit("}");
122
- this.emit("");
123
- this.emit("private void UpdateVisuals()");
124
- this.emit("{");
125
- this.indentLevel++;
126
- this.emit("// Update visuals based on synced state");
127
- this.indentLevel--;
128
- this.emit("}");
129
- this.emit("");
130
- this.emit("public override void OnPlayerJoined(VRCPlayerApi player)");
131
- this.emit("{");
132
- this.indentLevel++;
133
- this.emit("if (player.isLocal)");
134
- this.emit("{");
135
- this.indentLevel++;
136
- this.emit('Debug.Log($"[HoloWorld] Welcome, {player.displayName}!");');
137
- this.indentLevel--;
138
- this.emit("}");
139
- this.indentLevel--;
140
- this.emit("}");
141
- this.emit("");
142
- if (composition.zones) {
143
- for (const zone of composition.zones) {
144
- this.compileZoneTriggers(zone);
145
- }
146
- }
147
- if (composition.timelines) {
148
- for (const tl of composition.timelines) {
149
- this.compileTimeline(tl);
150
- }
151
- }
152
- if (composition.transitions) {
153
- for (const tr of composition.transitions) {
154
- this.compileTransition(tr);
155
- }
156
- }
157
- this.compileVRChatDomainBlocks(composition);
158
- this.indentLevel--;
159
- this.emit("}");
160
- this.indentLevel--;
161
- this.emit("}");
162
- return this.lines.join("\n");
163
- }
164
- compileVRChatDomainBlocks(composition) {
165
- const domainBlocks = composition.domainBlocks ?? [];
166
- if (domainBlocks.length === 0) return;
167
- this.emit("");
168
- this.emit("// === v4.2 Domain Blocks (VRChat/Unity) ===");
169
- let blockIdx = 0;
170
- const compiled = chunkHHS6FMOU_cjs.compileDomainBlocks(
171
- domainBlocks,
172
- {
173
- material: (block) => {
174
- const mat = chunkHHS6FMOU_cjs.compileMaterialBlock(block);
175
- return chunkHHS6FMOU_cjs.materialToVRChat(mat, `db${blockIdx++}`);
176
- },
177
- physics: (block) => {
178
- const phys = chunkHHS6FMOU_cjs.compilePhysicsBlock(block);
179
- return chunkHHS6FMOU_cjs.physicsToUnity(phys, `db${blockIdx++}`);
180
- },
181
- vfx: (block) => {
182
- const ps = chunkHHS6FMOU_cjs.compileParticleBlock(block);
183
- return chunkHHS6FMOU_cjs.particlesToUnity(ps, `db${blockIdx++}`);
184
- },
185
- postfx: (block) => {
186
- const pp = chunkHHS6FMOU_cjs.compilePostProcessingBlock(block);
187
- return chunkHHS6FMOU_cjs.postProcessingToUnity(pp);
188
- },
189
- audio: (block) => {
190
- const audio = chunkHHS6FMOU_cjs.compileAudioSourceBlock(block);
191
- return chunkHHS6FMOU_cjs.audioSourceToUnity(audio, `db${blockIdx++}`);
192
- },
193
- weather: (block) => {
194
- const weather = chunkHHS6FMOU_cjs.compileWeatherBlock(block);
195
- return chunkHHS6FMOU_cjs.weatherToUnity(weather);
196
- },
197
- narrative: (block) => {
198
- const narr = chunkHHS6FMOU_cjs.compileNarrativeBlock(block);
199
- return chunkHHS6FMOU_cjs.narrativeToVRChat(narr);
200
- },
201
- payment: (block) => {
202
- const pay = chunkHHS6FMOU_cjs.compilePaymentBlock(block);
203
- return chunkHHS6FMOU_cjs.paymentToVRChat(pay);
204
- },
205
- healthcare: (block) => {
206
- const h = chunkHHS6FMOU_cjs.compileHealthcareBlock(block);
207
- return chunkHHS6FMOU_cjs.healthcareToVRChat(h);
208
- },
209
- robotics: (block) => {
210
- const r = chunkHHS6FMOU_cjs.compileRoboticsBlock(block);
211
- return chunkHHS6FMOU_cjs.roboticsToVRChat(r);
212
- },
213
- iot: (block) => chunkHHS6FMOU_cjs.iotToVRChat(chunkHHS6FMOU_cjs.compileIoTBlock(block)),
214
- dataviz: (block) => chunkHHS6FMOU_cjs.datavizToVRChat(chunkHHS6FMOU_cjs.compileDataVizBlock(block)),
215
- education: (block) => chunkHHS6FMOU_cjs.educationToVRChat(chunkHHS6FMOU_cjs.compileEducationBlock(block)),
216
- music: (block) => chunkHHS6FMOU_cjs.musicToVRChat(chunkHHS6FMOU_cjs.compileMusicBlock(block)),
217
- architecture: (block) => chunkHHS6FMOU_cjs.architectureToVRChat(chunkHHS6FMOU_cjs.compileArchitectureBlock(block)),
218
- web3: (block) => chunkHHS6FMOU_cjs.web3ToVRChat(chunkHHS6FMOU_cjs.compileWeb3Block(block)),
219
- procedural: (block) => chunkHHS6FMOU_cjs.proceduralToVRChat(chunkHHS6FMOU_cjs.compileProceduralBlock(block)),
220
- rendering: (block) => chunkHHS6FMOU_cjs.renderingToVRChat(chunkHHS6FMOU_cjs.compileRenderingBlock(block)),
221
- navigation: (block) => chunkHHS6FMOU_cjs.navigationToVRChat(chunkHHS6FMOU_cjs.compileNavigationBlock(block)),
222
- input: (block) => chunkHHS6FMOU_cjs.inputToVRChat(chunkHHS6FMOU_cjs.compileInputBlock(block))
223
- },
224
- (block) => `// Domain block: ${block.domain}/${block.keyword} "${this.escapeStringValue(block.name, "CSharp")}"`
225
- );
226
- for (const line of compiled) {
227
- for (const l of line.split("\n")) {
228
- this.emit(l);
229
- }
230
- }
231
- }
232
- generateUdonScripts(composition) {
233
- const objects = composition.objects || [];
234
- for (const obj of objects) {
235
- if (!obj.traits) continue;
236
- const hasGrabbable = obj.traits.some((t) => t.name === "grabbable");
237
- const hasPointable = obj.traits.some((t) => t.name === "pointable" || t.name === "clickable");
238
- const hasNetworked = obj.traits.some((t) => t.name === "networked" || t.name === "synced");
239
- const hasPortal = obj.traits.some((t) => t.name === "portal");
240
- const hasMirror = obj.traits.some((t) => t.name === "mirror");
241
- if (hasGrabbable || hasPointable || hasNetworked || hasPortal || hasMirror) {
242
- const script = this.generateObjectUdonScript(obj, {
243
- hasGrabbable,
244
- hasPointable,
245
- hasNetworked,
246
- hasPortal,
247
- hasMirror
248
- });
249
- this.udonScripts.set(`${this.sanitizeName(obj.name)}Behaviour.cs`, script);
250
- this.interactableObjects.push(obj.name);
251
- }
252
- }
253
- }
254
- generateObjectUdonScript(obj, traits) {
255
- const lines = [];
256
- const varName = this.sanitizeName(obj.name);
257
- const className = `${varName}Behaviour`;
258
- lines.push("// Auto-generated UdonSharp script");
259
- lines.push(`// Object: ${this.escapeStringValue(obj.name, "CSharp")}`);
260
- lines.push("");
261
- lines.push("using UdonSharp;");
262
- lines.push("using UnityEngine;");
263
- lines.push("using VRC.SDKBase;");
264
- lines.push("using VRC.Udon;");
265
- lines.push("");
266
- const syncMode = traits.hasNetworked ? "BehaviourSyncMode.Manual" : "BehaviourSyncMode.None";
267
- lines.push(`[UdonBehaviourSyncMode(${syncMode})]`);
268
- lines.push(`public class ${className} : UdonSharpBehaviour`);
269
- lines.push("{");
270
- if (obj.state?.properties) {
271
- lines.push(" // === State ===");
272
- for (const prop of obj.state.properties) {
273
- const csType = this.toCSharpType(prop.value);
274
- const csVal = this.toCSharpValue(prop.value);
275
- const syncAttr = traits.hasNetworked ? "[UdonSynced] " : "";
276
- lines.push(
277
- ` ${syncAttr}public ${csType} ${this.escapeStringValue(prop.key, "CSharp")} = ${csVal};`
278
- );
279
- }
280
- lines.push("");
281
- }
282
- if (traits.hasGrabbable) {
283
- lines.push(" // VRC_Pickup compatible");
284
- lines.push(" public VRC_Pickup pickup;");
285
- lines.push("");
286
- lines.push(" public override void OnPickup()");
287
- lines.push(" {");
288
- lines.push(' Debug.Log($"[{gameObject.name}] Picked up");');
289
- if (traits.hasNetworked) {
290
- lines.push(" Networking.SetOwner(Networking.LocalPlayer, gameObject);");
291
- lines.push(" RequestSerialization();");
292
- }
293
- lines.push(" }");
294
- lines.push("");
295
- lines.push(" public override void OnDrop()");
296
- lines.push(" {");
297
- lines.push(' Debug.Log($"[{gameObject.name}] Dropped");');
298
- if (traits.hasNetworked) {
299
- lines.push(" RequestSerialization();");
300
- }
301
- lines.push(" }");
302
- lines.push("");
303
- }
304
- if (traits.hasPointable) {
305
- lines.push(" public override void Interact()");
306
- lines.push(" {");
307
- lines.push(' Debug.Log($"[{gameObject.name}] Interacted");');
308
- lines.push(" OnInteractHandler();");
309
- lines.push(" }");
310
- lines.push("");
311
- lines.push(" private void OnInteractHandler()");
312
- lines.push(" {");
313
- lines.push(" // Custom interaction logic based on traits");
314
- lines.push(" }");
315
- lines.push("");
316
- }
317
- if (traits.hasPortal) {
318
- const portalTrait = obj.traits?.find((t) => t.name === "portal");
319
- const destination = portalTrait?.config?.destination || "wrld_unknown";
320
- lines.push(' [Header("Portal Settings")]');
321
- lines.push(` public string destinationWorld = "${destination}";`);
322
- lines.push("");
323
- lines.push(" public override void Interact()");
324
- lines.push(" {");
325
- lines.push(" // VRChat portal \xE2\u20AC\u201D player will be teleported");
326
- lines.push(' Debug.Log($"Portal to {destinationWorld}");');
327
- lines.push(" }");
328
- lines.push("");
329
- }
330
- if (traits.hasNetworked) {
331
- lines.push(" public override void OnDeserialization()");
332
- lines.push(" {");
333
- lines.push(" // Handle network sync");
334
- lines.push(" UpdateFromNetwork();");
335
- lines.push(" }");
336
- lines.push("");
337
- lines.push(" private void UpdateFromNetwork()");
338
- lines.push(" {");
339
- lines.push(" // Apply synced state to visuals");
340
- lines.push(" }");
341
- lines.push("");
342
- }
343
- lines.push("}");
344
- return lines.join("\n");
345
- }
346
- generatePrefabHierarchy(composition) {
347
- const lines = [];
348
- lines.push(
349
- `# VRChat World Prefab Hierarchy: ${this.escapeStringValue(composition.name, "CSharp")}`
350
- );
351
- lines.push("# Generated by HoloScript VRChatCompiler");
352
- lines.push("");
353
- lines.push("World Root");
354
- lines.push("\xE2\u201D\u0153\xE2\u201D\u20AC\xE2\u201D\u20AC Environment");
355
- if (composition.lights) {
356
- lines.push("\xE2\u201D\u0153\xE2\u201D\u20AC\xE2\u201D\u20AC Lighting");
357
- for (const light of composition.lights) {
358
- lines.push(
359
- `\xE2\u201D\u201A \xE2\u201D\u201D\xE2\u201D\u20AC\xE2\u201D\u20AC ${this.escapeStringValue(light.name, "CSharp")} (${light.lightType})`
360
- );
361
- }
362
- }
363
- if (composition.objects) {
364
- lines.push("\xE2\u201D\u0153\xE2\u201D\u20AC\xE2\u201D\u20AC Objects");
365
- for (const obj of composition.objects) {
366
- const traits = obj.traits?.map((t) => `@${this.escapeStringValue(t.name, "CSharp")}`).join(" ") || "";
367
- lines.push(
368
- `\xE2\u201D\u201A \xE2\u201D\u201D\xE2\u201D\u20AC\xE2\u201D\u20AC ${this.escapeStringValue(obj.name, "CSharp")} ${traits}`
369
- );
370
- }
371
- }
372
- if (composition.spatialGroups) {
373
- for (const group of composition.spatialGroups) {
374
- lines.push(
375
- `\xE2\u201D\u0153\xE2\u201D\u20AC\xE2\u201D\u20AC ${this.escapeStringValue(group.name, "CSharp")} (SpatialGroup)`
376
- );
377
- for (const child of group.objects || []) {
378
- lines.push(
379
- `\xE2\u201D\u201A \xE2\u201D\u201D\xE2\u201D\u20AC\xE2\u201D\u20AC ${this.escapeStringValue(child.name, "CSharp")}`
380
- );
381
- }
382
- }
383
- }
384
- if (composition.audio) {
385
- lines.push("\xE2\u201D\u0153\xE2\u201D\u20AC\xE2\u201D\u20AC Audio");
386
- for (const audio of composition.audio) {
387
- lines.push(
388
- `\xE2\u201D\u201A \xE2\u201D\u201D\xE2\u201D\u20AC\xE2\u201D\u20AC ${this.escapeStringValue(audio.name, "CSharp")} (VRCSpatialAudioSource)`
389
- );
390
- }
391
- }
392
- if (composition.zones) {
393
- lines.push("\xE2\u201D\u0153\xE2\u201D\u20AC\xE2\u201D\u20AC Zones");
394
- for (const zone of composition.zones) {
395
- lines.push(
396
- `\xE2\u201D\u201A \xE2\u201D\u201D\xE2\u201D\u20AC\xE2\u201D\u20AC ${this.escapeStringValue(zone.name, "CSharp")} (Trigger)`
397
- );
398
- }
399
- }
400
- lines.push("\xE2\u201D\u0153\xE2\u201D\u20AC\xE2\u201D\u20AC VRCWorld (VRC_World)");
401
- lines.push("\xE2\u201D\u0153\xE2\u201D\u20AC\xE2\u201D\u20AC Spawn Points");
402
- lines.push("\xE2\u201D\u201A \xE2\u201D\u201D\xE2\u201D\u20AC\xE2\u201D\u20AC SpawnPoint_0");
403
- lines.push("\xE2\u201D\u201D\xE2\u201D\u20AC\xE2\u201D\u20AC Player Mods");
404
- return lines.join("\n");
405
- }
406
- generateWorldDescriptor(composition) {
407
- const lines = [];
408
- lines.push("// VRC_World Descriptor Settings");
409
- lines.push(`// World: ${this.options.worldName}`);
410
- lines.push("");
411
- lines.push("VRC_SceneDescriptor:");
412
- lines.push(` worldName: "${this.options.worldName}"`);
413
- lines.push(` worldId: "wrld_${this.generateWorldId()}"`);
414
- lines.push(" capacity: 32");
415
- lines.push(" recommendedCapacity: 16");
416
- lines.push(" respawnHeightY: -100");
417
- lines.push(" objectBehaviourAtRespawnHeight: Destroy");
418
- lines.push(" forbidUserPortals: false");
419
- lines.push(' unityVersion: "2022.3.22f1"');
420
- lines.push(` sdkVersion: "${this.options.sdkVersion}"`);
421
- lines.push("");
422
- lines.push("SpawnPoints:");
423
- lines.push(" - position: [0, 0, 0]");
424
- lines.push(" rotation: [0, 0, 0]");
425
- lines.push("");
426
- if (composition.camera) {
427
- lines.push("ReferenceCamera:");
428
- lines.push(" near: 0.01");
429
- lines.push(" far: 1000");
430
- }
431
- return lines.join("\n");
432
- }
433
- compileEnvironment(env) {
434
- this.emit("// === Environment Setup ===");
435
- for (const prop of env.properties) {
436
- if (prop.key === "skybox" || prop.key === "preset") {
437
- this.emit(`// Skybox: "${prop.value}" \xE2\u20AC\u201D set via VRChat scene settings`);
438
- } else if (prop.key === "ambient_light") {
439
- this.emit(`RenderSettings.ambientIntensity = ${prop.value}f;`);
440
- } else if (prop.key === "fog" && typeof prop.value === "object") {
441
- const fog = prop.value;
442
- this.emit("RenderSettings.fog = true;");
443
- if (fog.color) this.emit(`RenderSettings.fogColor = ${this.toColor(fog.color)};`);
444
- }
445
- }
446
- }
447
- compileZoneTriggers(zone) {
448
- const varName = this.sanitizeName(zone.name);
449
- this.emit(`// Zone: ${this.escapeStringValue(zone.name, "CSharp")}`);
450
- this.emit(`public void On${varName}Enter(VRCPlayerApi player)`);
451
- this.emit("{");
452
- this.indentLevel++;
453
- this.emit(
454
- `Debug.Log($"Player {player.displayName} entered ${this.escapeStringValue(zone.name, "CSharp")}");`
455
- );
456
- this.indentLevel--;
457
- this.emit("}");
458
- this.emit("");
459
- this.emit(`public void On${varName}Exit(VRCPlayerApi player)`);
460
- this.emit("{");
461
- this.indentLevel++;
462
- this.emit(
463
- `Debug.Log($"Player {player.displayName} exited ${this.escapeStringValue(zone.name, "CSharp")}");`
464
- );
465
- this.indentLevel--;
466
- this.emit("}");
467
- this.emit("");
468
- }
469
- compileTimeline(timeline) {
470
- const name = this.sanitizeName(timeline.name);
471
- this.emit(`// Timeline: ${this.escapeStringValue(timeline.name, "CSharp")}`);
472
- this.emit(`public void Play${name}()`);
473
- this.emit("{");
474
- this.indentLevel++;
475
- this.emit(`SendCustomEventDelayedSeconds("${name}Step0", 0f);`);
476
- this.indentLevel--;
477
- this.emit("}");
478
- this.emit("");
479
- for (let i = 0; i < timeline.entries.length; i++) {
480
- const entry = timeline.entries[i];
481
- const nextDelay = i < timeline.entries.length - 1 ? timeline.entries[i + 1].time - entry.time : 0;
482
- this.emit(`public void ${name}Step${i}()`);
483
- this.emit("{");
484
- this.indentLevel++;
485
- if (entry.action.kind === "animate") {
486
- this.emit(`// Animate ${entry.action.target}`);
487
- } else if (entry.action.kind === "emit") {
488
- this.emit(`SendCustomEvent("${entry.action.event}");`);
489
- } else if (entry.action.kind === "call") {
490
- this.emit(`${entry.action.method}();`);
491
- }
492
- if (nextDelay > 0) {
493
- this.emit(`SendCustomEventDelayedSeconds("${name}Step${i + 1}", ${nextDelay}f);`);
494
- } else if (timeline.loop && i === timeline.entries.length - 1) {
495
- this.emit(`SendCustomEventDelayedSeconds("${name}Step0", 0.1f);`);
496
- }
497
- this.indentLevel--;
498
- this.emit("}");
499
- this.emit("");
500
- }
501
- }
502
- compileTransition(transition) {
503
- const name = this.sanitizeName(transition.name);
504
- this.emit(`// Transition: ${this.escapeStringValue(transition.name, "CSharp")}`);
505
- this.emit(`public void ${name}Transition()`);
506
- this.emit("{");
507
- this.indentLevel++;
508
- const dest = transition.properties.find((p) => p.key === "destination" || p.key === "to");
509
- if (dest) {
510
- this.emit(`// Transition to: ${dest.value}`);
511
- }
512
- this.indentLevel--;
513
- this.emit("}");
514
- this.emit("");
515
- }
516
- generateWorldId() {
517
- const chars = "abcdef0123456789";
518
- let id = "";
519
- for (let i = 0; i < 8; i++) {
520
- id += chars[Math.floor(Math.random() * chars.length)];
521
- }
522
- return id + "-0000-0000-0000-000000000000";
523
- }
524
- // === Utility Methods ===
525
- emit(line) {
526
- const indent = this.options.indent.repeat(this.indentLevel);
527
- this.lines.push(indent + line);
528
- }
529
- sanitizeName(name) {
530
- return name.replace(/[^a-zA-Z0-9_]/g, "_").replace(/^[0-9]/, "_$&");
531
- }
532
- toCSharpType(value) {
533
- if (value === null) return "object";
534
- if (typeof value === "boolean") return "bool";
535
- if (typeof value === "number") return Number.isInteger(value) ? "int" : "float";
536
- if (typeof value === "string") return "string";
537
- if (Array.isArray(value)) {
538
- if (value.length === 3 && value.every((v) => typeof v === "number")) return "Vector3";
539
- if (value.length === 4 && value.every((v) => typeof v === "number")) return "Quaternion";
540
- return "object[]";
541
- }
542
- return "object";
543
- }
544
- toCSharpValue(value) {
545
- if (value === null) return "null";
546
- if (typeof value === "boolean") return value ? "true" : "false";
547
- if (typeof value === "number") return Number.isInteger(value) ? `${value}` : `${value}f`;
548
- if (typeof value === "string") return `"${this.escapeStringValue(value, "CSharp")}"`;
549
- if (Array.isArray(value)) {
550
- if (value.length === 3 && value.every((v) => typeof v === "number")) {
551
- return `new Vector3(${value[0]}f, ${value[1]}f, ${value[2]}f)`;
552
- }
553
- if (value.length === 4 && value.every((v) => typeof v === "number")) {
554
- return `new Quaternion(${value[0]}f, ${value[1]}f, ${value[2]}f, ${value[3]}f)`;
555
- }
556
- }
557
- return "null";
558
- }
559
- toColor(value) {
560
- if (typeof value === "string") {
561
- if (value.startsWith("#")) {
562
- const hex = value.slice(1);
563
- if (hex.length === 6) {
564
- const r = parseInt(hex.slice(0, 2), 16) / 255;
565
- const g = parseInt(hex.slice(2, 4), 16) / 255;
566
- const b = parseInt(hex.slice(4, 6), 16) / 255;
567
- return `new Color(${r}f, ${g}f, ${b}f)`;
568
- }
569
- }
570
- const colors = {
571
- red: "Color.red",
572
- green: "Color.green",
573
- blue: "Color.blue",
574
- white: "Color.white",
575
- black: "Color.black",
576
- yellow: "Color.yellow",
577
- cyan: "Color.cyan",
578
- magenta: "Color.magenta"
579
- };
580
- return colors[value.toLowerCase()] || "Color.white";
581
- }
582
- if (Array.isArray(value) && value.length >= 3) {
583
- const [r, g, b, a = 1] = value;
584
- return `new Color(${r}f, ${g}f, ${b}f, ${a}f)`;
585
- }
586
- return "Color.white";
587
- }
588
- // Collect all trait names for import optimization
589
- collectAllTraits(composition) {
590
- const traits = [];
591
- const addTraits = (obj) => {
592
- if (obj.traits) {
593
- for (const t of obj.traits) {
594
- if (!traits.includes(t.name)) traits.push(t.name);
595
- }
596
- }
597
- };
598
- for (const obj of composition.objects || []) addTraits(obj);
599
- for (const group of composition.spatialGroups || []) {
600
- for (const child of group.objects || []) {
601
- addTraits(child);
602
- }
603
- }
604
- return traits;
605
- }
606
- };
607
- }
608
- });
609
-
610
- exports.VRChatCompiler_exports = VRChatCompiler_exports;
611
- exports.compileToVRChat = compileToVRChat;
612
- exports.init_VRChatCompiler = init_VRChatCompiler;
613
- //# sourceMappingURL=chunk-DH5G2JUA.cjs.map
614
- //# sourceMappingURL=chunk-DH5G2JUA.cjs.map