@holoscript/core 6.0.4 → 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 (236) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/dist/compiler/index.d.ts +82 -0
  4. package/dist/constants.d.ts +3 -2
  5. package/dist/coordinators/index.d.ts +189 -0
  6. package/dist/index.d.ts +501 -19
  7. package/dist/paper-0c-spike/index.d.ts +29 -0
  8. package/dist/reconstruction/index.d.ts +78 -0
  9. package/dist/tools/index.d.ts +22 -1
  10. package/dist/traitDocs/traitDocs.d.ts +69 -0
  11. package/dist/traits/index.d.ts +61 -0
  12. package/package.json +105 -57
  13. package/dist/GLTFPipeline-DEN36VNK.js +0 -12
  14. package/dist/GLTFPipeline-YPCAK236.cjs +0 -33
  15. package/dist/HoloScriptPlusParser-BN6KVRCM.js +0 -692
  16. package/dist/HoloScriptPlusParser-NC5FE6AL.cjs +0 -697
  17. package/dist/USDZExporter-NTMBNTDB.js +0 -707
  18. package/dist/USDZExporter-UWGWNMMD.cjs +0 -709
  19. package/dist/chunk-27LWW5FU.cjs +0 -410
  20. package/dist/chunk-2CWOLHTE.js +0 -69
  21. package/dist/chunk-33LSUQDD.cjs +0 -835
  22. package/dist/chunk-3FJCK5XA.js +0 -2232
  23. package/dist/chunk-3FXV5S25.cjs +0 -633
  24. package/dist/chunk-3FYZOR7S.cjs +0 -69
  25. package/dist/chunk-3SAK5KFL.cjs +0 -83
  26. package/dist/chunk-4XSNJCLC.cjs +0 -1859
  27. package/dist/chunk-54FHG2MX.js +0 -655
  28. package/dist/chunk-56IF4NTA.js +0 -56
  29. package/dist/chunk-5BGSECRJ.cjs +0 -2237
  30. package/dist/chunk-5GLCTO44.js +0 -161
  31. package/dist/chunk-5O6TQC6M.cjs +0 -1871
  32. package/dist/chunk-5OEOHAAW.cjs +0 -682
  33. package/dist/chunk-5TOFIR6L.js +0 -407
  34. package/dist/chunk-5WUNN6ZN.cjs +0 -428
  35. package/dist/chunk-6TZPZCOJ.cjs +0 -1404
  36. package/dist/chunk-6UEHYZ7V.cjs +0 -773
  37. package/dist/chunk-6XSERL6L.js +0 -5678
  38. package/dist/chunk-72EQECGT.cjs +0 -908
  39. package/dist/chunk-7AGYRWKW.cjs +0 -507
  40. package/dist/chunk-7LCYLPW2.cjs +0 -663
  41. package/dist/chunk-A7PIMZGU.js +0 -263
  42. package/dist/chunk-ATSKSYVE.cjs +0 -51683
  43. package/dist/chunk-B5TCIAPQ.cjs +0 -117
  44. package/dist/chunk-BF2235SI.cjs +0 -5714
  45. package/dist/chunk-BKIGPPVM.js +0 -629
  46. package/dist/chunk-BND3ST2K.cjs +0 -662
  47. package/dist/chunk-BU7VWW2K.js +0 -2522
  48. package/dist/chunk-BWFJEM5A.js +0 -5419
  49. package/dist/chunk-CAUCGUEA.cjs +0 -130
  50. package/dist/chunk-CBJSLA2E.cjs +0 -5423
  51. package/dist/chunk-CDPGV4DN.js +0 -114
  52. package/dist/chunk-CLYEIWA5.cjs +0 -408
  53. package/dist/chunk-CS2EMTGF.js +0 -1966
  54. package/dist/chunk-DMG7C4H2.js +0 -975
  55. package/dist/chunk-DXJQDCFL.js +0 -468
  56. package/dist/chunk-E3FWRT3Z.js +0 -608
  57. package/dist/chunk-E3UALNFA.js +0 -421
  58. package/dist/chunk-EONILVMF.js +0 -762
  59. package/dist/chunk-EQV4R3EV.cjs +0 -769
  60. package/dist/chunk-F3HH56EB.cjs +0 -5538
  61. package/dist/chunk-F4IULT7N.js +0 -1488
  62. package/dist/chunk-FF3Q7ADR.js +0 -380
  63. package/dist/chunk-FFKU7BTK.cjs +0 -1046
  64. package/dist/chunk-FHQVYCH2.js +0 -70
  65. package/dist/chunk-FSF7EQVA.cjs +0 -1974
  66. package/dist/chunk-G4VZTCIB.js +0 -659
  67. package/dist/chunk-G7CT3EMP.cjs +0 -1002
  68. package/dist/chunk-GGHSW2NN.js +0 -51334
  69. package/dist/chunk-GVUR45UF.cjs +0 -777
  70. package/dist/chunk-H5Z7NASB.js +0 -9662
  71. package/dist/chunk-HE7ULERA.cjs +0 -697
  72. package/dist/chunk-HJJLD366.js +0 -1169
  73. package/dist/chunk-HPS76H7Q.js +0 -309
  74. package/dist/chunk-HQUEA5R6.cjs +0 -424
  75. package/dist/chunk-HYNTS5CP.js +0 -422
  76. package/dist/chunk-I6XZ5DZF.cjs +0 -488
  77. package/dist/chunk-IBDG74G2.cjs +0 -1219
  78. package/dist/chunk-IFNQFCTM.js +0 -3098
  79. package/dist/chunk-IHOUYQIA.js +0 -406
  80. package/dist/chunk-ILRBGFVD.cjs +0 -72
  81. package/dist/chunk-IWI6J7FX.js +0 -421
  82. package/dist/chunk-K3JDKWGI.cjs +0 -270
  83. package/dist/chunk-K6EKD26I.js +0 -630
  84. package/dist/chunk-KCQ5NDYC.cjs +0 -3172
  85. package/dist/chunk-KED34ILP.js +0 -832
  86. package/dist/chunk-KSGXLT74.cjs +0 -457
  87. package/dist/chunk-L4G4RLXX.js +0 -767
  88. package/dist/chunk-LDP5OK6G.js +0 -1216
  89. package/dist/chunk-LGGRPKTV.cjs +0 -735
  90. package/dist/chunk-LK5IAVH6.cjs +0 -1173
  91. package/dist/chunk-LSW7P7ML.js +0 -3675
  92. package/dist/chunk-LXJ4667L.cjs +0 -3874
  93. package/dist/chunk-LZ266PCM.cjs +0 -4499
  94. package/dist/chunk-MD6KDHVE.cjs +0 -237
  95. package/dist/chunk-MEASWI2Y.js +0 -126
  96. package/dist/chunk-MPXBVFHQ.js +0 -768
  97. package/dist/chunk-N5FTS757.cjs +0 -415
  98. package/dist/chunk-NCUKG4SK.cjs +0 -3075
  99. package/dist/chunk-NDQNIJEH.js +0 -1715
  100. package/dist/chunk-NOZZ46QU.js +0 -168
  101. package/dist/chunk-OFKWH2IP.js +0 -449
  102. package/dist/chunk-PHENW4MQ.js +0 -65
  103. package/dist/chunk-PMGODDJA.cjs +0 -319
  104. package/dist/chunk-Q4QX3AET.cjs +0 -1505
  105. package/dist/chunk-Q56TT7IL.js +0 -483
  106. package/dist/chunk-Q5JT3YML.cjs +0 -129
  107. package/dist/chunk-Q5SJOGHQ.cjs +0 -4256
  108. package/dist/chunk-QGKNANZ3.js +0 -3071
  109. package/dist/chunk-QLEAOI3Q.cjs +0 -424
  110. package/dist/chunk-R7MA7QWV.js +0 -732
  111. package/dist/chunk-RVYPEYPX.js +0 -678
  112. package/dist/chunk-S2N5TNMA.js +0 -1855
  113. package/dist/chunk-S565K7NK.js +0 -752
  114. package/dist/chunk-SDAMZIRE.js +0 -765
  115. package/dist/chunk-T36DDXSF.js +0 -4250
  116. package/dist/chunk-T4NKMBDL.js +0 -5474
  117. package/dist/chunk-T7LEXZUZ.cjs +0 -2526
  118. package/dist/chunk-TEWCN33Y.js +0 -694
  119. package/dist/chunk-TQSZUOW5.cjs +0 -793
  120. package/dist/chunk-TSH3MSQU.cjs +0 -129
  121. package/dist/chunk-UERJ3YJV.js +0 -504
  122. package/dist/chunk-UPJBDCVF.js +0 -1395
  123. package/dist/chunk-V3NN3HPP.js +0 -4462
  124. package/dist/chunk-VJ3L7CHT.cjs +0 -169
  125. package/dist/chunk-WB4Z63GG.js +0 -229
  126. package/dist/chunk-WDW67DZB.cjs +0 -9728
  127. package/dist/chunk-WGMEAYBG.js +0 -126
  128. package/dist/chunk-X4ZF6CNE.cjs +0 -473
  129. package/dist/chunk-X6SEAXAX.cjs +0 -3681
  130. package/dist/chunk-XCWFGZAA.js +0 -1043
  131. package/dist/chunk-XD6IYDUX.js +0 -903
  132. package/dist/chunk-XG23EUQX.cjs +0 -1717
  133. package/dist/chunk-XRKWN5PL.cjs +0 -173
  134. package/dist/chunk-XUILI4KB.cjs +0 -430
  135. package/dist/chunk-XUTX5CBW.js +0 -126
  136. package/dist/chunk-XWPNTWDN.cjs +0 -755
  137. package/dist/chunk-XXINBTZK.cjs +0 -633
  138. package/dist/chunk-YCXFCXDS.js +0 -1868
  139. package/dist/chunk-YQK5JNFK.js +0 -3725
  140. package/dist/chunk-YYXH45E2.js +0 -426
  141. package/dist/chunk-Z34RLXRA.cjs +0 -612
  142. package/dist/chunk-ZP4D3CSX.cjs +0 -72
  143. package/dist/cli/holoscript-runner.cjs +0 -2259
  144. package/dist/cli/holoscript-runner.js +0 -2234
  145. package/dist/codebase/index.cjs +0 -336
  146. package/dist/codebase/index.js +0 -331
  147. package/dist/compiler/agent-inference.cjs +0 -28
  148. package/dist/compiler/agent-inference.js +0 -5
  149. package/dist/compiler/android-xr.cjs +0 -19
  150. package/dist/compiler/android-xr.js +0 -9
  151. package/dist/compiler/android.cjs +0 -20
  152. package/dist/compiler/android.js +0 -10
  153. package/dist/compiler/ar.cjs +0 -20
  154. package/dist/compiler/ar.js +0 -8
  155. package/dist/compiler/babylon.cjs +0 -17
  156. package/dist/compiler/babylon.js +0 -11
  157. package/dist/compiler/coco.cjs +0 -27
  158. package/dist/compiler/coco.js +0 -4
  159. package/dist/compiler/domain-block-utils.cjs +0 -602
  160. package/dist/compiler/domain-block-utils.js +0 -8
  161. package/dist/compiler/dtdl.cjs +0 -24
  162. package/dist/compiler/dtdl.js +0 -8
  163. package/dist/compiler/gltf-pipeline.cjs +0 -39
  164. package/dist/compiler/gltf-pipeline.js +0 -4
  165. package/dist/compiler/godot.cjs +0 -15
  166. package/dist/compiler/godot.js +0 -9
  167. package/dist/compiler/incremental.cjs +0 -29
  168. package/dist/compiler/incremental.js +0 -4
  169. package/dist/compiler/index.cjs +0 -2578
  170. package/dist/compiler/index.js +0 -2383
  171. package/dist/compiler/ios.cjs +0 -20
  172. package/dist/compiler/ios.js +0 -10
  173. package/dist/compiler/multi-layer.cjs +0 -20
  174. package/dist/compiler/multi-layer.js +0 -11
  175. package/dist/compiler/nodetoy.cjs +0 -23
  176. package/dist/compiler/nodetoy.js +0 -4
  177. package/dist/compiler/openxr.cjs +0 -15
  178. package/dist/compiler/openxr.js +0 -9
  179. package/dist/compiler/playcanvas.cjs +0 -16
  180. package/dist/compiler/playcanvas.js +0 -10
  181. package/dist/compiler/r3f.cjs +0 -34
  182. package/dist/compiler/r3f.js +0 -12
  183. package/dist/compiler/remotion.cjs +0 -23
  184. package/dist/compiler/remotion.js +0 -4
  185. package/dist/compiler/reproducibility.cjs +0 -39
  186. package/dist/compiler/reproducibility.js +0 -4
  187. package/dist/compiler/sdf.cjs +0 -21
  188. package/dist/compiler/sdf.js +0 -9
  189. package/dist/compiler/semantic-scene.cjs +0 -31
  190. package/dist/compiler/semantic-scene.js +0 -4
  191. package/dist/compiler/state.cjs +0 -17
  192. package/dist/compiler/state.js +0 -7
  193. package/dist/compiler/trait-composition.cjs +0 -26
  194. package/dist/compiler/trait-composition.js +0 -5
  195. package/dist/compiler/unity.cjs +0 -15
  196. package/dist/compiler/unity.js +0 -9
  197. package/dist/compiler/unreal.cjs +0 -19
  198. package/dist/compiler/unreal.js +0 -9
  199. package/dist/compiler/urdf.cjs +0 -45
  200. package/dist/compiler/urdf.js +0 -9
  201. package/dist/compiler/usd-physics.cjs +0 -23
  202. package/dist/compiler/usd-physics.js +0 -6
  203. package/dist/compiler/visionos.cjs +0 -15
  204. package/dist/compiler/visionos.js +0 -9
  205. package/dist/compiler/vrchat.cjs +0 -19
  206. package/dist/compiler/vrchat.js +0 -9
  207. package/dist/compiler/vrr.cjs +0 -21
  208. package/dist/compiler/vrr.js +0 -9
  209. package/dist/compiler/wasm.cjs +0 -33
  210. package/dist/compiler/wasm.js +0 -9
  211. package/dist/compiler/webgpu.cjs +0 -15
  212. package/dist/compiler/webgpu.js +0 -9
  213. package/dist/debugger.cjs +0 -21
  214. package/dist/debugger.js +0 -8
  215. package/dist/entries/interop.cjs +0 -62
  216. package/dist/entries/interop.js +0 -5
  217. package/dist/entries/scripting.cjs +0 -68
  218. package/dist/entries/scripting.js +0 -11
  219. package/dist/index.cjs +0 -40921
  220. package/dist/index.js +0 -37763
  221. package/dist/math/vec3.cjs +0 -57
  222. package/dist/math/vec3.js +0 -4
  223. package/dist/ml-dsa-PHCWUBPX.cjs +0 -1178
  224. package/dist/ml-dsa-WYLJHJO6.js +0 -1178
  225. package/dist/parser.cjs +0 -27
  226. package/dist/parser.js +0 -10
  227. package/dist/playwright-5OSAPTNH.js +0 -98660
  228. package/dist/playwright-RL6GY4F7.cjs +0 -98673
  229. package/dist/runtime.cjs +0 -16
  230. package/dist/runtime.js +0 -7
  231. package/dist/storage/index.cjs +0 -37
  232. package/dist/storage/index.js +0 -4
  233. package/dist/traits/index.cjs +0 -14649
  234. package/dist/traits/index.js +0 -12243
  235. package/dist/type-checker.cjs +0 -18
  236. package/dist/type-checker.js +0 -5
@@ -1,768 +0,0 @@
1
- import { init_constants, VR_TRAITS } from './chunk-NDQNIJEH.js';
2
-
3
- // src/constants.ts
4
- init_constants();
5
- init_constants();
6
- var STRUCTURAL_DIRECTIVES = [
7
- // Asset & Manifest
8
- "manifest",
9
- "asset",
10
- // Semantic Annotations
11
- "semantic",
12
- "annotate",
13
- "semantic_ref",
14
- "bindings",
15
- "artwork_metadata",
16
- "npc_behavior",
17
- // World Definition
18
- "world_metadata",
19
- "world_config",
20
- "zones",
21
- "spawn_points",
22
- // Environment Lighting
23
- "skybox",
24
- "ambient_light",
25
- "directional_light",
26
- "fog",
27
- // Advanced Simulation & AI
28
- "time_zones",
29
- "reality_capture",
30
- "reality_mesh",
31
- "reality_blend",
32
- "diminished_reality",
33
- "reality_portals",
34
- "reality_effects",
35
- "consciousness_model",
36
- "global_workspace",
37
- "attention_schema",
38
- "predictive_mind",
39
- "information_integration",
40
- "qualia_generator",
41
- "swarm_config",
42
- "minimal_brain",
43
- "rules",
44
- "pheromone_system",
45
- "emergence_detector",
46
- "collective_memory",
47
- "swarm_optimization",
48
- "time_engine",
49
- "time_buffer",
50
- "time_abilities",
51
- "paradox_prevention",
52
- "knowledge_integration",
53
- "neural_device",
54
- "signal_processor",
55
- "decoder",
56
- "thought_mapping",
57
- "haptic_feedback",
58
- "visual_prosthesis",
59
- "memory_interface",
60
- "affective_computing",
61
- "quantum_backend",
62
- "quantum_rng",
63
- "quantum_optimization",
64
- "quantum_ml",
65
- "quantum_simulation",
66
- "quantum_crypto"
67
- ];
68
- var LIFECYCLE_HOOKS = [
69
- // Standard lifecycle
70
- "on_mount",
71
- "on_unmount",
72
- "on_update",
73
- "on_data_update",
74
- "on_tick",
75
- "on_activate",
76
- "on_deactivate",
77
- "on_detected",
78
- // VR lifecycle
79
- "on_grab",
80
- "on_release",
81
- "on_hover_enter",
82
- "on_hover_exit",
83
- "on_point_enter",
84
- "on_point_exit",
85
- "on_collision",
86
- "on_trigger_enter",
87
- "on_trigger_exit",
88
- "on_click",
89
- "on_double_click",
90
- // Controller hooks
91
- "on_controller_button",
92
- "on_trigger_hold",
93
- "on_trigger_release",
94
- "on_grip_hold",
95
- "on_grip_release",
96
- // Stretchable/Moldable hooks
97
- "on_stretch",
98
- "on_sculpt",
99
- // Humanoid/Avatar hooks
100
- "on_pose_change",
101
- "on_expression_change",
102
- "on_gesture",
103
- "on_speak",
104
- "on_pose_save",
105
- "on_morph_change",
106
- // Media Production hooks
107
- "on_record_start",
108
- "on_record_stop",
109
- "on_record_pause",
110
- "on_stream_start",
111
- "on_stream_stop",
112
- "on_viewer_join",
113
- "on_viewer_leave",
114
- "on_chat_message",
115
- "on_camera_switch",
116
- "on_video_end",
117
- "on_video_error",
118
- // Analytics hooks
119
- "on_track_event",
120
- "on_survey_start",
121
- "on_survey_complete",
122
- "on_survey_skip",
123
- "on_variant_assigned",
124
- "on_conversion",
125
- "on_hotspot_detected",
126
- // Social hooks
127
- "on_share",
128
- "on_share_complete",
129
- "on_embed",
130
- "on_scan",
131
- "on_user_join",
132
- "on_user_leave",
133
- "on_draw_stroke",
134
- "on_object_lock",
135
- "on_object_unlock",
136
- // Effects hooks
137
- "on_particle_spawn",
138
- "on_particle_death",
139
- "on_transition_start",
140
- "on_transition_complete",
141
- "on_filter_change",
142
- // Audio hooks
143
- "on_audio_start",
144
- "on_audio_end",
145
- "on_voice_command",
146
- "on_speech_start",
147
- "on_speech_end",
148
- "on_beat",
149
- "on_frequency_peak",
150
- // AI hooks
151
- "on_narration_start",
152
- "on_narration_end",
153
- "on_user_question",
154
- "on_response_ready",
155
- "on_emotion_change",
156
- "on_generation_complete",
157
- // Timeline hooks
158
- "on_timeline_start",
159
- "on_timeline_complete",
160
- "on_keyframe_hit",
161
- "on_keyframe_add",
162
- "on_beat_sync",
163
- "on_move_complete",
164
- // Environment Understanding hooks
165
- "on_plane_detected",
166
- "on_plane_lost",
167
- "on_plane_updated",
168
- "on_mesh_detected",
169
- "on_mesh_updated",
170
- "on_anchor_created",
171
- "on_anchor_resolved",
172
- "on_anchor_lost",
173
- "on_anchor_shared",
174
- "on_light_estimated",
175
- "on_occlusion_updated",
176
- // Input Modality hooks
177
- "on_gaze_enter",
178
- "on_gaze_exit",
179
- "on_gaze_dwell",
180
- "on_hand_gesture",
181
- "on_hand_pinch",
182
- "on_hand_lost",
183
- "on_body_pose_update",
184
- "on_face_expression",
185
- "on_controller_vibrate",
186
- "on_accessory_input",
187
- // Accessibility hooks
188
- "on_accessibility_announce",
189
- "on_subtitle_display",
190
- "on_magnify",
191
- "on_contrast_change",
192
- "on_motion_reduce",
193
- "on_screen_reader_focus",
194
- "on_sonification_update",
195
- // Gaussian Splatting & Volumetric hooks
196
- "on_splat_loaded",
197
- "on_nerf_ready",
198
- "on_volume_frame",
199
- "on_point_cloud_loaded",
200
- "on_capture_complete",
201
- // WebGPU Compute hooks
202
- "on_compute_complete",
203
- "on_buffer_ready",
204
- "on_gpu_error",
205
- // Digital Twin & IoT hooks
206
- "on_sensor_update",
207
- "on_data_change",
208
- "on_alert_triggered",
209
- "on_twin_sync",
210
- "on_heatmap_update",
211
- // Autonomous Agent hooks
212
- "on_goal_completed",
213
- "on_goal_failed",
214
- "on_perception_change",
215
- "on_emotion_shift",
216
- "on_faction_change",
217
- "on_patrol_waypoint",
218
- "on_llm_response",
219
- "on_memory_recalled",
220
- "on_dialogue_start",
221
- "on_dialogue_end",
222
- // Advanced Spatial Audio hooks
223
- "on_reverb_enter",
224
- "on_reverb_exit",
225
- "on_audio_occluded",
226
- "on_audio_portal_enter",
227
- // OpenUSD & Interoperability hooks
228
- "on_asset_loaded",
229
- "on_format_converted",
230
- "on_scene_composed",
231
- // Co-Presence & Shared Experience hooks
232
- "on_co_presence_joined",
233
- "on_co_presence_left",
234
- "on_voice_proximity_change",
235
- "on_role_change",
236
- "on_spectator_join",
237
- "on_avatar_sync",
238
- // Geospatial & AR Cloud hooks
239
- "on_vps_localized",
240
- "on_poi_proximity",
241
- "on_terrain_resolved",
242
- "on_rooftop_resolved",
243
- // Web3 & Ownership hooks
244
- "on_wallet_connected",
245
- "on_token_verified",
246
- "on_nft_transferred",
247
- "on_purchase_complete",
248
- "on_asset_ported",
249
- // Physics Expansion hooks
250
- "on_cloth_tear",
251
- "on_fluid_splash",
252
- "on_soft_body_deform",
253
- "on_rope_snap",
254
- "on_wind_change",
255
- "on_submerge",
256
- "on_destruction_complete"
257
- ];
258
-
259
- // src/parser/ErrorRecovery.ts
260
- var VALID_KEYWORDS = [
261
- "composition",
262
- "object",
263
- "group",
264
- "template",
265
- "state",
266
- "logic",
267
- "environment",
268
- "timeline",
269
- "zone",
270
- "audio",
271
- "ui_panel",
272
- "ui_button",
273
- "ui_text",
274
- "ui_slider",
275
- "ui_input",
276
- "ui_image",
277
- "ui_chart",
278
- "import",
279
- "using",
280
- "action",
281
- "on",
282
- "if",
283
- "else",
284
- "for",
285
- "while",
286
- "animate",
287
- "emit",
288
- "spawn",
289
- "transition"
290
- ];
291
- var VALID_GEOMETRIES = [
292
- "cube",
293
- "box",
294
- "sphere",
295
- "cylinder",
296
- "cone",
297
- "torus",
298
- "plane",
299
- "text",
300
- "model",
301
- "sparkles",
302
- "particles"
303
- ];
304
- var VALID_TRAITS = [...VR_TRAITS];
305
- var COMMON_PROPERTIES = [
306
- "position",
307
- "rotation",
308
- "scale",
309
- "color",
310
- "material",
311
- "geometry",
312
- "mesh",
313
- "model",
314
- "src",
315
- "text",
316
- "content",
317
- "width",
318
- "height",
319
- "radius",
320
- "size",
321
- "opacity",
322
- "visible",
323
- "name",
324
- "id"
325
- ];
326
- var ERROR_PATTERNS = [
327
- // Missing closing brace
328
- {
329
- pattern: /unexpected end of input/i,
330
- code: "MISSING_BRACE",
331
- message: () => "Missing closing brace. Check that all { have matching }.",
332
- suggestions: () => [
333
- {
334
- description: "Add closing brace at the end",
335
- fix: "Add } to close the block"
336
- },
337
- {
338
- description: "Check for unclosed nested blocks",
339
- fix: "Ensure each { has a corresponding }"
340
- }
341
- ]
342
- },
343
- // Missing colon in property
344
- {
345
- pattern: /expected.*:/i,
346
- code: "MISSING_COLON",
347
- message: () => "Missing colon after property name.",
348
- suggestions: () => [
349
- {
350
- description: "Add colon after property name",
351
- fix: "propertyName: value"
352
- }
353
- ]
354
- },
355
- // Unclosed string
356
- {
357
- pattern: /unterminated string|unexpected newline in string/i,
358
- code: "MISSING_QUOTE",
359
- message: () => "Unclosed string literal. Make sure strings have closing quotes.",
360
- suggestions: () => [
361
- {
362
- description: "Add closing quote",
363
- fix: `Ensure string ends with matching " or '`
364
- },
365
- {
366
- description: "For multi-line strings, use template literals",
367
- fix: "Use backticks ` for multi-line strings"
368
- }
369
- ]
370
- },
371
- // Unknown keyword
372
- {
373
- pattern: /unexpected identifier ["']?(\w+)["']?/i,
374
- code: "UNKNOWN_KEYWORD",
375
- message: (match) => `Unknown keyword: ${match[1]}`,
376
- suggestions: (match) => {
377
- const word = match[1];
378
- const similar = findSimilar(word, VALID_KEYWORDS);
379
- return similar.map((s) => ({
380
- description: `Did you mean '${s}'?`,
381
- fix: `Replace '${word}' with '${s}'`
382
- }));
383
- }
384
- }
385
- ];
386
- var ErrorRecovery = class {
387
- constructor() {
388
- this.errors = [];
389
- }
390
- /**
391
- * Create an enhanced error with suggestions
392
- */
393
- createError(code, message, line, column, source) {
394
- const error = {
395
- code,
396
- message,
397
- line,
398
- column,
399
- source,
400
- suggestions: this.getSuggestions(code, message, source)
401
- };
402
- this.errors.push(error);
403
- return error;
404
- }
405
- /**
406
- * Get suggestions based on error type
407
- */
408
- getSuggestions(code, message, _source) {
409
- const suggestions = [];
410
- switch (code) {
411
- case "UNKNOWN_TRAIT":
412
- const traitMatch = message.match(/trait.*["'](\w+)["']/i);
413
- if (traitMatch) {
414
- const similar = findSimilar(traitMatch[1], VALID_TRAITS);
415
- suggestions.push(
416
- ...similar.map((s) => ({
417
- description: `Did you mean '@${s}'?`,
418
- fix: `Replace with @${s}`
419
- }))
420
- );
421
- }
422
- break;
423
- case "UNKNOWN_GEOMETRY":
424
- const geoMatch = message.match(/geometry.*["'](\w+)["']/i);
425
- if (geoMatch) {
426
- const similar = findSimilar(geoMatch[1], VALID_GEOMETRIES);
427
- suggestions.push(
428
- ...similar.map((s) => ({
429
- description: `Did you mean '${s}'?`,
430
- fix: `geometry: "${s}"`
431
- }))
432
- );
433
- }
434
- break;
435
- case "INVALID_PROPERTY":
436
- const propMatch = message.match(/property.*["'](\w+)["']/i);
437
- if (propMatch) {
438
- const similar = findSimilar(propMatch[1], COMMON_PROPERTIES);
439
- suggestions.push(
440
- ...similar.map((s) => ({
441
- description: `Did you mean '${s}'?`,
442
- fix: `${s}: value`
443
- }))
444
- );
445
- }
446
- break;
447
- case "TRAIT_CONFLICT":
448
- suggestions.push({
449
- description: "Remove one of the conflicting traits",
450
- fix: "Check trait documentation for compatibility"
451
- });
452
- break;
453
- case "TRAIT_REQUIRES":
454
- suggestions.push({
455
- description: "Add the required trait",
456
- fix: "Some traits depend on others (e.g., @throwable requires @grabbable)"
457
- });
458
- break;
459
- case "MISSING_BRACE":
460
- suggestions.push({
461
- description: "Check for matching braces",
462
- fix: "Every { must have a corresponding }"
463
- });
464
- break;
465
- case "MISSING_COLON":
466
- suggestions.push({
467
- description: "Add colon after property name",
468
- fix: "Format: propertyName: value"
469
- });
470
- break;
471
- case "MISSING_QUOTE":
472
- suggestions.push({
473
- description: "Close the string with matching quote",
474
- fix: "Strings must end with the same quote they started with"
475
- });
476
- break;
477
- case "INVALID_VALUE":
478
- suggestions.push({
479
- description: "Check value type",
480
- fix: 'position expects [x, y, z], color expects "#rrggbb"'
481
- });
482
- break;
483
- case "DUPLICATE_NAME":
484
- suggestions.push({
485
- description: "Use unique names for objects",
486
- fix: "Each object in a composition must have a unique name"
487
- });
488
- break;
489
- case "MISSING_REQUIRED":
490
- suggestions.push({
491
- description: "Add required properties",
492
- fix: "Some blocks require certain properties to be defined"
493
- });
494
- break;
495
- case "UNKNOWN_KEYWORD": {
496
- const kwMatch = message.match(/keyword.*[:"']?\s*(\w+)/i);
497
- if (kwMatch) {
498
- const similar = findSimilar(kwMatch[1], VALID_KEYWORDS);
499
- suggestions.push(
500
- ...similar.map((s) => ({
501
- description: `Did you mean '${s}'?`,
502
- fix: `Replace with ${s}`
503
- }))
504
- );
505
- }
506
- if (suggestions.length === 0) {
507
- suggestions.push({
508
- description: "Check available keywords",
509
- fix: "Valid keywords: composition, object, group, template, etc."
510
- });
511
- }
512
- break;
513
- }
514
- case "SYNTAX_ERROR":
515
- suggestions.push({
516
- description: "Check syntax around this location",
517
- fix: "Verify braces, quotes, and property format"
518
- });
519
- break;
520
- }
521
- return suggestions;
522
- }
523
- /**
524
- * Analyze raw error message and enhance it
525
- */
526
- analyzeError(rawMessage, source, line, column) {
527
- for (const pattern of ERROR_PATTERNS) {
528
- const match = rawMessage.match(pattern.pattern);
529
- if (match) {
530
- const context = { source, line, column };
531
- return {
532
- code: pattern.code,
533
- message: pattern.message(match),
534
- line,
535
- column,
536
- source,
537
- suggestions: pattern.suggestions(match, context)
538
- };
539
- }
540
- }
541
- return {
542
- code: "SYNTAX_ERROR",
543
- message: rawMessage,
544
- line,
545
- column,
546
- source,
547
- suggestions: [
548
- {
549
- description: "Check syntax around this location",
550
- fix: "Verify braces, quotes, and property format"
551
- }
552
- ]
553
- };
554
- }
555
- /**
556
- * Format error for display
557
- */
558
- formatError(error) {
559
- const lines = [];
560
- lines.push(`[${error.code}] ${error.message}`);
561
- lines.push(` at line ${error.line}, column ${error.column}`);
562
- if (error.source) {
563
- lines.push("");
564
- lines.push(` ${error.source}`);
565
- lines.push(` ${" ".repeat(error.column - 1)}^`);
566
- }
567
- if (error.suggestions && error.suggestions.length > 0) {
568
- lines.push("");
569
- lines.push("Suggestions:");
570
- for (const suggestion of error.suggestions) {
571
- lines.push(` \u2022 ${suggestion.description}`);
572
- if (suggestion.fix) {
573
- lines.push(` Fix: ${suggestion.fix}`);
574
- }
575
- }
576
- }
577
- return lines.join("\n");
578
- }
579
- /**
580
- * Get all collected errors
581
- */
582
- getErrors() {
583
- return [...this.errors];
584
- }
585
- /**
586
- * Clear collected errors
587
- */
588
- clear() {
589
- this.errors = [];
590
- }
591
- /**
592
- * Check if there are any errors
593
- */
594
- hasErrors() {
595
- return this.errors.length > 0;
596
- }
597
- };
598
- function findSimilar(input, candidates, maxDistance = 3) {
599
- const results = [];
600
- for (const candidate of candidates) {
601
- const distance = levenshteinDistance(input.toLowerCase(), candidate.toLowerCase());
602
- if (distance <= maxDistance) {
603
- results.push({ word: candidate, distance });
604
- }
605
- }
606
- return results.sort((a, b) => a.distance - b.distance).slice(0, 3).map((r) => r.word);
607
- }
608
- function levenshteinDistance(a, b) {
609
- const matrix = [];
610
- for (let i = 0; i <= b.length; i++) {
611
- matrix[i] = [i];
612
- }
613
- for (let j = 0; j <= a.length; j++) {
614
- matrix[0][j] = j;
615
- }
616
- for (let i = 1; i <= b.length; i++) {
617
- for (let j = 1; j <= a.length; j++) {
618
- if (b.charAt(i - 1) === a.charAt(j - 1)) {
619
- matrix[i][j] = matrix[i - 1][j - 1];
620
- } else {
621
- matrix[i][j] = Math.min(
622
- matrix[i - 1][j - 1] + 1,
623
- // substitution
624
- matrix[i][j - 1] + 1,
625
- // insertion
626
- matrix[i - 1][j] + 1
627
- // deletion
628
- );
629
- }
630
- }
631
- }
632
- return matrix[b.length][a.length];
633
- }
634
- function enrichErrorWithSuggestions(error, source) {
635
- if (error.suggestions && error.suggestions.length > 0) {
636
- return error;
637
- }
638
- const suggestions = [];
639
- switch (error.code) {
640
- case "UNKNOWN_TRAIT":
641
- const traitMatch = error.message.match(/trait.*["'](\w+)["']/i);
642
- if (traitMatch) {
643
- const similar = findSimilar(traitMatch[1], VALID_TRAITS);
644
- suggestions.push(
645
- ...similar.map((s) => ({
646
- description: `Did you mean '@${s}'?`,
647
- fix: `Replace with @${s}`
648
- }))
649
- );
650
- }
651
- break;
652
- case "UNKNOWN_KEYWORD":
653
- const keywordMatch = error.message.match(/keyword.*["'](\w+)["']/i);
654
- if (keywordMatch) {
655
- const similar = findSimilar(keywordMatch[1], VALID_KEYWORDS);
656
- suggestions.push(
657
- ...similar.map((s) => ({
658
- description: `Did you mean '${s}'?`,
659
- fix: `Replace with ${s}`
660
- }))
661
- );
662
- }
663
- break;
664
- case "UNKNOWN_GEOMETRY":
665
- const geomMatch = error.message.match(/geometry.*["'](\w+)["']/i);
666
- if (geomMatch) {
667
- const similar = findSimilar(geomMatch[1], VALID_GEOMETRIES);
668
- suggestions.push(
669
- ...similar.map((s) => ({
670
- description: `Did you mean '${s}'?`,
671
- fix: `Replace with ${s}`
672
- }))
673
- );
674
- }
675
- break;
676
- case "MISSING_BRACE":
677
- suggestions.push({
678
- description: "Add closing brace at the end",
679
- fix: "Add } to close the block"
680
- });
681
- break;
682
- case "MISSING_COLON":
683
- suggestions.push({
684
- description: "Add colon after property name",
685
- fix: "propertyName: value"
686
- });
687
- break;
688
- case "MISSING_QUOTE":
689
- suggestions.push({
690
- description: "Add closing quote",
691
- fix: `Ensure string ends with matching " or '`
692
- });
693
- break;
694
- }
695
- for (const pattern of ERROR_PATTERNS) {
696
- const match = error.message.match(pattern.pattern);
697
- if (match) {
698
- const context = {
699
- source,
700
- line: error.line,
701
- column: error.column
702
- };
703
- suggestions.push(...pattern.suggestions(match, context));
704
- break;
705
- }
706
- }
707
- return {
708
- ...error,
709
- suggestions: suggestions.length > 0 ? suggestions : error.suggestions
710
- };
711
- }
712
- function generateQuickFixes(error, source) {
713
- const fixes = [];
714
- switch (error.code) {
715
- case "MISSING_BRACE":
716
- fixes.push({
717
- title: "Add closing brace",
718
- edit: {
719
- range: { start: source.length, end: source.length },
720
- newText: "\n}"
721
- }
722
- });
723
- break;
724
- case "MISSING_COLON":
725
- const lineStart = getLineStart(source, error.line);
726
- const lineEnd = source.indexOf("\n", lineStart);
727
- const line = source.substring(lineStart, lineEnd === -1 ? void 0 : lineEnd);
728
- const match = line.match(/^\s*(\w+)\s+/);
729
- if (match) {
730
- fixes.push({
731
- title: "Add colon after property",
732
- edit: {
733
- range: { start: lineStart + match[0].length - 1, end: lineStart + match[0].length - 1 },
734
- newText: ":"
735
- }
736
- });
737
- }
738
- break;
739
- case "MISSING_QUOTE":
740
- fixes.push({
741
- title: "Add closing quote",
742
- edit: {
743
- range: { start: source.length, end: source.length },
744
- newText: '"'
745
- }
746
- });
747
- break;
748
- }
749
- return fixes;
750
- }
751
- function getLineStart(source, lineNumber) {
752
- let line = 1;
753
- let pos = 0;
754
- while (line < lineNumber && pos < source.length) {
755
- if (source[pos] === "\n") {
756
- line++;
757
- }
758
- pos++;
759
- }
760
- return pos;
761
- }
762
- var HOLOSCHEMA_KEYWORDS = VALID_KEYWORDS;
763
- var HOLOSCHEMA_GEOMETRIES = VALID_GEOMETRIES;
764
- var HOLOSCHEMA_PROPERTIES = COMMON_PROPERTIES;
765
-
766
- export { ErrorRecovery, HOLOSCHEMA_GEOMETRIES, HOLOSCHEMA_KEYWORDS, HOLOSCHEMA_PROPERTIES, LIFECYCLE_HOOKS, STRUCTURAL_DIRECTIVES, enrichErrorWithSuggestions, generateQuickFixes };
767
- //# sourceMappingURL=chunk-MPXBVFHQ.js.map
768
- //# sourceMappingURL=chunk-MPXBVFHQ.js.map