@holoscript/core 6.0.3 → 6.0.4

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 (229) hide show
  1. package/README.md +38 -38
  2. package/dist/GLTFPipeline-DEN36VNK.js +12 -0
  3. package/dist/GLTFPipeline-YPCAK236.cjs +33 -0
  4. package/dist/{HoloScriptPlusParser-BZR5DELQ.js → HoloScriptPlusParser-BN6KVRCM.js} +5 -5
  5. package/dist/{HoloScriptPlusParser-SBMYDNXO.cjs → HoloScriptPlusParser-NC5FE6AL.cjs} +16 -16
  6. package/dist/{USDZExporter-YA55ZS35.js → USDZExporter-NTMBNTDB.js} +3 -3
  7. package/dist/{USDZExporter-MHEHXZB4.cjs → USDZExporter-UWGWNMMD.cjs} +3 -3
  8. package/dist/{chunk-32TWR3HE.js → chunk-2CWOLHTE.js} +3 -4
  9. package/dist/{chunk-2UX5LRAP.cjs → chunk-33LSUQDD.cjs} +33 -31
  10. package/dist/{chunk-LBPEZQAF.js → chunk-3FJCK5XA.js} +7 -7
  11. package/dist/{chunk-EGIZHYJP.cjs → chunk-3SAK5KFL.cjs} +2 -4
  12. package/dist/{chunk-PJMOXFPR.cjs → chunk-4XSNJCLC.cjs} +25 -27
  13. package/dist/{chunk-HKCVM6OK.cjs → chunk-5BGSECRJ.cjs} +21 -21
  14. package/dist/{chunk-EMO7HAKJ.cjs → chunk-5O6TQC6M.cjs} +26 -30
  15. package/dist/{chunk-XSUZMPVQ.cjs → chunk-5OEOHAAW.cjs} +26 -26
  16. package/dist/{chunk-EJA7G2C4.cjs → chunk-5WUNN6ZN.cjs} +2 -2
  17. package/dist/{chunk-CQDOF3G7.cjs → chunk-6TZPZCOJ.cjs} +18 -18
  18. package/dist/{chunk-NRUB55IT.cjs → chunk-6UEHYZ7V.cjs} +18 -16
  19. package/dist/{chunk-V42NTCFH.js → chunk-6XSERL6L.js} +4230 -2197
  20. package/dist/{chunk-X4YVN7H3.cjs → chunk-72EQECGT.cjs} +37 -17
  21. package/dist/{chunk-4KJ2R7VP.cjs → chunk-7AGYRWKW.cjs} +19 -19
  22. package/dist/{chunk-UQW6SLM5.js → chunk-A7PIMZGU.js} +110 -19
  23. package/dist/{chunk-RT7LJRSF.cjs → chunk-ATSKSYVE.cjs} +1013 -6708
  24. package/dist/{chunk-WN3YF33G.cjs → chunk-B5TCIAPQ.cjs} +9 -10
  25. package/dist/{chunk-AIUXRS74.cjs → chunk-BF2235SI.cjs} +4275 -2242
  26. package/dist/{chunk-DIEDKX5B.cjs → chunk-BND3ST2K.cjs} +18 -16
  27. package/dist/{chunk-EPWRXL6S.js → chunk-BU7VWW2K.js} +29 -29
  28. package/dist/{chunk-6OQBLABR.js → chunk-BWFJEM5A.js} +368 -189
  29. package/dist/{chunk-ARNKA274.cjs → chunk-CAUCGUEA.cjs} +6 -6
  30. package/dist/{chunk-YCMQQQ5U.cjs → chunk-CBJSLA2E.cjs} +398 -219
  31. package/dist/{chunk-BU5ZAFMC.js → chunk-CDPGV4DN.js} +6 -7
  32. package/dist/{chunk-CO2VM2DK.js → chunk-CS2EMTGF.js} +10 -9
  33. package/dist/{chunk-AW7WAELW.js → chunk-DMG7C4H2.js} +4 -4
  34. package/dist/{chunk-XSF76QRU.js → chunk-DXJQDCFL.js} +3 -3
  35. package/dist/{chunk-4FCZDTD5.js → chunk-E3FWRT3Z.js} +7 -9
  36. package/dist/{chunk-KYM4XRFG.js → chunk-E3UALNFA.js} +4 -4
  37. package/dist/{chunk-GC3YU46J.js → chunk-EONILVMF.js} +2 -2
  38. package/dist/{chunk-VJVCD5T5.cjs → chunk-EQV4R3EV.cjs} +22 -22
  39. package/dist/{chunk-FEFHPUEM.cjs → chunk-F3HH56EB.cjs} +74 -658
  40. package/dist/{chunk-WYH4GVZ5.js → chunk-F4IULT7N.js} +2 -2
  41. package/dist/{chunk-XDXZM3ZP.cjs → chunk-FFKU7BTK.cjs} +19 -19
  42. package/dist/{chunk-NKRKT6V2.js → chunk-FHQVYCH2.js} +11 -10
  43. package/dist/{chunk-7H5UNJZD.cjs → chunk-FSF7EQVA.cjs} +11 -10
  44. package/dist/{chunk-KUJRR4FJ.js → chunk-G4VZTCIB.js} +9 -7
  45. package/dist/{chunk-A6GO3DPZ.cjs → chunk-G7CT3EMP.cjs} +4 -4
  46. package/dist/{chunk-EUFLX2PI.js → chunk-GGHSW2NN.js} +989 -6611
  47. package/dist/chunk-GVUR45UF.cjs +777 -0
  48. package/dist/{chunk-ODGMVILH.js → chunk-H5Z7NASB.js} +3 -3
  49. package/dist/{chunk-7KPI4EKH.cjs → chunk-HE7ULERA.cjs} +45 -49
  50. package/dist/{chunk-26TLYBFD.js → chunk-HPS76H7Q.js} +3 -3
  51. package/dist/{chunk-RE3OKSYF.cjs → chunk-HQUEA5R6.cjs} +6 -6
  52. package/dist/{chunk-ZGTGVSTZ.js → chunk-HYNTS5CP.js} +2 -2
  53. package/dist/{chunk-PBA6NXCT.cjs → chunk-IBDG74G2.cjs} +6 -3
  54. package/dist/chunk-IFNQFCTM.js +3098 -0
  55. package/dist/{chunk-ZL6VJ6SN.js → chunk-IWI6J7FX.js} +5 -5
  56. package/dist/{chunk-3KEU5QYY.cjs → chunk-K3JDKWGI.cjs} +118 -23
  57. package/dist/{chunk-NLPSZT4C.js → chunk-K6EKD26I.js} +6 -6
  58. package/dist/chunk-KCQ5NDYC.cjs +3172 -0
  59. package/dist/{chunk-ELLQPFAF.js → chunk-KED34ILP.js} +11 -9
  60. package/dist/{chunk-BY3B7ZYV.cjs → chunk-KSGXLT74.cjs} +3 -3
  61. package/dist/{chunk-65RFOWZI.js → chunk-L4G4RLXX.js} +9 -7
  62. package/dist/{chunk-4SMUJFHL.js → chunk-LDP5OK6G.js} +6 -3
  63. package/dist/{chunk-VZNKJZTT.cjs → chunk-LGGRPKTV.cjs} +82 -96
  64. package/dist/{chunk-C2QHVHZF.js → chunk-LSW7P7ML.js} +23 -414
  65. package/dist/{chunk-HHS6FMOU.cjs → chunk-LXJ4667L.cjs} +83 -22
  66. package/dist/{chunk-H6WMMLQK.cjs → chunk-LZ266PCM.cjs} +20 -13
  67. package/dist/{chunk-V2ILLPHK.cjs → chunk-MD6KDHVE.cjs} +10 -10
  68. package/dist/{chunk-6WNCRE6F.js → chunk-MEASWI2Y.js} +5 -5
  69. package/dist/chunk-MPXBVFHQ.js +768 -0
  70. package/dist/{chunk-WUXIRGZP.cjs → chunk-NCUKG4SK.cjs} +304 -144
  71. package/dist/chunk-NDQNIJEH.js +1715 -0
  72. package/dist/{chunk-Y5MUAYTO.js → chunk-NOZZ46QU.js} +9 -8
  73. package/dist/{chunk-F5LVGHNT.js → chunk-OFKWH2IP.js} +3 -3
  74. package/dist/{chunk-SPDELRRV.cjs → chunk-PMGODDJA.cjs} +12 -12
  75. package/dist/{chunk-I3XGTIHM.cjs → chunk-Q4QX3AET.cjs} +2 -2
  76. package/dist/{chunk-Y7VK5TH3.cjs → chunk-Q5JT3YML.cjs} +10 -10
  77. package/dist/{chunk-TSWTWZ42.cjs → chunk-Q5SJOGHQ.cjs} +247 -205
  78. package/dist/{chunk-M6FU6S22.js → chunk-QGKNANZ3.js} +251 -91
  79. package/dist/{chunk-WFJIDI2N.cjs → chunk-QLEAOI3Q.cjs} +10 -10
  80. package/dist/{chunk-VK5AXKO3.js → chunk-R7MA7QWV.js} +70 -84
  81. package/dist/{chunk-W76ETJTI.js → chunk-RVYPEYPX.js} +6 -6
  82. package/dist/{chunk-MWEFR6YQ.js → chunk-S2N5TNMA.js} +7 -9
  83. package/dist/{chunk-NCUHGRTZ.js → chunk-S565K7NK.js} +7 -7
  84. package/dist/{chunk-AC4BSHFV.js → chunk-SDAMZIRE.js} +5 -5
  85. package/dist/{chunk-HBZYCASG.js → chunk-T36DDXSF.js} +75 -33
  86. package/dist/{chunk-BO2OKHIY.js → chunk-T4NKMBDL.js} +30 -611
  87. package/dist/{chunk-7X2IEJIE.cjs → chunk-T7LEXZUZ.cjs} +29 -29
  88. package/dist/{chunk-HUFNKFA6.js → chunk-TEWCN33Y.js} +8 -12
  89. package/dist/{chunk-L3Z2HIWJ.cjs → chunk-TQSZUOW5.cjs} +2 -2
  90. package/dist/chunk-TSH3MSQU.cjs +129 -0
  91. package/dist/{chunk-PLMYCCA4.js → chunk-UERJ3YJV.js} +6 -6
  92. package/dist/{chunk-7N3JIJMT.js → chunk-UPJBDCVF.js} +6 -6
  93. package/dist/{chunk-CMYAWUX3.js → chunk-V3NN3HPP.js} +12 -5
  94. package/dist/{chunk-SUCBB66F.js → chunk-WB4Z63GG.js} +3 -3
  95. package/dist/{chunk-PPULB4GG.cjs → chunk-WDW67DZB.cjs} +68 -68
  96. package/dist/chunk-WGMEAYBG.js +126 -0
  97. package/dist/{chunk-VSXOIUCF.cjs → chunk-X4ZF6CNE.cjs} +7 -7
  98. package/dist/{chunk-HF4OFY25.cjs → chunk-X6SEAXAX.cjs} +29 -445
  99. package/dist/{chunk-C7BNX4XJ.js → chunk-XCWFGZAA.js} +6 -6
  100. package/dist/{chunk-CNVM7J3M.js → chunk-XD6IYDUX.js} +34 -14
  101. package/dist/chunk-XG23EUQX.cjs +1717 -0
  102. package/dist/{chunk-DN7UFU63.cjs → chunk-XRKWN5PL.cjs} +12 -11
  103. package/dist/{chunk-XNMEH2BI.js → chunk-XUTX5CBW.js} +3 -3
  104. package/dist/{chunk-PQLGZKMC.cjs → chunk-XWPNTWDN.cjs} +26 -26
  105. package/dist/{chunk-NTMZSDXM.cjs → chunk-XXINBTZK.cjs} +43 -43
  106. package/dist/{chunk-74YCHHTE.js → chunk-YCXFCXDS.js} +8 -12
  107. package/dist/{chunk-KDB6BUMB.js → chunk-YQK5JNFK.js} +77 -18
  108. package/dist/{chunk-DH5G2JUA.cjs → chunk-Z34RLXRA.cjs} +44 -46
  109. package/dist/{chunk-XH7SE4HH.cjs → chunk-ZP4D3CSX.cjs} +19 -19
  110. package/dist/cli/holoscript-runner.cjs +33 -32
  111. package/dist/cli/holoscript-runner.js +13 -12
  112. package/dist/codebase/index.cjs +1 -1
  113. package/dist/codebase/index.d.ts +25 -0
  114. package/dist/codebase/index.js +1 -1
  115. package/dist/compiler/agent-inference.cjs +7 -8
  116. package/dist/compiler/agent-inference.js +3 -4
  117. package/dist/compiler/android-xr.cjs +7 -8
  118. package/dist/compiler/android-xr.js +5 -6
  119. package/dist/compiler/android.cjs +8 -9
  120. package/dist/compiler/android.js +6 -7
  121. package/dist/compiler/ar.cjs +6 -7
  122. package/dist/compiler/ar.js +4 -5
  123. package/dist/compiler/babylon.cjs +8 -9
  124. package/dist/compiler/babylon.js +7 -8
  125. package/dist/compiler/coco.cjs +1 -1
  126. package/dist/compiler/coco.js +1 -1
  127. package/dist/compiler/domain-block-utils.cjs +158 -151
  128. package/dist/compiler/domain-block-utils.js +4 -5
  129. package/dist/compiler/dtdl.cjs +7 -8
  130. package/dist/compiler/dtdl.js +4 -5
  131. package/dist/compiler/gltf-pipeline.cjs +9 -9
  132. package/dist/compiler/gltf-pipeline.js +2 -2
  133. package/dist/compiler/godot.cjs +6 -7
  134. package/dist/compiler/godot.js +5 -6
  135. package/dist/compiler/incremental.cjs +7 -8
  136. package/dist/compiler/incremental.js +2 -3
  137. package/dist/compiler/index.cjs +1934 -878
  138. package/dist/compiler/index.js +1904 -842
  139. package/dist/compiler/ios.cjs +8 -9
  140. package/dist/compiler/ios.js +6 -7
  141. package/dist/compiler/multi-layer.cjs +10 -17
  142. package/dist/compiler/multi-layer.js +9 -10
  143. package/dist/compiler/nodetoy.cjs +1 -1
  144. package/dist/compiler/nodetoy.js +1 -1
  145. package/dist/compiler/openxr.cjs +6 -7
  146. package/dist/compiler/openxr.js +5 -6
  147. package/dist/compiler/playcanvas.cjs +7 -8
  148. package/dist/compiler/playcanvas.js +6 -7
  149. package/dist/compiler/r3f.cjs +13 -14
  150. package/dist/compiler/r3f.js +8 -9
  151. package/dist/compiler/remotion.cjs +1 -1
  152. package/dist/compiler/remotion.js +1 -1
  153. package/dist/compiler/reproducibility.cjs +1 -1
  154. package/dist/compiler/reproducibility.js +1 -1
  155. package/dist/compiler/sdf.cjs +7 -8
  156. package/dist/compiler/sdf.js +5 -6
  157. package/dist/compiler/semantic-scene.cjs +7 -7
  158. package/dist/compiler/semantic-scene.js +2 -2
  159. package/dist/compiler/state.cjs +5 -6
  160. package/dist/compiler/state.js +3 -4
  161. package/dist/compiler/trait-composition.cjs +7 -8
  162. package/dist/compiler/trait-composition.js +3 -4
  163. package/dist/compiler/unity.cjs +6 -7
  164. package/dist/compiler/unity.js +5 -6
  165. package/dist/compiler/unreal.cjs +7 -8
  166. package/dist/compiler/unreal.js +5 -6
  167. package/dist/compiler/urdf.cjs +13 -14
  168. package/dist/compiler/urdf.js +5 -6
  169. package/dist/compiler/usd-physics.cjs +7 -8
  170. package/dist/compiler/usd-physics.js +4 -5
  171. package/dist/compiler/visionos.cjs +6 -7
  172. package/dist/compiler/visionos.js +5 -6
  173. package/dist/compiler/vrchat.cjs +7 -8
  174. package/dist/compiler/vrchat.js +5 -6
  175. package/dist/compiler/vrr.cjs +7 -8
  176. package/dist/compiler/vrr.js +5 -6
  177. package/dist/compiler/wasm.cjs +10 -11
  178. package/dist/compiler/wasm.js +5 -6
  179. package/dist/compiler/webgpu.cjs +6 -7
  180. package/dist/compiler/webgpu.js +5 -6
  181. package/dist/constants.d.ts +3 -0
  182. package/dist/debugger.cjs +7 -7
  183. package/dist/debugger.js +5 -5
  184. package/dist/entries/interop.cjs +1 -1
  185. package/dist/entries/interop.d.ts +9 -0
  186. package/dist/entries/interop.js +1 -1
  187. package/dist/entries/scripting.cjs +18 -17
  188. package/dist/entries/scripting.d.ts +7 -0
  189. package/dist/entries/scripting.js +8 -7
  190. package/dist/index.cjs +6773 -27555
  191. package/dist/index.d.ts +19 -0
  192. package/dist/index.js +5212 -26101
  193. package/dist/math/vec3.cjs +1 -1
  194. package/dist/math/vec3.js +1 -1
  195. package/dist/ml-dsa-PHCWUBPX.cjs +1178 -0
  196. package/dist/ml-dsa-WYLJHJO6.js +1178 -0
  197. package/dist/parser.cjs +11 -10
  198. package/dist/parser.js +8 -7
  199. package/dist/{playwright-BIZXMLD2.js → playwright-5OSAPTNH.js} +3 -3
  200. package/dist/{playwright-7DTEQCBD.cjs → playwright-RL6GY4F7.cjs} +1985 -1985
  201. package/dist/runtime.cjs +5 -5
  202. package/dist/runtime.js +4 -4
  203. package/dist/self-improvement/index.d.ts +0 -48
  204. package/dist/storage/index.cjs +1 -1
  205. package/dist/storage/index.d.ts +24 -0
  206. package/dist/storage/index.js +1 -1
  207. package/dist/tools/index.d.ts +12 -0
  208. package/dist/traits/index.cjs +925 -607
  209. package/dist/traits/index.js +137 -20
  210. package/dist/type-checker.cjs +4 -4
  211. package/dist/type-checker.js +2 -2
  212. package/package.json +56 -21
  213. package/LICENSE +0 -21
  214. package/dist/GLTFPipeline-3KLWWUQO.cjs +0 -34
  215. package/dist/GLTFPipeline-LYII2ZVQ.js +0 -13
  216. package/dist/chunk-CN4NOESF.cjs +0 -416
  217. package/dist/chunk-DXVCEFZB.js +0 -2027
  218. package/dist/chunk-ENV7K6XA.js +0 -282
  219. package/dist/chunk-H7XMORZI.js +0 -2731
  220. package/dist/chunk-HAN4V3PF.cjs +0 -2037
  221. package/dist/chunk-LER4WXW5.cjs +0 -286
  222. package/dist/chunk-QHVVVN47.cjs +0 -2033
  223. package/dist/chunk-QWKUKVRE.js +0 -2026
  224. package/dist/chunk-UITWA6DV.cjs +0 -2829
  225. package/dist/chunk-X67XRI2T.js +0 -410
  226. package/dist/post-quantum-JTTAAGO3.cjs +0 -6
  227. package/dist/post-quantum-RVPVDEPI.js +0 -4
  228. package/dist/wot/index.cjs +0 -29
  229. package/dist/wot/index.js +0 -4
@@ -1,53 +1,523 @@
1
1
  'use strict';
2
2
 
3
- var chunk27LWW5FU_cjs = require('../chunk-27LWW5FU.cjs');
4
3
  var chunkVJ3L7CHT_cjs = require('../chunk-VJ3L7CHT.cjs');
5
- var chunkBY3B7ZYV_cjs = require('../chunk-BY3B7ZYV.cjs');
6
- var chunkFEFHPUEM_cjs = require('../chunk-FEFHPUEM.cjs');
4
+ var chunkKSGXLT74_cjs = require('../chunk-KSGXLT74.cjs');
5
+ var chunk27LWW5FU_cjs = require('../chunk-27LWW5FU.cjs');
6
+ var chunkF3HH56EB_cjs = require('../chunk-F3HH56EB.cjs');
7
7
  var chunkLK5IAVH6_cjs = require('../chunk-LK5IAVH6.cjs');
8
8
  var chunkXUILI4KB_cjs = require('../chunk-XUILI4KB.cjs');
9
- var chunkEJA7G2C4_cjs = require('../chunk-EJA7G2C4.cjs');
10
- require('../chunk-X4YVN7H3.cjs');
9
+ var chunk5WUNN6ZN_cjs = require('../chunk-5WUNN6ZN.cjs');
10
+ require('../chunk-72EQECGT.cjs');
11
11
  var chunkI6XZ5DZF_cjs = require('../chunk-I6XZ5DZF.cjs');
12
- var chunkDIEDKX5B_cjs = require('../chunk-DIEDKX5B.cjs');
13
- var chunkWFJIDI2N_cjs = require('../chunk-WFJIDI2N.cjs');
14
- var chunkCQDOF3G7_cjs = require('../chunk-CQDOF3G7.cjs');
15
- var chunkVJVCD5T5_cjs = require('../chunk-VJVCD5T5.cjs');
16
- var chunk4KJ2R7VP_cjs = require('../chunk-4KJ2R7VP.cjs');
17
- var chunkWN3YF33G_cjs = require('../chunk-WN3YF33G.cjs');
18
- var chunkDN7UFU63_cjs = require('../chunk-DN7UFU63.cjs');
19
- var chunk7H5UNJZD_cjs = require('../chunk-7H5UNJZD.cjs');
20
- var chunkNTMZSDXM_cjs = require('../chunk-NTMZSDXM.cjs');
21
- var chunkTSWTWZ42_cjs = require('../chunk-TSWTWZ42.cjs');
22
- require('../chunk-PPULB4GG.cjs');
23
- var chunkPQLGZKMC_cjs = require('../chunk-PQLGZKMC.cjs');
24
- var chunkWUXIRGZP_cjs = require('../chunk-WUXIRGZP.cjs');
25
- var chunkPJMOXFPR_cjs = require('../chunk-PJMOXFPR.cjs');
26
- var chunkYCMQQQ5U_cjs = require('../chunk-YCMQQQ5U.cjs');
27
- var chunkEMO7HAKJ_cjs = require('../chunk-EMO7HAKJ.cjs');
28
- var chunkNRUB55IT_cjs = require('../chunk-NRUB55IT.cjs');
29
- var chunkXH7SE4HH_cjs = require('../chunk-XH7SE4HH.cjs');
30
- var chunkVZNKJZTT_cjs = require('../chunk-VZNKJZTT.cjs');
31
- var chunkY7VK5TH3_cjs = require('../chunk-Y7VK5TH3.cjs');
32
- var chunkXDXZM3ZP_cjs = require('../chunk-XDXZM3ZP.cjs');
33
- var chunkDH5G2JUA_cjs = require('../chunk-DH5G2JUA.cjs');
34
- var chunk2UX5LRAP_cjs = require('../chunk-2UX5LRAP.cjs');
35
- require('../chunk-3KEU5QYY.cjs');
36
- require('../chunk-VSXOIUCF.cjs');
37
- var chunk7KPI4EKH_cjs = require('../chunk-7KPI4EKH.cjs');
38
- var chunkXSUZMPVQ_cjs = require('../chunk-XSUZMPVQ.cjs');
39
- require('../chunk-HHS6FMOU.cjs');
40
- var chunkQHVVVN47_cjs = require('../chunk-QHVVVN47.cjs');
41
- require('../chunk-AIUXRS74.cjs');
12
+ var chunkQLEAOI3Q_cjs = require('../chunk-QLEAOI3Q.cjs');
13
+ var chunk6TZPZCOJ_cjs = require('../chunk-6TZPZCOJ.cjs');
14
+ var chunkEQV4R3EV_cjs = require('../chunk-EQV4R3EV.cjs');
15
+ var chunk7AGYRWKW_cjs = require('../chunk-7AGYRWKW.cjs');
16
+ var chunkB5TCIAPQ_cjs = require('../chunk-B5TCIAPQ.cjs');
17
+ var chunkXRKWN5PL_cjs = require('../chunk-XRKWN5PL.cjs');
18
+ var chunkFSF7EQVA_cjs = require('../chunk-FSF7EQVA.cjs');
19
+ var chunkQ5SJOGHQ_cjs = require('../chunk-Q5SJOGHQ.cjs');
20
+ require('../chunk-WDW67DZB.cjs');
21
+ var chunkXWPNTWDN_cjs = require('../chunk-XWPNTWDN.cjs');
22
+ var chunkNCUKG4SK_cjs = require('../chunk-NCUKG4SK.cjs');
23
+ var chunk4XSNJCLC_cjs = require('../chunk-4XSNJCLC.cjs');
24
+ var chunkCBJSLA2E_cjs = require('../chunk-CBJSLA2E.cjs');
25
+ var chunk5O6TQC6M_cjs = require('../chunk-5O6TQC6M.cjs');
26
+ var chunk6UEHYZ7V_cjs = require('../chunk-6UEHYZ7V.cjs');
27
+ var chunkBND3ST2K_cjs = require('../chunk-BND3ST2K.cjs');
28
+ var chunkZP4D3CSX_cjs = require('../chunk-ZP4D3CSX.cjs');
29
+ var chunkQ5JT3YML_cjs = require('../chunk-Q5JT3YML.cjs');
30
+ var chunkFFKU7BTK_cjs = require('../chunk-FFKU7BTK.cjs');
31
+ var chunkZ34RLXRA_cjs = require('../chunk-Z34RLXRA.cjs');
32
+ var chunk33LSUQDD_cjs = require('../chunk-33LSUQDD.cjs');
33
+ require('../chunk-K3JDKWGI.cjs');
34
+ require('../chunk-X4ZF6CNE.cjs');
35
+ var chunkHE7ULERA_cjs = require('../chunk-HE7ULERA.cjs');
36
+ var chunk5OEOHAAW_cjs = require('../chunk-5OEOHAAW.cjs');
37
+ var chunkXXINBTZK_cjs = require('../chunk-XXINBTZK.cjs');
42
38
  require('../chunk-3FYZOR7S.cjs');
43
- require('../chunk-SPDELRRV.cjs');
44
- require('../chunk-V2ILLPHK.cjs');
45
- require('../chunk-ARNKA274.cjs');
46
- var chunkEGIZHYJP_cjs = require('../chunk-EGIZHYJP.cjs');
39
+ var chunkXG23EUQX_cjs = require('../chunk-XG23EUQX.cjs');
40
+ require('../chunk-KCQ5NDYC.cjs');
41
+ require('../chunk-PMGODDJA.cjs');
42
+ require('../chunk-MD6KDHVE.cjs');
43
+ require('../chunk-CAUCGUEA.cjs');
44
+ var chunkLGGRPKTV_cjs = require('../chunk-LGGRPKTV.cjs');
45
+ require('../chunk-LXJ4667L.cjs');
46
+ var chunkBF2235SI_cjs = require('../chunk-BF2235SI.cjs');
47
+ var chunk3SAK5KFL_cjs = require('../chunk-3SAK5KFL.cjs');
48
+
49
+ // src/compiler/Native2DCompiler.ts
50
+ var Native2DCompiler_exports = {};
51
+ chunk3SAK5KFL_cjs.__export(Native2DCompiler_exports, {
52
+ Native2DCompiler: () => exports.Native2DCompiler
53
+ });
54
+ exports.Native2DCompiler = void 0;
55
+ var init_Native2DCompiler = chunk3SAK5KFL_cjs.__esm({
56
+ "src/compiler/Native2DCompiler.ts"() {
57
+ chunkBF2235SI_cjs.init_CompilerBase();
58
+ exports.Native2DCompiler = class extends chunkBF2235SI_cjs.CompilerBase {
59
+ constructor() {
60
+ super(...arguments);
61
+ this.compilerName = "Native2DCompiler";
62
+ // ============================================================================
63
+ // REACT GENERATION
64
+ // ============================================================================
65
+ /** Collected during node traversal — used to generate imports and hooks */
66
+ this._slotImports = /* @__PURE__ */ new Map();
67
+ this._uiImports = /* @__PURE__ */ new Set();
68
+ this._stateFields = /* @__PURE__ */ new Map();
69
+ this._fetchCalls = [];
70
+ this._options = {};
71
+ }
72
+ // @ts-expect-error During migration
73
+ compile(composition, agentToken, outputPath, options) {
74
+ this.validateCompilerAccess(agentToken, outputPath);
75
+ const isReact = options?.format === "react";
76
+ const elements = composition.ui?.elements || composition.objects || [];
77
+ if (isReact) {
78
+ const code = this.generateReactComponent(composition.name, elements, composition, options);
79
+ if (options?.generateDocs) {
80
+ return {
81
+ output: code,
82
+ documentation: this.generateDocumentation(composition, code, options.docsOptions)
83
+ };
84
+ }
85
+ return code;
86
+ } else {
87
+ const code = this.generateHTMLPage(composition.name, elements, composition);
88
+ if (options?.generateDocs) {
89
+ return {
90
+ output: code,
91
+ documentation: this.generateDocumentation(composition, code, options.docsOptions)
92
+ };
93
+ }
94
+ return code;
95
+ }
96
+ }
97
+ generateReactComponent(name, objects, composition, options) {
98
+ this._slotImports.clear();
99
+ this._uiImports.clear();
100
+ this._stateFields.clear();
101
+ this._fetchCalls = [];
102
+ this._options = options || {};
103
+ const safeName = name.replace(/[^a-zA-Z0-9]/g, "");
104
+ if (composition?.state?.properties) {
105
+ for (const prop of composition.state.properties) {
106
+ this._stateFields.set(prop.key, prop.value ?? null);
107
+ }
108
+ }
109
+ const jsx = objects.map((obj) => this.generateReactNode(obj)).join("\n ");
110
+ const imports = [];
111
+ const reactImports = /* @__PURE__ */ new Set();
112
+ if (this._stateFields.size > 0) reactImports.add("useState");
113
+ if (this._fetchCalls.length > 0) reactImports.add("useEffect");
114
+ imports.push(
115
+ reactImports.size > 0 ? `import React, { ${[...reactImports].join(", ")} } from 'react';` : `import React from 'react';`
116
+ );
117
+ if (this._uiImports.size > 0) {
118
+ imports.push(`import { ${[...this._uiImports].join(", ")} } from '@holoscript/ui';`);
119
+ }
120
+ for (const [, slot] of this._slotImports) {
121
+ imports.push(`import { ${slot.component} } from '${slot.importPath}';`);
122
+ }
123
+ const stateHooks = [];
124
+ for (const [key, value] of this._stateFields) {
125
+ const capitalKey = key.charAt(0).toUpperCase() + key.slice(1);
126
+ const initValue = JSON.stringify(value);
127
+ stateHooks.push(
128
+ ` const [${key}, set${capitalKey}] = useState(${initValue === void 0 ? "null" : initValue});`
129
+ );
130
+ }
131
+ const fetchEffects = [];
132
+ for (const f of this._fetchCalls) {
133
+ fetchEffects.push(` useEffect(() => {
134
+ fetch(\`${f.endpoint}\`${f.method !== "GET" ? `, { method: '${f.method}' }` : ""})
135
+ .then(r => r.json())
136
+ .then(set${f.name.charAt(0).toUpperCase() + f.name.slice(1)})
137
+ .catch(console.error);
138
+ }, []);`);
139
+ }
140
+ return `${imports.join("\n")}
141
+
142
+ // @generated by HoloScript Native2DCompiler \u2014 DO NOT EDIT
143
+ export function ${safeName}Component() {
144
+ ${stateHooks.join("\n")}
145
+ ${fetchEffects.join("\n")}
146
+
147
+ return (
148
+ <div className="holoscript-2d-root w-full h-full">
149
+ ${jsx}
150
+ </div>
151
+ );
152
+ }
153
+
154
+ export default ${safeName}Component;
155
+ `;
156
+ }
157
+ generateReactNode(obj) {
158
+ const traits = this.extractTraits(obj);
159
+ if (traits.slot) {
160
+ const slotName = traits.slot.name || obj.name || "Slot";
161
+ const configuredSlot = this._options.slots?.[String(slotName)];
162
+ const component = traits.slot.component || configuredSlot?.component || slotName;
163
+ const importPath = traits.slot.import || configuredSlot?.importPath || `@/components/${component}`;
164
+ this._slotImports.set(slotName, { component, importPath });
165
+ const propsStr = traits.slot.props ? ` {...${JSON.stringify(traits.slot.props)}}` : "";
166
+ return `<div data-holo-slot="${slotName}">
167
+ <${component}${propsStr} />
168
+ </div>`;
169
+ }
170
+ if (traits.fetch) {
171
+ const name = traits.fetch.into || "data";
172
+ const endpoint = traits.fetch.endpoint || "/api/data";
173
+ const method = traits.fetch.method || "GET";
174
+ this._fetchCalls.push({ name, endpoint, method });
175
+ if (!this._stateFields.has(name)) {
176
+ this._stateFields.set(name, null);
177
+ }
178
+ }
179
+ let tag = traits.theme?.tag || traits.panel?.tag || (typeof obj.type === "string" ? obj.type.toLowerCase() : void 0) || "div";
180
+ if ([
181
+ "nav",
182
+ "section",
183
+ "main",
184
+ "footer",
185
+ "form",
186
+ "style",
187
+ "a",
188
+ "header",
189
+ "h1",
190
+ "h2",
191
+ "h3"
192
+ ].includes(tag)) ; else if (tag === "container") {
193
+ tag = "div";
194
+ } else if (traits.link || tag === "link") {
195
+ tag = "a";
196
+ } else if (traits.button || tag === "button") {
197
+ tag = "button";
198
+ } else if (traits.image || tag === "image") {
199
+ tag = "img";
200
+ } else if (traits.input || tag === "input") {
201
+ tag = "input";
202
+ } else if (traits.text || tag === "text") {
203
+ tag = this.mapTextVariantToTag(traits.text?.variant || "body");
204
+ } else {
205
+ tag = "div";
206
+ }
207
+ const styles = this.buildStyles(traits);
208
+ const classes = this.buildClasses(traits);
209
+ let props = ``;
210
+ if (traits.theme?.className) {
211
+ classes.push(traits.theme.className);
212
+ }
213
+ if (traits.theme?.id) {
214
+ props += ` id="${traits.theme.id}"`;
215
+ }
216
+ const combinedStyles = { ...styles };
217
+ if (traits.theme?.style) {
218
+ traits.theme.style.split(";").forEach((rule) => {
219
+ const [key, ...valueParts] = rule.split(":");
220
+ const value = valueParts.join(":");
221
+ if (key && value) {
222
+ const camelKey = key.trim().replace(/-([a-z])/g, (g) => g[1].toUpperCase());
223
+ combinedStyles[camelKey] = value.trim();
224
+ }
225
+ });
226
+ }
227
+ if (Object.keys(combinedStyles).length > 0) {
228
+ props += ` style={${JSON.stringify(combinedStyles)}}`;
229
+ }
230
+ if (classes.length > 0) {
231
+ props += ` className="${classes.join(" ")}"`;
232
+ }
233
+ if (traits.theme?.attributes) {
234
+ try {
235
+ const parsedAttrs = JSON.parse(traits.theme.attributes);
236
+ for (const [key, value] of Object.entries(parsedAttrs)) {
237
+ props += ` ${key}="${value}"`;
238
+ }
239
+ } catch (e) {
240
+ }
241
+ }
242
+ if (traits.button?.onClick || traits.form?.onSubmit) {
243
+ const action = traits.button?.onClick || traits.form?.onSubmit;
244
+ if (action) {
245
+ const cleanAction = action.replace(/["']/g, "'");
246
+ if (cleanAction.includes("navigate")) {
247
+ props += ` onClick={() => ${cleanAction}}`;
248
+ } else if (cleanAction.includes("submit")) {
249
+ props += ` onSubmit={${cleanAction}}`;
250
+ } else if (cleanAction.includes("window.open")) {
251
+ props += ` onClick={() => ${cleanAction}}`;
252
+ } else {
253
+ props += ` onClick={() => console.log('${cleanAction}')}`;
254
+ }
255
+ }
256
+ }
257
+ if (traits.image?.src) props += ` src="${traits.image.src}"`;
258
+ if (traits.image?.alt) props += ` alt="${traits.image.alt}"`;
259
+ if (traits.link?.href) props += ` href="${traits.link.href}"`;
260
+ if (traits.input?.placeholder) props += ` placeholder="${traits.input.placeholder}"`;
261
+ if (traits.input?.type) props += ` type="${traits.input.type}"`;
262
+ if (traits.input?.required) props += ` required`;
263
+ if (traits.button?.type) props += ` type="${traits.button.type}"`;
264
+ const childrenMarkup = (obj.children || obj.objects || []).map((child) => this.generateReactNode(child)).join("\n");
265
+ const content = traits.text?.content || traits.button?.content || traits.link?.content || traits.icon?.name;
266
+ let safeContent = "";
267
+ if (content) {
268
+ safeContent = `{\`${content.replace(/`/g, "\\`").replace(/\$/g, "\\$")}\`}`;
269
+ }
270
+ if (tag === "style") {
271
+ const escapedStyle = (content || "").replace(/`/g, "\\`").replace(/\$/g, "\\$");
272
+ return `<style dangerouslySetInnerHTML={{ __html: \`${escapedStyle}\` }} />`;
273
+ }
274
+ if (tag === "img" || tag === "input") {
275
+ return `<${tag}${props} />`;
276
+ }
277
+ return `<${tag}${props}>
278
+ ${safeContent}
279
+ ${childrenMarkup}
280
+ </${tag}>`;
281
+ }
282
+ // ============================================================================
283
+ // HTML GENERATION
284
+ // ============================================================================
285
+ generateHTMLPage(name, objects, composition) {
286
+ const content = objects.map((obj) => this.generateHTMLNode(obj)).join("\n ");
287
+ let bgColor = "#ffffff";
288
+ let color = "#000000";
289
+ if (composition.environment?.properties) {
290
+ const themeProp = composition.environment.properties.find((p) => p.key === "theme");
291
+ const bgProp = composition.environment.properties.find((p) => p.key === "backgroundColor");
292
+ if (themeProp?.value === "dark" || composition.traits?.some((t) => t.name === "theme" && t.config?.dark)) {
293
+ bgColor = bgProp?.value || "#050510";
294
+ color = "#ffffff";
295
+ }
296
+ }
297
+ return `<!DOCTYPE html>
298
+ <html lang="en">
299
+ <head>
300
+ <meta charset="UTF-8">
301
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
302
+ <title>${name}</title>
303
+ <script src="https://cdn.tailwindcss.com"></script>
304
+ <style>
305
+ body { margin: 0; padding: 0; background-color: ${bgColor}; color: ${color}; font-family: system-ui, -apple-system, sans-serif; }
306
+ /* Basic resets and custom trait animations to mirror React Framer variants */
307
+ .glow-btn:hover { box-shadow: 0 0 15px rgba(255,255,255,0.5); }
308
+ .lift-card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
309
+ .lift-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
310
+ </style>
311
+ </head>
312
+ <body>
313
+ <div id="holoscript-native-root">
314
+ ${content}
315
+ </div>
316
+ <script>
317
+ function navigate(path) { window.location.href = path; }
318
+ function submitNewsletter(e) { e.preventDefault(); alert('Subscribed!'); }
319
+ </script>
320
+ </body>
321
+ </html>`;
322
+ }
323
+ generateHTMLNode(obj) {
324
+ const node = obj;
325
+ const traits = this.extractTraits(obj);
326
+ const nodeType = typeof node.type === "string" ? node.type.toLowerCase() : void 0;
327
+ let tag = traits.theme?.tag || traits.panel?.tag || nodeType || "div";
328
+ if ([
329
+ "nav",
330
+ "section",
331
+ "main",
332
+ "footer",
333
+ "form",
334
+ "style",
335
+ "a",
336
+ "header",
337
+ "h1",
338
+ "h2",
339
+ "h3"
340
+ ].includes(tag)) ; else if (tag === "container") {
341
+ tag = "div";
342
+ } else if (traits.link || tag === "link") {
343
+ tag = "a";
344
+ } else if (traits.button || tag === "button") {
345
+ tag = "button";
346
+ } else if (traits.image || tag === "image") {
347
+ tag = "img";
348
+ } else if (traits.input || tag === "input") {
349
+ tag = "input";
350
+ } else if (traits.text || tag === "text") {
351
+ tag = this.mapTextVariantToTag(traits.text?.variant || "body");
352
+ } else {
353
+ tag = "div";
354
+ }
355
+ const styles = this.buildStyles(traits);
356
+ const classes = this.buildClasses(traits);
357
+ let props = ``;
358
+ if (traits.theme?.className) {
359
+ classes.push(traits.theme.className);
360
+ }
361
+ if (traits.theme?.id) {
362
+ props += ` id="${traits.theme.id}"`;
363
+ }
364
+ if (Object.keys(styles).length > 0 || traits.theme?.style) {
365
+ let styleStr = Object.entries(styles).map(([k, v]) => `${this.camelToKebab(k)}: ${v}`).join("; ");
366
+ if (traits.theme?.style) {
367
+ styleStr += (styleStr ? "; " : "") + traits.theme.style;
368
+ }
369
+ props += ` style="${styleStr}"`;
370
+ }
371
+ if (classes.length > 0) {
372
+ props += ` class="${classes.join(" ")}"`;
373
+ }
374
+ if (traits.theme?.attributes) {
375
+ try {
376
+ const parsedAttrs = JSON.parse(traits.theme.attributes);
377
+ for (const [key, value] of Object.entries(parsedAttrs)) {
378
+ props += ` ${key}="${value}"`;
379
+ }
380
+ } catch (e) {
381
+ }
382
+ }
383
+ if (traits.button?.onClick) props += ` onclick="${traits.button.onClick}"`;
384
+ if (traits.form?.onSubmit) props += ` onsubmit="${traits.form.onSubmit}"`;
385
+ if (traits.image?.src) props += ` src="${traits.image.src}"`;
386
+ if (traits.image?.alt) props += ` alt="${traits.image.alt}"`;
387
+ if (traits.link?.href) props += ` href="${traits.link.href}"`;
388
+ if (traits.input?.placeholder) props += ` placeholder="${traits.input.placeholder}"`;
389
+ if (traits.input?.type) props += ` type="${traits.input.type}"`;
390
+ if (traits.input?.required) props += ` required`;
391
+ const children = node.children || node.objects || [];
392
+ const childrenMarkup = children.map((child) => this.generateHTMLNode(child)).join("\n");
393
+ const content = traits.text?.content || traits.button?.content || traits.link?.content || traits.icon?.name;
394
+ if (tag === "img" || tag === "input") {
395
+ return `<${tag}${props}>`;
396
+ }
397
+ return `<${tag}${props}>
398
+ ${content ? content : ""}
399
+ ${childrenMarkup}
400
+ </${tag}>`;
401
+ }
402
+ // ============================================================================
403
+ // UTILITIES
404
+ // ============================================================================
405
+ extractTraits(obj) {
406
+ const map = {};
407
+ const node = obj;
408
+ if (!node.traits) return map;
409
+ for (const t of node.traits) {
410
+ map[t.name] = t.config || {};
411
+ if (t.name === "tailwind" && typeof t.config === "string") {
412
+ map[t.name] = { classes: t.config };
413
+ }
414
+ }
415
+ return map;
416
+ }
417
+ mapTextVariantToTag(variant) {
418
+ switch (variant) {
419
+ case "h1":
420
+ return "h1";
421
+ case "h2":
422
+ return "h2";
423
+ case "h3":
424
+ return "h3";
425
+ case "subtitle":
426
+ return "h4";
427
+ case "caption":
428
+ return "span";
429
+ case "emoji":
430
+ return "span";
431
+ default:
432
+ return "p";
433
+ }
434
+ }
435
+ buildStyles(traits) {
436
+ const styles = {};
437
+ const layout = traits.layout;
438
+ const theme = traits.theme;
439
+ if (layout) {
440
+ if (layout.flex) {
441
+ styles.display = "flex";
442
+ styles.flexDirection = layout.flex === "row" ? "row" : "column";
443
+ }
444
+ if (layout.grid) {
445
+ styles.display = "grid";
446
+ styles.gridTemplateColumns = `repeat(${layout.columns || 1}, minmax(0, 1fr))`;
447
+ }
448
+ if (layout.justify) styles.justifyContent = layout.justify;
449
+ if (layout.align) styles.alignItems = layout.align;
450
+ if (layout.gap) styles.gap = typeof layout.gap === "number" ? `${layout.gap}px` : layout.gap;
451
+ if (layout.padding)
452
+ styles.padding = typeof layout.padding === "number" ? `${layout.padding}px` : layout.padding;
453
+ }
454
+ if (theme) {
455
+ if (theme.backgroundColor) styles.backgroundColor = theme.backgroundColor;
456
+ if (theme.color) styles.color = theme.color;
457
+ if (theme.padding)
458
+ styles.padding = typeof theme.padding === "number" ? `${theme.padding}px` : theme.padding;
459
+ if (theme.borderRadius)
460
+ styles.borderRadius = typeof theme.borderRadius === "number" ? `${theme.borderRadius}px` : theme.borderRadius;
461
+ if (theme.border) styles.border = theme.border;
462
+ if (theme.borderTop) styles.borderTop = theme.borderTop;
463
+ }
464
+ if (traits.text) {
465
+ if (traits.text.align) styles.textAlign = traits.text.align;
466
+ if (traits.text.maxWidth)
467
+ styles.maxWidth = typeof traits.text.maxWidth === "number" ? `${traits.text.maxWidth}px` : traits.text.maxWidth;
468
+ if (traits.text.weight) styles.fontWeight = traits.text.weight;
469
+ }
470
+ return styles;
471
+ }
472
+ buildClasses(traits) {
473
+ const classes = [];
474
+ if (traits.text) {
475
+ if (traits.text.variant === "h1") classes.push("text-5xl font-bold tracking-tight");
476
+ if (traits.text.variant === "h2") classes.push("text-3xl font-bold");
477
+ if (traits.text.variant === "h3") classes.push("text-xl font-semibold");
478
+ if (traits.text.variant === "subtitle") classes.push("text-xl text-gray-400");
479
+ if (traits.text.variant === "caption") classes.push("text-sm text-gray-500");
480
+ if (traits.text.variant === "emoji") classes.push("text-2xl");
481
+ }
482
+ if (traits.button) {
483
+ classes.push("px-4 py-2 rounded-lg font-medium transition-all");
484
+ if (traits.button.variant === "primary")
485
+ classes.push("bg-blue-600 hover:bg-blue-700 text-white");
486
+ if (traits.button.variant === "outline")
487
+ classes.push("border border-gray-600 hover:bg-gray-800 text-white");
488
+ if (traits.button.variant === "ghost")
489
+ classes.push("hover:bg-gray-800 text-gray-300 hover:text-white");
490
+ if (traits.button.variant === "glow")
491
+ classes.push("bg-indigo-600 text-white glow-btn hover:bg-indigo-500");
492
+ if (traits.button.size === "lg") classes.push("px-6 py-3 text-lg");
493
+ if (traits.button.size === "sm") classes.push("px-3 py-1 text-sm");
494
+ }
495
+ if (traits.card) {
496
+ if (traits.card.shadow === "md") classes.push("shadow-md");
497
+ if (traits.card.shadow === "lg") classes.push("shadow-lg");
498
+ if (traits.card.hover === "glow") classes.push("lift-card");
499
+ }
500
+ if (traits.input) {
501
+ classes.push(
502
+ "px-4 py-2 rounded-lg border border-gray-700 bg-gray-900 text-white focus:ring-2 focus:ring-indigo-500 outline-none"
503
+ );
504
+ }
505
+ if (traits.tailwind?.classes) {
506
+ classes.push(traits.tailwind.classes);
507
+ }
508
+ return classes;
509
+ }
510
+ camelToKebab(str) {
511
+ return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
512
+ }
513
+ };
514
+ }
515
+ });
47
516
 
48
517
  // src/compiler/NextJSAPICompiler.ts
49
518
  var NextJSAPICompiler_exports = {};
50
- chunkEGIZHYJP_cjs.__export(NextJSAPICompiler_exports, {
519
+ chunk3SAK5KFL_cjs.__export(NextJSAPICompiler_exports, {
520
+ NextJSAPICompiler: () => NextJSAPICompiler,
51
521
  compileAllToNextJSAPI: () => compileAllToNextJSAPI,
52
522
  compileToNextJSAPI: () => compileToNextJSAPI
53
523
  });
@@ -104,9 +574,7 @@ function extractHandlers(composition) {
104
574
  const rawMethod = toScalar(traitConfig["method"]) ?? props.get("method");
105
575
  const method = parseMethod(rawMethod);
106
576
  if (!method) continue;
107
- const traitStatus = toScalar(
108
- traitConfig["statusCode"] ?? traitConfig["status"]
109
- );
577
+ const traitStatus = toScalar(traitConfig["statusCode"] ?? traitConfig["status"]);
110
578
  const propStatus = props.get("statusCode") ?? props.get("status");
111
579
  byMethod.set(method, {
112
580
  method,
@@ -198,182 +666,932 @@ function compileToNextJSAPI(composition, options = {}) {
198
666
  function compileAllToNextJSAPI(compositions, options = {}) {
199
667
  return compositions.map(({ composition }) => compileToNextJSAPI(composition, options));
200
668
  }
201
- var VALID_METHODS, BODY_METHODS, PASSTHROUGH_METHODS;
202
- var init_NextJSAPICompiler = chunkEGIZHYJP_cjs.__esm({
669
+ var VALID_METHODS, BODY_METHODS, PASSTHROUGH_METHODS, NextJSAPICompiler;
670
+ var init_NextJSAPICompiler = chunk3SAK5KFL_cjs.__esm({
203
671
  "src/compiler/NextJSAPICompiler.ts"() {
204
- VALID_METHODS = /* @__PURE__ */ new Set(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]);
672
+ chunkBF2235SI_cjs.init_CompilerBase();
673
+ VALID_METHODS = /* @__PURE__ */ new Set([
674
+ "GET",
675
+ "POST",
676
+ "PUT",
677
+ "PATCH",
678
+ "DELETE",
679
+ "HEAD",
680
+ "OPTIONS"
681
+ ]);
205
682
  BODY_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH"]);
206
683
  PASSTHROUGH_METHODS = /* @__PURE__ */ new Set(["HEAD", "DELETE"]);
684
+ NextJSAPICompiler = class extends chunkBF2235SI_cjs.CompilerBase {
685
+ constructor(options = {}) {
686
+ super();
687
+ this.options = options;
688
+ }
689
+ get name() {
690
+ return "nextjs-api";
691
+ }
692
+ compile(composition, agentToken) {
693
+ const comp = composition;
694
+ const result = compileAllToNextJSAPI(comp);
695
+ return {
696
+ code: result.map((r) => r.code).join("\n\n"),
697
+ files: result.map((r) => ({ path: r.routePath, content: r.code }))
698
+ };
699
+ }
700
+ compileSingle(composition, agentToken) {
701
+ const comp = composition;
702
+ return compileToNextJSAPI(comp);
703
+ }
704
+ };
207
705
  }
208
706
  });
209
707
 
210
- // src/compiler/registerBuiltinDialects.ts
211
- var registerBuiltinDialects_exports = {};
212
- chunkEGIZHYJP_cjs.__export(registerBuiltinDialects_exports, {
213
- registerBuiltinDialects: () => registerBuiltinDialects
708
+ // src/compiler/NodeServiceCompiler.ts
709
+ var NodeServiceCompiler_exports = {};
710
+ chunk3SAK5KFL_cjs.__export(NodeServiceCompiler_exports, {
711
+ NodeServiceCompiler: () => exports.NodeServiceCompiler
214
712
  });
215
- function registerBuiltinDialects() {
216
- if (_registered) return;
217
- _registered = true;
218
- const descriptors = [
219
- // ── Game Engines ──────────────────────────────────────────────────────
220
- {
221
- name: "unity",
222
- domain: "gamedev",
223
- description: "Compiles to Unity C# MonoBehaviours",
224
- supportedTraits: [
225
- "physics",
226
- "collidable",
227
- "grabbable",
228
- "throwable",
229
- "audio",
230
- "spatial_audio",
231
- "animation",
232
- "particles",
233
- "material",
234
- "ui",
235
- "networked",
236
- "behavior_tree",
237
- "navmesh",
238
- "lod"
239
- ],
240
- riskTier: "standard",
241
- factory: (opts) => {
242
- const { UnityCompiler: UnityCompiler2 } = (chunk7KPI4EKH_cjs.init_UnityCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunk7KPI4EKH_cjs.UnityCompiler_exports));
243
- return new UnityCompiler2(opts);
244
- },
245
- outputExtensions: [".cs"]
246
- },
247
- {
248
- name: "unreal",
249
- domain: "gamedev",
250
- description: "Compiles to Unreal Engine C++ actors",
251
- supportedTraits: [
252
- "physics",
253
- "collidable",
254
- "grabbable",
255
- "audio",
256
- "animation",
257
- "particles",
258
- "material",
259
- "niagara",
260
- "landscape",
261
- "behavior_tree",
262
- "navmesh",
263
- "lod"
264
- ],
265
- riskTier: "standard",
266
- factory: (opts) => {
267
- const { UnrealCompiler } = (chunkXSUZMPVQ_cjs.init_UnrealCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkXSUZMPVQ_cjs.UnrealCompiler_exports));
268
- return new UnrealCompiler(opts);
269
- },
270
- outputExtensions: [".cpp", ".h"]
271
- },
272
- {
273
- name: "godot",
274
- domain: "gamedev",
275
- description: "Compiles to Godot GDScript nodes",
276
- supportedTraits: [
277
- "physics",
278
- "collidable",
279
- "grabbable",
280
- "audio",
281
- "animation",
282
- "particles",
283
- "material",
284
- "behavior_tree",
285
- "navmesh"
286
- ],
287
- riskTier: "standard",
288
- factory: (opts) => {
289
- const { GodotCompiler: GodotCompiler2 } = (chunkNTMZSDXM_cjs.init_GodotCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkNTMZSDXM_cjs.GodotCompiler_exports));
290
- return new GodotCompiler2(opts);
291
- },
292
- outputExtensions: [".gd", ".tscn"]
293
- },
294
- // ── Web 3D ────────────────────────────────────────────────────────────
295
- {
296
- name: "r3f",
297
- domain: "web3d",
298
- description: "Compiles to React Three Fiber JSX components",
299
- supportedTraits: [
300
- "physics",
301
- "collidable",
302
- "grabbable",
303
- "audio",
304
- "spatial_audio",
305
- "animation",
306
- "particles",
307
- "material",
308
- "ui",
309
- "behavior_tree",
310
- "lod",
311
- "vr_only",
312
- "ar_only"
313
- ],
314
- riskTier: "standard",
315
- factory: (opts) => {
316
- const { R3FCompiler: R3FCompiler2 } = (chunkTSWTWZ42_cjs.init_R3FCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkTSWTWZ42_cjs.R3FCompiler_exports));
317
- return new R3FCompiler2(opts);
318
- },
319
- outputExtensions: [".tsx", ".jsx"]
320
- },
321
- {
322
- name: "babylon",
323
- domain: "web3d",
324
- description: "Compiles to Babylon.js scene code",
325
- supportedTraits: [
326
- "physics",
327
- "collidable",
328
- "audio",
329
- "animation",
330
- "particles",
331
- "material",
332
- "behavior_tree"
333
- ],
334
- riskTier: "standard",
335
- factory: (opts) => {
336
- const { BabylonCompiler: BabylonCompiler2 } = (chunk2UX5LRAP_cjs.init_BabylonCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunk2UX5LRAP_cjs.BabylonCompiler_exports));
337
- return new BabylonCompiler2(opts);
338
- },
339
- outputExtensions: [".ts", ".js"]
340
- },
341
- {
342
- name: "playcanvas",
343
- domain: "web3d",
344
- description: "Compiles to PlayCanvas engine scripts",
345
- supportedTraits: ["physics", "collidable", "audio", "animation", "material"],
346
- riskTier: "standard",
347
- factory: (opts) => {
348
- const { PlayCanvasCompiler: PlayCanvasCompiler2 } = (chunkPQLGZKMC_cjs.init_PlayCanvasCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkPQLGZKMC_cjs.PlayCanvasCompiler_exports));
349
- return new PlayCanvasCompiler2(opts);
350
- },
351
- outputExtensions: [".js"]
352
- },
353
- // ── VR/XR ─────────────────────────────────────────────────────────────
354
- {
355
- name: "openxr",
356
- domain: "xr",
357
- description: "Compiles to OpenXR C++ application layer",
358
- supportedTraits: [
359
- "physics",
360
- "hand_tracking",
361
- "spatial_anchor",
362
- "input",
363
- "collidable",
364
- "grabbable"
365
- ],
366
- riskTier: "standard",
367
- factory: (opts) => {
368
- const { OpenXRCompiler: OpenXRCompiler2 } = (chunkXDXZM3ZP_cjs.init_OpenXRCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkXDXZM3ZP_cjs.OpenXRCompiler_exports));
369
- return new OpenXRCompiler2(opts);
370
- },
371
- outputExtensions: [".cpp", ".h"]
372
- },
373
- {
374
- name: "vrchat",
375
- domain: "social-vr",
376
- description: "Compiles to VRChat UdonSharp scripts",
713
+ exports.NodeServiceCompiler = void 0;
714
+ var init_NodeServiceCompiler = chunk3SAK5KFL_cjs.__esm({
715
+ "src/compiler/NodeServiceCompiler.ts"() {
716
+ chunkBF2235SI_cjs.init_CompilerBase();
717
+ chunkBF2235SI_cjs.init_identity();
718
+ init_DialectRegistry();
719
+ chunkXG23EUQX_cjs.init_constants();
720
+ exports.NodeServiceCompiler = class extends chunkBF2235SI_cjs.CompilerBase {
721
+ constructor(options = {}) {
722
+ super();
723
+ this.compilerName = "NodeServiceCompiler";
724
+ this.services = [];
725
+ this.options = {
726
+ framework: options.framework ?? "express",
727
+ port: options.port ?? 3e3,
728
+ apiPrefix: options.apiPrefix ?? "/api",
729
+ typescript: options.typescript ?? true,
730
+ nodeVersion: options.nodeVersion ?? "20",
731
+ includeDocker: options.includeDocker ?? false
732
+ };
733
+ }
734
+ getRequiredCapability() {
735
+ return chunkBF2235SI_cjs.ANSCapabilityPath.NODE_SERVICE;
736
+ }
737
+ compile(composition, agentToken, outputPath) {
738
+ console.log("DEBUG: Composition:", JSON.stringify(composition, null, 2));
739
+ this.validateCompilerAccess(agentToken, outputPath);
740
+ this.services = [];
741
+ this.extractServices(composition);
742
+ const output = {};
743
+ output[this.ext("index")] = this.emitEntryPoint();
744
+ for (const service of this.services) {
745
+ output[this.ext(`routes/${this.toFileName(service.name)}`)] = this.emitRouteModule(service);
746
+ }
747
+ const allMiddleware = this.collectMiddleware();
748
+ if (allMiddleware.length > 0) {
749
+ output[this.ext("middleware/index")] = this.emitMiddlewareIndex(allMiddleware);
750
+ }
751
+ const allEnvVars = this.collectEnvVars();
752
+ if (allEnvVars.length > 0) {
753
+ output[this.ext("config/env")] = this.emitEnvConfig(allEnvVars);
754
+ }
755
+ const allConnectors = this.collectConnectors();
756
+ if (allConnectors.length > 0) {
757
+ output[this.ext("connectors/index")] = this.emitConnectorsIndex(allConnectors);
758
+ }
759
+ const railwayService = this.services.find((s) => s.deploy?.platform === "railway");
760
+ if (railwayService?.deploy) {
761
+ output["railway.json"] = this.emitRailwayConfig(railwayService.deploy);
762
+ }
763
+ output["package.json"] = this.emitPackageJson(composition.name);
764
+ if (this.options.typescript) {
765
+ output["tsconfig.json"] = this.emitTsConfig();
766
+ }
767
+ if (this.options.includeDocker) {
768
+ output["Dockerfile"] = this.emitDockerfile();
769
+ }
770
+ this.validateConnectorIntegration();
771
+ return output;
772
+ }
773
+ // ── Extraction ─────────────────────────────────────────────────────────
774
+ extractServices(composition) {
775
+ if (composition.domainBlocks) {
776
+ for (const block of composition.domainBlocks) {
777
+ if (this.isServiceBlock(block)) {
778
+ this.services.push(this.parseServiceBlock(block));
779
+ }
780
+ }
781
+ }
782
+ if (composition.objects) {
783
+ for (const obj of composition.objects) {
784
+ if (this.hasServiceTraits(obj)) {
785
+ this.services.push(this.parseServiceObject(obj));
786
+ }
787
+ }
788
+ }
789
+ if (this.services.length === 0) {
790
+ this.services.push({
791
+ name: composition.name || "App",
792
+ routes: [],
793
+ middleware: [],
794
+ connectors: [],
795
+ envVars: [],
796
+ port: this.options.port
797
+ });
798
+ }
799
+ }
800
+ isServiceBlock(block) {
801
+ return block.keyword === "service" || block.keyword === "endpoint" || block.keyword === "gateway" || block.keyword === "handler";
802
+ }
803
+ hasServiceTraits(obj) {
804
+ if (!obj.traits) return false;
805
+ const serviceTraits = ["service", "endpoint", "http", "handler", "route", "connector", "env", "deploy"];
806
+ return obj.traits.some((t) => serviceTraits.includes(t.name));
807
+ }
808
+ parseServiceBlock(block) {
809
+ const service = {
810
+ name: block.name,
811
+ routes: [],
812
+ middleware: [],
813
+ port: this.resolveNumber(block.properties["port"]) ?? this.options.port,
814
+ connectors: [],
815
+ envVars: []
816
+ };
817
+ if (block.traits) {
818
+ service.middleware = this.extractMiddlewareFromTraits(block.traits);
819
+ service.connectors = this.extractConnectors(block.traits, block.properties);
820
+ service.envVars = this.extractEnvVars(block.traits, block.properties);
821
+ service.deploy = this.extractDeploy(block.traits, block.properties);
822
+ }
823
+ if (block.children) {
824
+ for (const child of block.children) {
825
+ const route = this.extractRoute(child, block.name);
826
+ if (route) service.routes.push(route);
827
+ }
828
+ }
829
+ const inlineRoute = this.extractInlineRoute(block);
830
+ if (inlineRoute) service.routes.push(inlineRoute);
831
+ return service;
832
+ }
833
+ parseServiceObject(obj) {
834
+ const service = {
835
+ name: obj.name,
836
+ routes: [],
837
+ middleware: [],
838
+ port: this.options.port,
839
+ connectors: [],
840
+ envVars: []
841
+ };
842
+ if (obj.traits) {
843
+ const traitNames = obj.traits.map((t) => t.name);
844
+ service.middleware = this.extractMiddlewareFromTraits(traitNames);
845
+ service.connectors = this.extractConnectors(traitNames, this.objectPropsToMap(obj.properties));
846
+ service.envVars = this.extractEnvVars(traitNames, this.objectPropsToMap(obj.properties));
847
+ service.deploy = this.extractDeploy(traitNames, this.objectPropsToMap(obj.properties));
848
+ }
849
+ const route = this.extractRoute(obj, obj.name);
850
+ if (route) service.routes.push(route);
851
+ return service;
852
+ }
853
+ extractRoute(obj, serviceName) {
854
+ const propMap = this.objectPropsToMap(obj.properties);
855
+ const traits = (obj.traits || []).map((t) => t.name);
856
+ const method = this.resolveString(propMap.get("method"))?.toUpperCase() || "GET";
857
+ const path = this.resolveString(propMap.get("path")) || `/${this.toKebab(obj.name)}`;
858
+ const handlerName = this.resolveString(propMap.get("handler")) || this.toCamelCase(obj.name);
859
+ const hasHttpInfo = propMap.has("method") || propMap.has("path") || traits.includes("http") || traits.includes("route");
860
+ if (!hasHttpInfo) return null;
861
+ return {
862
+ method,
863
+ path,
864
+ handlerName,
865
+ middleware: this.extractMiddlewareFromTraits(traits),
866
+ serviceName
867
+ };
868
+ }
869
+ extractInlineRoute(block) {
870
+ const props = block.properties;
871
+ if (!props["method"] && !props["path"]) return null;
872
+ return {
873
+ method: this.resolveString(props["method"])?.toUpperCase() || "GET",
874
+ path: this.resolveString(props["path"]) || `/${this.toKebab(block.name)}`,
875
+ handlerName: this.resolveString(props["handler"]) || this.toCamelCase(block.name),
876
+ middleware: [],
877
+ serviceName: block.name
878
+ };
879
+ }
880
+ extractMiddlewareFromTraits(traits) {
881
+ const mw = [];
882
+ for (const t of traits) {
883
+ if (t === "middleware" || t === "auth" || t === "rate_limit" || t === "cors" || t === "validation") {
884
+ mw.push(t);
885
+ }
886
+ }
887
+ return mw;
888
+ }
889
+ collectMiddleware() {
890
+ const set = /* @__PURE__ */ new Set();
891
+ for (const service of this.services) {
892
+ for (const mw of service.middleware) set.add(mw);
893
+ for (const route of service.routes) {
894
+ for (const mw of route.middleware) set.add(mw);
895
+ }
896
+ }
897
+ return [...set];
898
+ }
899
+ // ── Connector Extraction ──────────────────────────────────────────────
900
+ extractConnectors(traits, props) {
901
+ const connectors = [];
902
+ const propMap = props instanceof Map ? props : this.objectPropsToMapFromRecord(props);
903
+ for (const t of traits) {
904
+ if (t === "connector" || t === "@connector") {
905
+ const name = this.resolveString(propMap.get("connector_name")) || "unknown";
906
+ connectors.push({ name, config: {} });
907
+ }
908
+ }
909
+ return connectors;
910
+ }
911
+ extractEnvVars(traits, props) {
912
+ const envVars = [];
913
+ const propMap = props instanceof Map ? props : this.objectPropsToMapFromRecord(props);
914
+ for (const t of traits) {
915
+ if (t === "env" || t === "@env") {
916
+ const name = this.resolveString(propMap.get("env_name")) || "UNKNOWN_VAR";
917
+ envVars.push({
918
+ name,
919
+ required: this.resolveBoolean(propMap.get("env_required")) ?? true,
920
+ defaultValue: this.resolveString(propMap.get("env_default"))
921
+ });
922
+ }
923
+ }
924
+ return envVars;
925
+ }
926
+ extractDeploy(traits, props) {
927
+ if (!traits.some((t) => t === "deploy" || t === "@deploy")) return void 0;
928
+ const propMap = props instanceof Map ? props : this.objectPropsToMapFromRecord(props);
929
+ return {
930
+ platform: this.resolveString(propMap.get("platform")) || "railway",
931
+ service: this.resolveString(propMap.get("service")),
932
+ environment: this.resolveString(propMap.get("environment")),
933
+ healthPath: this.resolveString(propMap.get("healthPath")) || "/health"
934
+ };
935
+ }
936
+ objectPropsToMapFromRecord(props) {
937
+ const map = /* @__PURE__ */ new Map();
938
+ for (const [k, v] of Object.entries(props)) {
939
+ map.set(k, v);
940
+ }
941
+ return map;
942
+ }
943
+ resolveBoolean(val) {
944
+ if (val === void 0 || val === null) return void 0;
945
+ if (typeof val === "boolean") return val;
946
+ if (typeof val === "string") return val === "true";
947
+ return void 0;
948
+ }
949
+ // ── Code Emission ──────────────────────────────────────────────────────
950
+ emitEntryPoint() {
951
+ const isExpress = this.options.framework === "express";
952
+ const lines = [];
953
+ lines.push(`/**`);
954
+ lines.push(` * Auto-generated by HoloScript NodeServiceCompiler v0.1.0`);
955
+ lines.push(` * Framework: ${this.options.framework}`);
956
+ lines.push(` */`);
957
+ lines.push("");
958
+ if (isExpress) {
959
+ lines.push(`import express from 'express';`);
960
+ lines.push(`import './config/env';`);
961
+ const hasConnectors = this.collectConnectors().length > 0;
962
+ if (hasConnectors) {
963
+ lines.push(`import { initConnectors } from './connectors';`);
964
+ }
965
+ for (const service of this.services) {
966
+ const importName = `${this.toCamelCase(service.name)}Routes`;
967
+ lines.push(`import { ${importName} } from './routes/${this.toFileName(service.name)}';`);
968
+ }
969
+ lines.push("");
970
+ lines.push(`const app = express();`);
971
+ lines.push(`app.use(express.json());`);
972
+ lines.push(`app.use(express.urlencoded({ extended: true }));`);
973
+ lines.push("");
974
+ for (const service of this.services) {
975
+ const importName = `${this.toCamelCase(service.name)}Routes`;
976
+ lines.push(
977
+ `app.use('${this.escapeStringValue(this.options.apiPrefix, "TypeScript")}', ${importName});`
978
+ );
979
+ }
980
+ lines.push("");
981
+ lines.push(`const PORT = process.env['PORT'] || ${this.options.port};`);
982
+ if (hasConnectors) {
983
+ lines.push(`initConnectors().then(() => {`);
984
+ lines.push(` app.listen(PORT, () => {`);
985
+ lines.push(` console.log(\`Server running on port \${PORT}\`);`);
986
+ lines.push(` });`);
987
+ lines.push(`});`);
988
+ } else {
989
+ lines.push(`app.listen(PORT, () => {`);
990
+ lines.push(` console.log(\`Server running on port \${PORT}\`);`);
991
+ lines.push(`});`);
992
+ }
993
+ lines.push("");
994
+ lines.push(`export { app };`);
995
+ } else {
996
+ lines.push(`import Fastify from 'fastify';`);
997
+ for (const service of this.services) {
998
+ const importName = `${this.toCamelCase(service.name)}Routes`;
999
+ lines.push(`import { ${importName} } from './routes/${this.toFileName(service.name)}';`);
1000
+ }
1001
+ lines.push("");
1002
+ lines.push(`const app = Fastify({ logger: true });`);
1003
+ lines.push("");
1004
+ for (const service of this.services) {
1005
+ const importName = `${this.toCamelCase(service.name)}Routes`;
1006
+ lines.push(
1007
+ `app.register(${importName}, { prefix: '${this.escapeStringValue(this.options.apiPrefix, "TypeScript")}' });`
1008
+ );
1009
+ }
1010
+ lines.push("");
1011
+ lines.push(`const PORT = Number(process.env['PORT']) || ${this.options.port};`);
1012
+ lines.push(`app.listen({ port: PORT, host: '0.0.0.0' }).then((address) => {`);
1013
+ lines.push(` console.log(\`Server running at \${address}\`);`);
1014
+ lines.push(`});`);
1015
+ lines.push("");
1016
+ lines.push(`export { app };`);
1017
+ }
1018
+ return lines.join("\n");
1019
+ }
1020
+ emitRouteModule(service) {
1021
+ const isExpress = this.options.framework === "express";
1022
+ const lines = [];
1023
+ const routerName = `${this.toCamelCase(service.name)}Routes`;
1024
+ lines.push(`/**`);
1025
+ lines.push(` * Routes for ${service.name}`);
1026
+ lines.push(` * Auto-generated by HoloScript NodeServiceCompiler`);
1027
+ lines.push(` */`);
1028
+ lines.push("");
1029
+ if (isExpress) {
1030
+ lines.push(`import { Router } from 'express';`);
1031
+ if (this.options.typescript) {
1032
+ lines.push(`import type { Request, Response } from 'express';`);
1033
+ }
1034
+ lines.push("");
1035
+ lines.push(`const router = Router();`);
1036
+ lines.push("");
1037
+ for (const route of service.routes) {
1038
+ const methodLower = route.method.toLowerCase();
1039
+ const mwArgs = route.middleware.length > 0 ? route.middleware.map((mw) => `/* ${mw} */`).join(", ") + ", " : "";
1040
+ lines.push(`// ${route.method} ${route.path}`);
1041
+ if (this.options.typescript) {
1042
+ lines.push(
1043
+ `router.${methodLower}('${this.escapeStringValue(route.path, "TypeScript")}', ${mwArgs}(req: Request, res: Response) => {`
1044
+ );
1045
+ } else {
1046
+ lines.push(
1047
+ `router.${methodLower}('${this.escapeStringValue(route.path, "TypeScript")}', ${mwArgs}(req, res) => {`
1048
+ );
1049
+ }
1050
+ lines.push(` // TODO: Implement ${route.handlerName}`);
1051
+ lines.push(
1052
+ ` res.json({ message: '${this.escapeStringValue(route.handlerName, "TypeScript")} not implemented' });`
1053
+ );
1054
+ lines.push(`});`);
1055
+ lines.push("");
1056
+ }
1057
+ if (service.routes.length === 0) {
1058
+ lines.push(`// Default health check`);
1059
+ if (this.options.typescript) {
1060
+ lines.push(`router.get('/health', (_req: Request, res: Response) => {`);
1061
+ } else {
1062
+ lines.push(`router.get('/health', (_req, res) => {`);
1063
+ }
1064
+ lines.push(
1065
+ ` res.json({ status: 'ok', service: '${this.escapeStringValue(service.name, "TypeScript")}' });`
1066
+ );
1067
+ lines.push(`});`);
1068
+ lines.push("");
1069
+ }
1070
+ lines.push(`export { router as ${routerName} };`);
1071
+ } else {
1072
+ lines.push(`import type { FastifyInstance } from 'fastify';`);
1073
+ lines.push("");
1074
+ lines.push(`export async function ${routerName}(app: FastifyInstance) {`);
1075
+ for (const route of service.routes) {
1076
+ const methodLower = route.method.toLowerCase();
1077
+ lines.push(` // ${route.method} ${route.path}`);
1078
+ lines.push(
1079
+ ` app.${methodLower}('${this.escapeStringValue(route.path, "TypeScript")}', async (request, reply) => {`
1080
+ );
1081
+ lines.push(` // TODO: Implement ${route.handlerName}`);
1082
+ lines.push(
1083
+ ` return { message: '${this.escapeStringValue(route.handlerName, "TypeScript")} not implemented' };`
1084
+ );
1085
+ lines.push(` });`);
1086
+ lines.push("");
1087
+ }
1088
+ if (service.routes.length === 0) {
1089
+ lines.push(` // Default health check`);
1090
+ lines.push(` app.get('/health', async () => {`);
1091
+ lines.push(
1092
+ ` return { status: 'ok', service: '${this.escapeStringValue(service.name, "TypeScript")}' };`
1093
+ );
1094
+ lines.push(` });`);
1095
+ lines.push("");
1096
+ }
1097
+ lines.push(`}`);
1098
+ }
1099
+ return lines.join("\n");
1100
+ }
1101
+ emitMiddlewareIndex(middleware) {
1102
+ const lines = [];
1103
+ lines.push(`/**`);
1104
+ lines.push(` * Middleware stubs`);
1105
+ lines.push(` * Auto-generated by HoloScript NodeServiceCompiler`);
1106
+ lines.push(` */`);
1107
+ lines.push("");
1108
+ if (this.options.framework === "express") {
1109
+ lines.push(`import type { Request, Response, NextFunction } from 'express';`);
1110
+ lines.push("");
1111
+ for (const mw of middleware) {
1112
+ const fnName = this.toCamelCase(mw) + "Middleware";
1113
+ lines.push(`export function ${fnName}(req: Request, _res: Response, next: NextFunction) {`);
1114
+ lines.push(` // TODO: Implement ${mw} middleware`);
1115
+ lines.push(` next();`);
1116
+ lines.push(`}`);
1117
+ lines.push("");
1118
+ }
1119
+ } else {
1120
+ lines.push(
1121
+ `import type { FastifyRequest, FastifyReply, HookHandlerDoneFunction } from 'fastify';`
1122
+ );
1123
+ lines.push("");
1124
+ for (const mw of middleware) {
1125
+ const fnName = this.toCamelCase(mw) + "Middleware";
1126
+ lines.push(
1127
+ `export function ${fnName}(request: FastifyRequest, _reply: FastifyReply, done: HookHandlerDoneFunction) {`
1128
+ );
1129
+ lines.push(` // TODO: Implement ${mw} middleware`);
1130
+ lines.push(` done();`);
1131
+ lines.push(`}`);
1132
+ lines.push("");
1133
+ }
1134
+ }
1135
+ return lines.join("\n");
1136
+ }
1137
+ emitPackageJson(projectName) {
1138
+ const name = this.toKebab(projectName || "holoscript-service");
1139
+ const isExpress = this.options.framework === "express";
1140
+ const dependencies = isExpress ? { express: "^4.21.0", dotenv: "^16.4.0" } : { fastify: "^5.0.0", dotenv: "^16.4.0" };
1141
+ const connectors = this.collectConnectors();
1142
+ for (const conn of connectors) {
1143
+ const pkg2 = chunkXG23EUQX_cjs.CONNECTOR_PACKAGES[conn.name];
1144
+ if (pkg2) {
1145
+ dependencies[pkg2] = "latest";
1146
+ }
1147
+ }
1148
+ const pkg = {
1149
+ name,
1150
+ version: "0.1.0",
1151
+ description: `Generated by HoloScript NodeServiceCompiler`,
1152
+ main: this.options.typescript ? "dist/index.js" : "index.js",
1153
+ scripts: {
1154
+ ...this.options.typescript ? {
1155
+ build: "tsc",
1156
+ start: "node dist/index.js",
1157
+ dev: "tsx watch index.ts"
1158
+ } : {
1159
+ start: "node index.js",
1160
+ dev: "node --watch index.js"
1161
+ }
1162
+ },
1163
+ dependencies,
1164
+ ...this.options.typescript && {
1165
+ devDependencies: {
1166
+ typescript: "^5.5.0",
1167
+ tsx: "^4.0.0",
1168
+ ...isExpress ? { "@types/express": "^4.17.21", "@types/node": "^20.0.0" } : { "@types/node": "^20.0.0" }
1169
+ }
1170
+ }
1171
+ };
1172
+ return JSON.stringify(pkg, null, 2);
1173
+ }
1174
+ emitTsConfig() {
1175
+ const config = {
1176
+ compilerOptions: {
1177
+ target: "ES2022",
1178
+ module: "NodeNext",
1179
+ moduleResolution: "NodeNext",
1180
+ outDir: "./dist",
1181
+ rootDir: "./",
1182
+ strict: true,
1183
+ esModuleInterop: true,
1184
+ skipLibCheck: true,
1185
+ declaration: true
1186
+ },
1187
+ include: ["./**/*.ts"],
1188
+ exclude: ["node_modules", "dist"]
1189
+ };
1190
+ return JSON.stringify(config, null, 2);
1191
+ }
1192
+ emitDockerfile() {
1193
+ const nodeVer = this.options.nodeVersion;
1194
+ return [
1195
+ `FROM node:${nodeVer}-alpine AS builder`,
1196
+ `WORKDIR /app`,
1197
+ `COPY package*.json ./`,
1198
+ `RUN npm ci`,
1199
+ `COPY . .`,
1200
+ ...this.options.typescript ? [`RUN npm run build`] : [],
1201
+ ``,
1202
+ `FROM node:${nodeVer}-alpine`,
1203
+ `WORKDIR /app`,
1204
+ `COPY --from=builder /app/package*.json ./`,
1205
+ `RUN npm ci --omit=dev`,
1206
+ ...this.options.typescript ? [`COPY --from=builder /app/dist ./dist`] : [`COPY --from=builder /app/*.js ./`],
1207
+ `EXPOSE ${this.options.port}`,
1208
+ `CMD ["npm", "start"]`,
1209
+ ``
1210
+ ].join("\n");
1211
+ }
1212
+ // ── Utilities ──────────────────────────────────────────────────────────
1213
+ collectEnvVars() {
1214
+ const map = /* @__PURE__ */ new Map();
1215
+ for (const service of this.services) {
1216
+ for (const env of service.envVars) {
1217
+ map.set(env.name, env);
1218
+ }
1219
+ for (const conn of service.connectors) {
1220
+ const requirements = chunkXG23EUQX_cjs.CONNECTOR_ENV_REQUIREMENTS[conn.name] || [];
1221
+ for (const req of requirements) {
1222
+ if (!map.has(req)) {
1223
+ map.set(req, { name: req, required: true });
1224
+ }
1225
+ }
1226
+ }
1227
+ }
1228
+ return Array.from(map.values());
1229
+ }
1230
+ collectConnectors() {
1231
+ const map = /* @__PURE__ */ new Map();
1232
+ for (const service of this.services) {
1233
+ for (const conn of service.connectors) {
1234
+ map.set(conn.name, conn);
1235
+ }
1236
+ }
1237
+ return Array.from(map.values());
1238
+ }
1239
+ // ── Emitters ──────────────────────────────────────────────────────────
1240
+ emitEnvConfig(envVars) {
1241
+ const lines = [];
1242
+ lines.push(`/**`);
1243
+ lines.push(` * Environment Configuration`);
1244
+ lines.push(` * Auto-generated by HoloScript NodeServiceCompiler`);
1245
+ lines.push(` */`);
1246
+ lines.push(``);
1247
+ lines.push(`import dotenv from 'dotenv';`);
1248
+ lines.push(`dotenv.config();`);
1249
+ lines.push(``);
1250
+ lines.push(`export const env = {`);
1251
+ for (const ev of envVars) {
1252
+ const fallback = ev.defaultValue ? ` || '${ev.defaultValue}'` : "";
1253
+ lines.push(` ${ev.name}: process.env['${ev.name}']${fallback},`);
1254
+ }
1255
+ lines.push(`};`);
1256
+ lines.push(``);
1257
+ lines.push(`// Validation`);
1258
+ lines.push(`const missing: string[] = [];`);
1259
+ for (const ev of envVars) {
1260
+ if (ev.required) {
1261
+ lines.push(`if (!env.${ev.name}) missing.push('${ev.name}');`);
1262
+ }
1263
+ }
1264
+ lines.push(``);
1265
+ lines.push(`if (missing.length > 0) {`);
1266
+ lines.push(` console.error('Missing required environment variables:', missing.join(', '));`);
1267
+ lines.push(` process.exit(1);`);
1268
+ lines.push(`}`);
1269
+ return lines.join("\n");
1270
+ }
1271
+ emitConnectorsIndex(connectors) {
1272
+ const lines = [];
1273
+ lines.push(`/**`);
1274
+ lines.push(` * Connector Registry`);
1275
+ lines.push(` * Auto-generated by HoloScript NodeServiceCompiler`);
1276
+ lines.push(` */`);
1277
+ lines.push(``);
1278
+ for (const conn of connectors) {
1279
+ const pkg = chunkXG23EUQX_cjs.CONNECTOR_PACKAGES[conn.name];
1280
+ if (pkg) {
1281
+ lines.push(`import { ${this.toClassName(conn.name)}Connector } from '${pkg}';`);
1282
+ }
1283
+ }
1284
+ lines.push(``);
1285
+ for (const conn of connectors) {
1286
+ const className = this.toClassName(conn.name);
1287
+ lines.push(`export const ${conn.name} = new ${className}Connector();`);
1288
+ }
1289
+ lines.push(``);
1290
+ lines.push(`export async function initConnectors(): Promise<void> {`);
1291
+ lines.push(` await Promise.all([`);
1292
+ for (const conn of connectors) {
1293
+ lines.push(` ${conn.name}.connect(),`);
1294
+ }
1295
+ lines.push(` ]);`);
1296
+ for (const conn of connectors) {
1297
+ lines.push(` console.log('[connectors] ${conn.name}: connected');`);
1298
+ }
1299
+ lines.push(`}`);
1300
+ lines.push(``);
1301
+ lines.push(`export async function shutdownConnectors(): Promise<void> {`);
1302
+ lines.push(` await Promise.all([`);
1303
+ for (const conn of connectors) {
1304
+ lines.push(` ${conn.name}.disconnect(),`);
1305
+ }
1306
+ lines.push(` ]);`);
1307
+ lines.push(`}`);
1308
+ return lines.join("\n");
1309
+ }
1310
+ emitRailwayConfig(deploy) {
1311
+ const config = {
1312
+ $schema: "https://railway.app/railway.schema.json",
1313
+ build: {
1314
+ builder: "DOCKERFILE",
1315
+ dockerfilePath: "Dockerfile"
1316
+ },
1317
+ deploy: {
1318
+ numReplicas: 1,
1319
+ sleepApplication: false,
1320
+ restartPolicyType: "ON_FAILURE",
1321
+ healthcheckPath: deploy.healthPath || "/health"
1322
+ }
1323
+ };
1324
+ return JSON.stringify(config, null, 2);
1325
+ }
1326
+ toClassName(name) {
1327
+ return name.charAt(0).toUpperCase() + this.toCamelCase(name).slice(1);
1328
+ }
1329
+ /** Convert HoloObjectProperty[] to a Map for key-based lookup */
1330
+ objectPropsToMap(props) {
1331
+ const map = /* @__PURE__ */ new Map();
1332
+ if (!props) return map;
1333
+ for (const prop of props) {
1334
+ map.set(prop.key, prop.value);
1335
+ }
1336
+ return map;
1337
+ }
1338
+ ext(name) {
1339
+ return this.options.typescript ? `${name}.ts` : `${name}.js`;
1340
+ }
1341
+ toFileName(name) {
1342
+ return name.replace(/[^a-zA-Z0-9]/g, "-").replace(/-+/g, "-");
1343
+ }
1344
+ toKebab(name) {
1345
+ return name.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[^a-zA-Z0-9]/g, "-").replace(/-+/g, "-").toLowerCase();
1346
+ }
1347
+ toCamelCase(name) {
1348
+ const parts = name.replace(/[^a-zA-Z0-9]/g, " ").split(/\s+/).filter(Boolean);
1349
+ if (parts.length === 0) return "unnamed";
1350
+ return parts[0].toLowerCase() + parts.slice(1).map((p) => p.charAt(0).toUpperCase() + p.slice(1).toLowerCase()).join("");
1351
+ }
1352
+ resolveString(val) {
1353
+ if (val === void 0 || val === null) return void 0;
1354
+ if (typeof val === "string") return val;
1355
+ if (typeof val === "object" && "value" in val) return String(val.value);
1356
+ return String(val);
1357
+ }
1358
+ resolveNumber(val) {
1359
+ if (val === void 0 || val === null) return void 0;
1360
+ if (typeof val === "number") return val;
1361
+ if (typeof val === "string") {
1362
+ const n = Number(val);
1363
+ return isNaN(n) ? void 0 : n;
1364
+ }
1365
+ if (typeof val === "object" && "value" in val) {
1366
+ const n = Number(val.value);
1367
+ return isNaN(n) ? void 0 : n;
1368
+ }
1369
+ return void 0;
1370
+ }
1371
+ validateConnectorIntegration() {
1372
+ const connectors = this.collectConnectors();
1373
+ const envVars = this.collectEnvVars();
1374
+ const envMap = new Map(envVars.map((ev) => [ev.name, ev]));
1375
+ for (const conn of connectors) {
1376
+ if (!chunkXG23EUQX_cjs.KNOWN_CONNECTORS.includes(conn.name)) {
1377
+ console.warn(`[NodeServiceCompiler] Warning: Unknown connector '${conn.name}'. Package dependency will not be added.`);
1378
+ } else {
1379
+ const requirements = chunkXG23EUQX_cjs.CONNECTOR_ENV_REQUIREMENTS[conn.name] || [];
1380
+ for (const req of requirements) {
1381
+ if (!envMap.has(req)) {
1382
+ throw new Error(`Connector '${conn.name}' requires environment variable '${req}'`);
1383
+ }
1384
+ }
1385
+ }
1386
+ }
1387
+ const deployable = this.services.find((s) => s.deploy);
1388
+ if (deployable?.deploy) {
1389
+ if (deployable.deploy.platform !== "railway") {
1390
+ console.warn(
1391
+ `[NodeServiceCompiler] Warning: Platform '${deployable.deploy.platform}' is not explicitly supported for config generation yet.`
1392
+ );
1393
+ }
1394
+ }
1395
+ }
1396
+ };
1397
+ exports.DialectRegistry.register({
1398
+ name: "node-service",
1399
+ domain: "service",
1400
+ description: "Compiles @service traits to Express/Fastify Node.js applications",
1401
+ supportedTraits: [
1402
+ "service",
1403
+ "endpoint",
1404
+ "route",
1405
+ "handler",
1406
+ "middleware",
1407
+ "http",
1408
+ "gateway",
1409
+ "proxy",
1410
+ "load_balancer",
1411
+ "auth",
1412
+ "cors",
1413
+ "rate_limit",
1414
+ "validation",
1415
+ "connector",
1416
+ "env",
1417
+ "deploy",
1418
+ "on_connector_event"
1419
+ ],
1420
+ riskTier: "standard",
1421
+ factory: (options) => new exports.NodeServiceCompiler(options),
1422
+ outputExtensions: [".ts", ".js", ".json"],
1423
+ experimental: true
1424
+ });
1425
+ }
1426
+ });
1427
+
1428
+ // src/compiler/registerBuiltinDialects.ts
1429
+ var registerBuiltinDialects_exports = {};
1430
+ chunk3SAK5KFL_cjs.__export(registerBuiltinDialects_exports, {
1431
+ registerBuiltinDialects: () => registerBuiltinDialects
1432
+ });
1433
+ function registerBuiltinDialects() {
1434
+ if (_registered) return;
1435
+ _registered = true;
1436
+ const descriptors = [
1437
+ // ── Game Engines ──────────────────────────────────────────────────────
1438
+ {
1439
+ name: "unity",
1440
+ domain: "gamedev",
1441
+ description: "Compiles to Unity C# MonoBehaviours",
1442
+ supportedTraits: [
1443
+ "physics",
1444
+ "collidable",
1445
+ "grabbable",
1446
+ "throwable",
1447
+ "audio",
1448
+ "spatial_audio",
1449
+ "animation",
1450
+ "particles",
1451
+ "material",
1452
+ "ui",
1453
+ "networked",
1454
+ "behavior_tree",
1455
+ "navmesh",
1456
+ "lod"
1457
+ ],
1458
+ riskTier: "standard",
1459
+ factory: (opts) => {
1460
+ const { UnityCompiler: UnityCompiler2 } = (chunkHE7ULERA_cjs.init_UnityCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkHE7ULERA_cjs.UnityCompiler_exports));
1461
+ return new UnityCompiler2(opts);
1462
+ },
1463
+ outputExtensions: [".cs"]
1464
+ },
1465
+ {
1466
+ name: "unreal",
1467
+ domain: "gamedev",
1468
+ description: "Compiles to Unreal Engine C++ actors",
1469
+ supportedTraits: [
1470
+ "physics",
1471
+ "collidable",
1472
+ "grabbable",
1473
+ "audio",
1474
+ "animation",
1475
+ "particles",
1476
+ "material",
1477
+ "niagara",
1478
+ "landscape",
1479
+ "behavior_tree",
1480
+ "navmesh",
1481
+ "lod"
1482
+ ],
1483
+ riskTier: "standard",
1484
+ factory: (opts) => {
1485
+ const { UnrealCompiler } = (chunk5OEOHAAW_cjs.init_UnrealCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunk5OEOHAAW_cjs.UnrealCompiler_exports));
1486
+ return new UnrealCompiler(opts);
1487
+ },
1488
+ outputExtensions: [".cpp", ".h"]
1489
+ },
1490
+ {
1491
+ name: "godot",
1492
+ domain: "gamedev",
1493
+ description: "Compiles to Godot GDScript nodes",
1494
+ supportedTraits: [
1495
+ "physics",
1496
+ "collidable",
1497
+ "grabbable",
1498
+ "audio",
1499
+ "animation",
1500
+ "particles",
1501
+ "material",
1502
+ "behavior_tree",
1503
+ "navmesh"
1504
+ ],
1505
+ riskTier: "standard",
1506
+ factory: (opts) => {
1507
+ const { GodotCompiler: GodotCompiler2 } = (chunkXXINBTZK_cjs.init_GodotCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkXXINBTZK_cjs.GodotCompiler_exports));
1508
+ return new GodotCompiler2(opts);
1509
+ },
1510
+ outputExtensions: [".gd", ".tscn"]
1511
+ },
1512
+ // ── Web 3D ────────────────────────────────────────────────────────────
1513
+ {
1514
+ name: "r3f",
1515
+ domain: "web3d",
1516
+ description: "Compiles to React Three Fiber JSX components",
1517
+ supportedTraits: [
1518
+ "physics",
1519
+ "collidable",
1520
+ "grabbable",
1521
+ "audio",
1522
+ "spatial_audio",
1523
+ "animation",
1524
+ "particles",
1525
+ "material",
1526
+ "ui",
1527
+ "behavior_tree",
1528
+ "lod",
1529
+ "vr_only",
1530
+ "ar_only"
1531
+ ],
1532
+ riskTier: "standard",
1533
+ factory: (opts) => {
1534
+ const { R3FCompiler: R3FCompiler2 } = (chunkQ5SJOGHQ_cjs.init_R3FCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkQ5SJOGHQ_cjs.R3FCompiler_exports));
1535
+ return new R3FCompiler2(opts);
1536
+ },
1537
+ outputExtensions: [".tsx", ".jsx"]
1538
+ },
1539
+ {
1540
+ name: "babylon",
1541
+ domain: "web3d",
1542
+ description: "Compiles to Babylon.js scene code",
1543
+ supportedTraits: [
1544
+ "physics",
1545
+ "collidable",
1546
+ "audio",
1547
+ "animation",
1548
+ "particles",
1549
+ "material",
1550
+ "behavior_tree"
1551
+ ],
1552
+ riskTier: "standard",
1553
+ factory: (opts) => {
1554
+ const { BabylonCompiler: BabylonCompiler2 } = (chunk33LSUQDD_cjs.init_BabylonCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunk33LSUQDD_cjs.BabylonCompiler_exports));
1555
+ return new BabylonCompiler2(opts);
1556
+ },
1557
+ outputExtensions: [".ts", ".js"]
1558
+ },
1559
+ {
1560
+ name: "playcanvas",
1561
+ domain: "web3d",
1562
+ description: "Compiles to PlayCanvas engine scripts",
1563
+ supportedTraits: ["physics", "collidable", "audio", "animation", "material"],
1564
+ riskTier: "standard",
1565
+ factory: (opts) => {
1566
+ const { PlayCanvasCompiler: PlayCanvasCompiler2 } = (chunkXWPNTWDN_cjs.init_PlayCanvasCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkXWPNTWDN_cjs.PlayCanvasCompiler_exports));
1567
+ return new PlayCanvasCompiler2(opts);
1568
+ },
1569
+ outputExtensions: [".js"]
1570
+ },
1571
+ // ── VR/XR ─────────────────────────────────────────────────────────────
1572
+ {
1573
+ name: "openxr",
1574
+ domain: "xr",
1575
+ description: "Compiles to OpenXR C++ application layer",
1576
+ supportedTraits: [
1577
+ "physics",
1578
+ "hand_tracking",
1579
+ "spatial_anchor",
1580
+ "input",
1581
+ "collidable",
1582
+ "grabbable"
1583
+ ],
1584
+ riskTier: "standard",
1585
+ factory: (opts) => {
1586
+ const { OpenXRCompiler: OpenXRCompiler2 } = (chunkFFKU7BTK_cjs.init_OpenXRCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkFFKU7BTK_cjs.OpenXRCompiler_exports));
1587
+ return new OpenXRCompiler2(opts);
1588
+ },
1589
+ outputExtensions: [".cpp", ".h"]
1590
+ },
1591
+ {
1592
+ name: "vrchat",
1593
+ domain: "social-vr",
1594
+ description: "Compiles to VRChat UdonSharp scripts",
377
1595
  supportedTraits: [
378
1596
  "physics",
379
1597
  "collidable",
@@ -386,7 +1604,7 @@ function registerBuiltinDialects() {
386
1604
  ],
387
1605
  riskTier: "standard",
388
1606
  factory: (opts) => {
389
- const { VRChatCompiler: VRChatCompiler2 } = (chunkDH5G2JUA_cjs.init_VRChatCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkDH5G2JUA_cjs.VRChatCompiler_exports));
1607
+ const { VRChatCompiler: VRChatCompiler2 } = (chunkZ34RLXRA_cjs.init_VRChatCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkZ34RLXRA_cjs.VRChatCompiler_exports));
390
1608
  return new VRChatCompiler2(opts);
391
1609
  },
392
1610
  outputExtensions: [".cs"]
@@ -405,7 +1623,7 @@ function registerBuiltinDialects() {
405
1623
  ],
406
1624
  riskTier: "standard",
407
1625
  factory: (opts) => {
408
- const { VisionOSCompiler: VisionOSCompiler2 } = (chunkEMO7HAKJ_cjs.init_VisionOSCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkEMO7HAKJ_cjs.VisionOSCompiler_exports));
1626
+ const { VisionOSCompiler: VisionOSCompiler2 } = (chunk5O6TQC6M_cjs.init_VisionOSCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunk5O6TQC6M_cjs.VisionOSCompiler_exports));
409
1627
  return new VisionOSCompiler2(opts);
410
1628
  },
411
1629
  outputExtensions: [".swift"]
@@ -417,7 +1635,7 @@ function registerBuiltinDialects() {
417
1635
  supportedTraits: ["physics", "hand_tracking", "spatial_anchor", "input", "collidable"],
418
1636
  riskTier: "standard",
419
1637
  factory: (opts) => {
420
- const { AndroidXRCompiler: AndroidXRCompiler2 } = (chunkPJMOXFPR_cjs.init_AndroidXRCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkPJMOXFPR_cjs.AndroidXRCompiler_exports));
1638
+ const { AndroidXRCompiler: AndroidXRCompiler2 } = (chunk4XSNJCLC_cjs.init_AndroidXRCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunk4XSNJCLC_cjs.AndroidXRCompiler_exports));
421
1639
  return new AndroidXRCompiler2(opts);
422
1640
  },
423
1641
  outputExtensions: [".kt"]
@@ -430,7 +1648,7 @@ function registerBuiltinDialects() {
430
1648
  supportedTraits: ["physics", "ar_anchor", "animation", "material", "collidable"],
431
1649
  riskTier: "standard",
432
1650
  factory: (opts) => {
433
- const { IOSCompiler: IOSCompiler2 } = (chunkYCMQQQ5U_cjs.init_IOSCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkYCMQQQ5U_cjs.IOSCompiler_exports));
1651
+ const { IOSCompiler: IOSCompiler2 } = (chunkCBJSLA2E_cjs.init_IOSCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkCBJSLA2E_cjs.IOSCompiler_exports));
434
1652
  return new IOSCompiler2(opts);
435
1653
  },
436
1654
  outputExtensions: [".swift"]
@@ -442,7 +1660,7 @@ function registerBuiltinDialects() {
442
1660
  supportedTraits: ["physics", "ar_anchor", "animation", "material", "collidable"],
443
1661
  riskTier: "standard",
444
1662
  factory: (opts) => {
445
- const { AndroidCompiler: AndroidCompiler2 } = (chunkWUXIRGZP_cjs.init_AndroidCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkWUXIRGZP_cjs.AndroidCompiler_exports));
1663
+ const { AndroidCompiler: AndroidCompiler2 } = (chunkNCUKG4SK_cjs.init_AndroidCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkNCUKG4SK_cjs.AndroidCompiler_exports));
446
1664
  return new AndroidCompiler2(opts);
447
1665
  },
448
1666
  outputExtensions: [".kt"]
@@ -454,7 +1672,7 @@ function registerBuiltinDialects() {
454
1672
  supportedTraits: ["physics", "ar_anchor", "spatial_anchor", "collidable", "material"],
455
1673
  riskTier: "standard",
456
1674
  factory: (opts) => {
457
- const { ARCompiler: ARCompiler2 } = (chunkY7VK5TH3_cjs.init_ARCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkY7VK5TH3_cjs.ARCompiler_exports));
1675
+ const { ARCompiler: ARCompiler2 } = (chunkQ5JT3YML_cjs.init_ARCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkQ5JT3YML_cjs.ARCompiler_exports));
458
1676
  return new ARCompiler2(opts);
459
1677
  },
460
1678
  outputExtensions: [".ts"]
@@ -467,7 +1685,7 @@ function registerBuiltinDialects() {
467
1685
  supportedTraits: ["physics", "animation", "audio"],
468
1686
  riskTier: "high",
469
1687
  factory: (opts) => {
470
- const { WASMCompiler: WASMCompiler2 } = (chunkNRUB55IT_cjs.init_WASMCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkNRUB55IT_cjs.WASMCompiler_exports));
1688
+ const { WASMCompiler: WASMCompiler2 } = (chunk6UEHYZ7V_cjs.init_WASMCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunk6UEHYZ7V_cjs.WASMCompiler_exports));
471
1689
  return new WASMCompiler2(opts);
472
1690
  },
473
1691
  outputExtensions: [".wasm", ".js"]
@@ -479,7 +1697,7 @@ function registerBuiltinDialects() {
479
1697
  supportedTraits: ["physics", "particles", "fluid", "material", "compute"],
480
1698
  riskTier: "standard",
481
1699
  factory: (opts) => {
482
- const { WebGPUCompiler: WebGPUCompiler2 } = (chunkDIEDKX5B_cjs.init_WebGPUCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkDIEDKX5B_cjs.WebGPUCompiler_exports));
1700
+ const { WebGPUCompiler: WebGPUCompiler2 } = (chunkBND3ST2K_cjs.init_WebGPUCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkBND3ST2K_cjs.WebGPUCompiler_exports));
483
1701
  return new WebGPUCompiler2(opts);
484
1702
  },
485
1703
  outputExtensions: [".wgsl", ".ts"]
@@ -492,7 +1710,7 @@ function registerBuiltinDialects() {
492
1710
  supportedTraits: ["joint", "actuator", "sensor", "collider", "end_effector"],
493
1711
  riskTier: "standard",
494
1712
  factory: (opts) => {
495
- const { URDFCompiler: URDFCompiler2 } = (chunkCQDOF3G7_cjs.init_URDFCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkCQDOF3G7_cjs.URDFCompiler_exports));
1713
+ const { URDFCompiler: URDFCompiler2 } = (chunk6TZPZCOJ_cjs.init_URDFCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunk6TZPZCOJ_cjs.URDFCompiler_exports));
496
1714
  return new URDFCompiler2(opts);
497
1715
  },
498
1716
  outputExtensions: [".urdf"]
@@ -504,7 +1722,7 @@ function registerBuiltinDialects() {
504
1722
  supportedTraits: ["joint", "actuator", "sensor", "collider", "physics", "environment"],
505
1723
  riskTier: "standard",
506
1724
  factory: (opts) => {
507
- const { SDFCompiler: SDFCompiler2 } = (chunk4KJ2R7VP_cjs.init_SDFCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunk4KJ2R7VP_cjs.SDFCompiler_exports));
1725
+ const { SDFCompiler: SDFCompiler2 } = (chunk7AGYRWKW_cjs.init_SDFCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunk7AGYRWKW_cjs.SDFCompiler_exports));
508
1726
  return new SDFCompiler2(opts);
509
1727
  },
510
1728
  outputExtensions: [".sdf"]
@@ -516,7 +1734,7 @@ function registerBuiltinDialects() {
516
1734
  supportedTraits: ["sensor", "telemetry", "property", "command", "relationship"],
517
1735
  riskTier: "standard",
518
1736
  factory: (opts) => {
519
- const { DTDLCompiler: DTDLCompiler2 } = (chunkWFJIDI2N_cjs.init_DTDLCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkWFJIDI2N_cjs.DTDLCompiler_exports));
1737
+ const { DTDLCompiler: DTDLCompiler2 } = (chunkQLEAOI3Q_cjs.init_DTDLCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkQLEAOI3Q_cjs.DTDLCompiler_exports));
520
1738
  return new DTDLCompiler2(opts);
521
1739
  },
522
1740
  outputExtensions: [".json"]
@@ -529,7 +1747,7 @@ function registerBuiltinDialects() {
529
1747
  supportedTraits: ["state", "bind", "reactive"],
530
1748
  riskTier: "standard",
531
1749
  factory: (opts) => {
532
- const { StateCompiler: StateCompiler2 } = (chunkWN3YF33G_cjs.init_StateCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkWN3YF33G_cjs.StateCompiler_exports));
1750
+ const { StateCompiler: StateCompiler2 } = (chunkB5TCIAPQ_cjs.init_StateCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkB5TCIAPQ_cjs.StateCompiler_exports));
533
1751
  return new StateCompiler2(opts);
534
1752
  },
535
1753
  outputExtensions: [".json"]
@@ -541,7 +1759,7 @@ function registerBuiltinDialects() {
541
1759
  supportedTraits: ["agent", "skill", "capability"],
542
1760
  riskTier: "standard",
543
1761
  factory: (opts) => {
544
- const { A2AAgentCardCompiler } = (chunkFEFHPUEM_cjs.init_A2AAgentCardCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkFEFHPUEM_cjs.A2AAgentCardCompiler_exports));
1762
+ const { A2AAgentCardCompiler } = (chunkF3HH56EB_cjs.init_A2AAgentCardCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkF3HH56EB_cjs.A2AAgentCardCompiler_exports));
545
1763
  return new A2AAgentCardCompiler(opts);
546
1764
  },
547
1765
  outputExtensions: [".json"]
@@ -553,7 +1771,7 @@ function registerBuiltinDialects() {
553
1771
  supportedTraits: ["snn", "neuron", "synapse", "spike_train"],
554
1772
  riskTier: "high",
555
1773
  factory: (opts) => {
556
- const { NIRCompiler } = (chunkFEFHPUEM_cjs.init_NIRCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkFEFHPUEM_cjs.NIRCompiler_exports));
1774
+ const { NIRCompiler } = (chunkF3HH56EB_cjs.init_NIRCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkF3HH56EB_cjs.NIRCompiler_exports));
557
1775
  return new NIRCompiler(opts);
558
1776
  },
559
1777
  outputExtensions: [".json"]
@@ -565,7 +1783,7 @@ function registerBuiltinDialects() {
565
1783
  supportedTraits: ["physics", "material", "lod", "rendering"],
566
1784
  riskTier: "standard",
567
1785
  factory: (opts) => {
568
- const { VRRCompiler } = (chunkVZNKJZTT_cjs.init_VRRCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkVZNKJZTT_cjs.VRRCompiler_exports));
1786
+ const { VRRCompiler } = (chunkLGGRPKTV_cjs.init_VRRCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(chunkLGGRPKTV_cjs.VRRCompiler_exports));
569
1787
  return new VRRCompiler(opts);
570
1788
  },
571
1789
  outputExtensions: [".ts"]
@@ -577,7 +1795,7 @@ function registerBuiltinDialects() {
577
1795
  supportedTraits: ["layout", "style", "animation", "interaction"],
578
1796
  riskTier: "standard",
579
1797
  factory: (opts) => {
580
- const { Native2DCompiler: Native2DCompiler2 } = (chunkFEFHPUEM_cjs.init_Native2DCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(chunkFEFHPUEM_cjs.Native2DCompiler_exports));
1798
+ const { Native2DCompiler: Native2DCompiler2 } = (init_Native2DCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(Native2DCompiler_exports));
581
1799
  return new Native2DCompiler2(opts);
582
1800
  },
583
1801
  outputExtensions: [".tsx", ".html"]
@@ -590,7 +1808,7 @@ function registerBuiltinDialects() {
590
1808
  supportedTraits: ["http", "handler", "middleware", "auth", "rate_limit", "cors"],
591
1809
  riskTier: "standard",
592
1810
  factory: () => {
593
- const { compileToNextJSAPI: compileToNextJSAPI2 } = (init_NextJSAPICompiler(), chunkEGIZHYJP_cjs.__toCommonJS(NextJSAPICompiler_exports));
1811
+ const { compileToNextJSAPI: compileToNextJSAPI2 } = (init_NextJSAPICompiler(), chunk3SAK5KFL_cjs.__toCommonJS(NextJSAPICompiler_exports));
594
1812
  return {
595
1813
  compile: (composition, _token) => compileToNextJSAPI2(composition)
596
1814
  };
@@ -615,7 +1833,7 @@ function registerBuiltinDialects() {
615
1833
  ],
616
1834
  riskTier: "standard",
617
1835
  factory: (opts) => {
618
- const { NodeServiceCompiler: NodeServiceCompiler2 } = (init_NodeServiceCompiler(), chunkEGIZHYJP_cjs.__toCommonJS(NodeServiceCompiler_exports));
1836
+ const { NodeServiceCompiler: NodeServiceCompiler2 } = (init_NodeServiceCompiler(), chunk3SAK5KFL_cjs.__toCommonJS(NodeServiceCompiler_exports));
619
1837
  return new NodeServiceCompiler2(opts);
620
1838
  },
621
1839
  outputExtensions: [".ts", ".js"],
@@ -629,7 +1847,7 @@ function registerBuiltinDialects() {
629
1847
  }
630
1848
  }
631
1849
  var _registered;
632
- var init_registerBuiltinDialects = chunkEGIZHYJP_cjs.__esm({
1850
+ var init_registerBuiltinDialects = chunk3SAK5KFL_cjs.__esm({
633
1851
  "src/compiler/registerBuiltinDialects.ts"() {
634
1852
  init_DialectRegistry();
635
1853
  _registered = false;
@@ -641,13 +1859,13 @@ function ensureDialectsBooted() {
641
1859
  if (_autoBooted) return;
642
1860
  _autoBooted = true;
643
1861
  try {
644
- const { registerBuiltinDialects: registerBuiltinDialects2 } = (init_registerBuiltinDialects(), chunkEGIZHYJP_cjs.__toCommonJS(registerBuiltinDialects_exports));
1862
+ const { registerBuiltinDialects: registerBuiltinDialects2 } = (init_registerBuiltinDialects(), chunk3SAK5KFL_cjs.__toCommonJS(registerBuiltinDialects_exports));
645
1863
  registerBuiltinDialects2();
646
1864
  } catch {
647
1865
  }
648
1866
  }
649
1867
  var DialectRegistryImpl; exports.DialectRegistry = void 0; var _autoBooted;
650
- var init_DialectRegistry = chunkEGIZHYJP_cjs.__esm({
1868
+ var init_DialectRegistry = chunk3SAK5KFL_cjs.__esm({
651
1869
  "src/compiler/DialectRegistry.ts"() {
652
1870
  DialectRegistryImpl = class {
653
1871
  constructor() {
@@ -681,631 +1899,467 @@ var init_DialectRegistry = chunkEGIZHYJP_cjs.__esm({
681
1899
  * Unregister a dialect.
682
1900
  */
683
1901
  unregister(name) {
684
- return this.dialects.delete(name);
685
- }
686
- /**
687
- * Check if a dialect is registered.
688
- */
689
- has(name) {
690
- return this.dialects.has(name);
691
- }
692
- /**
693
- * Get dialect info (without factory, safe for discovery).
694
- */
695
- get(name) {
696
- const desc = this.dialects.get(name);
697
- if (!desc) return void 0;
698
- return {
699
- name: desc.name,
700
- domain: desc.domain,
701
- description: desc.description,
702
- supportedTraits: desc.supportedTraits,
703
- riskTier: desc.riskTier,
704
- ansPath: desc.ansPath || `/compile/${desc.domain}/${desc.name}`,
705
- outputExtensions: desc.outputExtensions || [],
706
- experimental: desc.experimental ?? false
707
- };
708
- }
709
- /**
710
- * Create a compiler instance from a registered dialect.
711
- * @throws Error if dialect not found
712
- */
713
- create(name, options) {
714
- const desc = this.dialects.get(name);
715
- if (!desc) {
716
- const available = [...this.dialects.keys()].join(", ");
717
- throw new Error(`Unknown dialect "${name}". Available: ${available}`);
718
- }
719
- return desc.factory(options);
720
- }
721
- /**
722
- * List all registered dialects.
723
- */
724
- list() {
725
- return [...this.dialects.values()].map((desc) => ({
726
- name: desc.name,
727
- domain: desc.domain,
728
- description: desc.description,
729
- supportedTraits: desc.supportedTraits,
730
- riskTier: desc.riskTier,
731
- ansPath: desc.ansPath || `/compile/${desc.domain}/${desc.name}`,
732
- outputExtensions: desc.outputExtensions || [],
733
- experimental: desc.experimental ?? false
734
- }));
735
- }
736
- /**
737
- * List dialects filtered by domain.
738
- */
739
- listByDomain(domain) {
740
- return this.list().filter((d) => d.domain === domain);
741
- }
742
- /**
743
- * Find dialects that support a specific trait.
744
- */
745
- findByTrait(traitName) {
746
- return this.list().filter((d) => d.supportedTraits.includes(traitName));
747
- }
748
- /**
749
- * Get all registered dialect names.
750
- */
751
- names() {
752
- return [...this.dialects.keys()];
753
- }
754
- /**
755
- * Get count of registered dialects.
756
- */
757
- get size() {
758
- return this.dialects.size;
759
- }
760
- /**
761
- * Execute a progressive lowering pipeline for a dialect.
762
- * Runs all registered lowering passes in priority order.
763
- */
764
- executeLoweringPipeline(dialectName, composition, options = {}) {
765
- const desc = this.dialects.get(dialectName);
766
- if (!desc) {
767
- throw new Error(`Unknown dialect "${dialectName}"`);
768
- }
769
- const passes = [...desc.loweringPasses || []].sort((a, b) => a.priority - b.priority);
770
- if (passes.length === 0) {
771
- throw new Error(
772
- `Dialect "${dialectName}" has no lowering passes. Use create() for direct compilation.`
773
- );
774
- }
775
- const context = {
776
- target: dialectName,
777
- options,
778
- previousPasses: /* @__PURE__ */ new Map(),
779
- diagnostics: []
780
- };
781
- let lastResult = { output: "" };
782
- for (const pass of passes) {
783
- lastResult = pass.lower(composition, context);
784
- context.previousPasses.set(pass.name, lastResult);
785
- if (lastResult.diagnostics) {
786
- context.diagnostics.push(...lastResult.diagnostics);
787
- }
788
- const hasError = lastResult.diagnostics?.some((d) => d.level === "error");
789
- if (hasError) break;
790
- }
791
- lastResult.diagnostics = context.diagnostics;
792
- return lastResult;
793
- }
794
- };
795
- exports.DialectRegistry = new DialectRegistryImpl();
796
- _autoBooted = false;
797
- }
798
- });
799
-
800
- // src/compiler/NodeServiceCompiler.ts
801
- var NodeServiceCompiler_exports = {};
802
- chunkEGIZHYJP_cjs.__export(NodeServiceCompiler_exports, {
803
- NodeServiceCompiler: () => exports.NodeServiceCompiler
804
- });
805
- exports.NodeServiceCompiler = void 0;
806
- var init_NodeServiceCompiler = chunkEGIZHYJP_cjs.__esm({
807
- "src/compiler/NodeServiceCompiler.ts"() {
808
- chunkQHVVVN47_cjs.init_CompilerBase();
809
- chunkQHVVVN47_cjs.init_ANSNamespace();
810
- init_DialectRegistry();
811
- exports.NodeServiceCompiler = class extends chunkQHVVVN47_cjs.CompilerBase {
812
- constructor(options = {}) {
813
- super();
814
- this.compilerName = "NodeServiceCompiler";
815
- this.services = [];
816
- this.options = {
817
- framework: options.framework ?? "express",
818
- port: options.port ?? 3e3,
819
- apiPrefix: options.apiPrefix ?? "/api",
820
- typescript: options.typescript ?? true,
821
- nodeVersion: options.nodeVersion ?? "20",
822
- includeDocker: options.includeDocker ?? false
823
- };
824
- }
825
- getRequiredCapability() {
826
- return chunkQHVVVN47_cjs.ANSCapabilityPath.NODE_SERVICE;
827
- }
828
- compile(composition, agentToken, outputPath) {
829
- this.validateCompilerAccess(agentToken, outputPath);
830
- this.services = [];
831
- this.extractServices(composition);
832
- const output = {};
833
- output[this.ext("index")] = this.emitEntryPoint();
834
- for (const service of this.services) {
835
- output[this.ext(`routes/${this.toFileName(service.name)}`)] = this.emitRouteModule(service);
836
- }
837
- const allMiddleware = this.collectMiddleware();
838
- if (allMiddleware.length > 0) {
839
- output[this.ext("middleware/index")] = this.emitMiddlewareIndex(allMiddleware);
840
- }
841
- output["package.json"] = this.emitPackageJson(composition.name);
842
- if (this.options.typescript) {
843
- output["tsconfig.json"] = this.emitTsConfig();
844
- }
845
- if (this.options.includeDocker) {
846
- output["Dockerfile"] = this.emitDockerfile();
847
- }
848
- return output;
849
- }
850
- // ── Extraction ─────────────────────────────────────────────────────────
851
- extractServices(composition) {
852
- if (composition.domainBlocks) {
853
- for (const block of composition.domainBlocks) {
854
- if (this.isServiceBlock(block)) {
855
- this.services.push(this.parseServiceBlock(block));
856
- }
857
- }
858
- }
859
- for (const obj of composition.objects) {
860
- if (this.hasServiceTraits(obj)) {
861
- this.services.push(this.parseServiceObject(obj));
862
- }
863
- }
864
- if (this.services.length === 0) {
865
- this.services.push({
866
- name: composition.name || "App",
867
- routes: [],
868
- middleware: [],
869
- port: this.options.port
870
- });
871
- }
872
- }
873
- isServiceBlock(block) {
874
- return block.keyword === "service" || block.keyword === "endpoint" || block.keyword === "gateway" || block.keyword === "handler";
875
- }
876
- hasServiceTraits(obj) {
877
- if (!obj.traits) return false;
878
- const serviceTraits = ["service", "endpoint", "http", "handler", "route"];
879
- return obj.traits.some((t) => serviceTraits.includes(t.name));
880
- }
881
- parseServiceBlock(block) {
882
- const service = {
883
- name: block.name,
884
- routes: [],
885
- middleware: [],
886
- port: this.resolveNumber(block.properties["port"]) ?? this.options.port
887
- };
888
- if (block.traits) {
889
- service.middleware = this.extractMiddlewareFromTraits(block.traits);
890
- }
891
- if (block.children) {
892
- for (const child of block.children) {
893
- const route = this.extractRoute(child, block.name);
894
- if (route) service.routes.push(route);
895
- }
896
- }
897
- const inlineRoute = this.extractInlineRoute(block);
898
- if (inlineRoute) service.routes.push(inlineRoute);
899
- return service;
900
- }
901
- parseServiceObject(obj) {
902
- const service = {
903
- name: obj.name,
904
- routes: [],
905
- middleware: [],
906
- port: this.options.port
907
- };
908
- if (obj.traits) {
909
- service.middleware = this.extractMiddlewareFromTraits(obj.traits.map((t) => t.name));
910
- }
911
- const route = this.extractRoute(obj, obj.name);
912
- if (route) service.routes.push(route);
913
- return service;
1902
+ return this.dialects.delete(name);
914
1903
  }
915
- extractRoute(obj, serviceName) {
916
- const propMap = this.objectPropsToMap(obj.properties);
917
- const traits = (obj.traits || []).map((t) => t.name);
918
- const method = this.resolveString(propMap.get("method"))?.toUpperCase() || "GET";
919
- const path = this.resolveString(propMap.get("path")) || `/${this.toKebab(obj.name)}`;
920
- const handlerName = this.resolveString(propMap.get("handler")) || this.toCamelCase(obj.name);
921
- const hasHttpInfo = propMap.has("method") || propMap.has("path") || traits.includes("http") || traits.includes("route");
922
- if (!hasHttpInfo) return null;
923
- return {
924
- method,
925
- path,
926
- handlerName,
927
- middleware: this.extractMiddlewareFromTraits(traits),
928
- serviceName
929
- };
1904
+ /**
1905
+ * Check if a dialect is registered.
1906
+ */
1907
+ has(name) {
1908
+ return this.dialects.has(name);
930
1909
  }
931
- extractInlineRoute(block) {
932
- const props = block.properties;
933
- if (!props["method"] && !props["path"]) return null;
1910
+ /**
1911
+ * Get dialect info (without factory, safe for discovery).
1912
+ */
1913
+ get(name) {
1914
+ const desc = this.dialects.get(name);
1915
+ if (!desc) return void 0;
934
1916
  return {
935
- method: this.resolveString(props["method"])?.toUpperCase() || "GET",
936
- path: this.resolveString(props["path"]) || `/${this.toKebab(block.name)}`,
937
- handlerName: this.resolveString(props["handler"]) || this.toCamelCase(block.name),
938
- middleware: [],
939
- serviceName: block.name
1917
+ name: desc.name,
1918
+ domain: desc.domain,
1919
+ description: desc.description,
1920
+ supportedTraits: desc.supportedTraits,
1921
+ riskTier: desc.riskTier,
1922
+ ansPath: desc.ansPath || `/compile/${desc.domain}/${desc.name}`,
1923
+ outputExtensions: desc.outputExtensions || [],
1924
+ experimental: desc.experimental ?? false
940
1925
  };
941
1926
  }
942
- extractMiddlewareFromTraits(traits) {
943
- const mw = [];
944
- for (const t of traits) {
945
- if (t === "middleware" || t === "auth" || t === "rate_limit" || t === "cors" || t === "validation") {
946
- mw.push(t);
947
- }
1927
+ /**
1928
+ * Create a compiler instance from a registered dialect.
1929
+ * @throws Error if dialect not found
1930
+ */
1931
+ create(name, options) {
1932
+ const desc = this.dialects.get(name);
1933
+ if (!desc) {
1934
+ const available = [...this.dialects.keys()].join(", ");
1935
+ throw new Error(`Unknown dialect "${name}". Available: ${available}`);
948
1936
  }
949
- return mw;
1937
+ return desc.factory(options);
950
1938
  }
951
- collectMiddleware() {
952
- const set = /* @__PURE__ */ new Set();
953
- for (const service of this.services) {
954
- for (const mw of service.middleware) set.add(mw);
955
- for (const route of service.routes) {
956
- for (const mw of route.middleware) set.add(mw);
957
- }
958
- }
959
- return [...set];
1939
+ /**
1940
+ * List all registered dialects.
1941
+ */
1942
+ list() {
1943
+ return [...this.dialects.values()].map((desc) => ({
1944
+ name: desc.name,
1945
+ domain: desc.domain,
1946
+ description: desc.description,
1947
+ supportedTraits: desc.supportedTraits,
1948
+ riskTier: desc.riskTier,
1949
+ ansPath: desc.ansPath || `/compile/${desc.domain}/${desc.name}`,
1950
+ outputExtensions: desc.outputExtensions || [],
1951
+ experimental: desc.experimental ?? false
1952
+ }));
960
1953
  }
961
- // ── Code Emission ──────────────────────────────────────────────────────
962
- emitEntryPoint() {
963
- const isExpress = this.options.framework === "express";
964
- const lines = [];
965
- lines.push(`/**`);
966
- lines.push(` * Auto-generated by HoloScript NodeServiceCompiler v0.1.0`);
967
- lines.push(` * Framework: ${this.options.framework}`);
968
- lines.push(` */`);
969
- lines.push("");
970
- if (isExpress) {
971
- lines.push(`import express from 'express';`);
972
- for (const service of this.services) {
973
- const importName = `${this.toCamelCase(service.name)}Routes`;
974
- lines.push(`import { ${importName} } from './routes/${this.toFileName(service.name)}';`);
975
- }
976
- lines.push("");
977
- lines.push(`const app = express();`);
978
- lines.push(`app.use(express.json());`);
979
- lines.push(`app.use(express.urlencoded({ extended: true }));`);
980
- lines.push("");
981
- for (const service of this.services) {
982
- const importName = `${this.toCamelCase(service.name)}Routes`;
983
- lines.push(
984
- `app.use('${this.escapeStringValue(this.options.apiPrefix, "TypeScript")}', ${importName});`
985
- );
986
- }
987
- lines.push("");
988
- lines.push(`const PORT = process.env['PORT'] || ${this.options.port};`);
989
- lines.push(`app.listen(PORT, () => {`);
990
- lines.push(` console.log(\`Server running on port \${PORT}\`);`);
991
- lines.push(`});`);
992
- lines.push("");
993
- lines.push(`export { app };`);
994
- } else {
995
- lines.push(`import Fastify from 'fastify';`);
996
- for (const service of this.services) {
997
- const importName = `${this.toCamelCase(service.name)}Routes`;
998
- lines.push(`import { ${importName} } from './routes/${this.toFileName(service.name)}';`);
999
- }
1000
- lines.push("");
1001
- lines.push(`const app = Fastify({ logger: true });`);
1002
- lines.push("");
1003
- for (const service of this.services) {
1004
- const importName = `${this.toCamelCase(service.name)}Routes`;
1005
- lines.push(
1006
- `app.register(${importName}, { prefix: '${this.escapeStringValue(this.options.apiPrefix, "TypeScript")}' });`
1007
- );
1008
- }
1009
- lines.push("");
1010
- lines.push(`const PORT = Number(process.env['PORT']) || ${this.options.port};`);
1011
- lines.push(`app.listen({ port: PORT, host: '0.0.0.0' }).then((address) => {`);
1012
- lines.push(` console.log(\`Server running at \${address}\`);`);
1013
- lines.push(`});`);
1014
- lines.push("");
1015
- lines.push(`export { app };`);
1016
- }
1017
- return lines.join("\n");
1954
+ /**
1955
+ * List dialects filtered by domain.
1956
+ */
1957
+ listByDomain(domain) {
1958
+ return this.list().filter((d) => d.domain === domain);
1018
1959
  }
1019
- emitRouteModule(service) {
1020
- const isExpress = this.options.framework === "express";
1021
- const lines = [];
1022
- const routerName = `${this.toCamelCase(service.name)}Routes`;
1023
- lines.push(`/**`);
1024
- lines.push(` * Routes for ${service.name}`);
1025
- lines.push(` * Auto-generated by HoloScript NodeServiceCompiler`);
1026
- lines.push(` */`);
1027
- lines.push("");
1028
- if (isExpress) {
1029
- lines.push(`import { Router } from 'express';`);
1030
- if (this.options.typescript) {
1031
- lines.push(`import type { Request, Response } from 'express';`);
1032
- }
1033
- lines.push("");
1034
- lines.push(`const router = Router();`);
1035
- lines.push("");
1036
- for (const route of service.routes) {
1037
- const methodLower = route.method.toLowerCase();
1038
- const mwArgs = route.middleware.length > 0 ? route.middleware.map((mw) => `/* ${mw} */`).join(", ") + ", " : "";
1039
- lines.push(`// ${route.method} ${route.path}`);
1040
- if (this.options.typescript) {
1041
- lines.push(
1042
- `router.${methodLower}('${this.escapeStringValue(route.path, "TypeScript")}', ${mwArgs}(req: Request, res: Response) => {`
1043
- );
1044
- } else {
1045
- lines.push(
1046
- `router.${methodLower}('${this.escapeStringValue(route.path, "TypeScript")}', ${mwArgs}(req, res) => {`
1047
- );
1048
- }
1049
- lines.push(` // TODO: Implement ${route.handlerName}`);
1050
- lines.push(
1051
- ` res.json({ message: '${this.escapeStringValue(route.handlerName, "TypeScript")} not implemented' });`
1052
- );
1053
- lines.push(`});`);
1054
- lines.push("");
1055
- }
1056
- if (service.routes.length === 0) {
1057
- lines.push(`// Default health check`);
1058
- if (this.options.typescript) {
1059
- lines.push(`router.get('/health', (_req: Request, res: Response) => {`);
1060
- } else {
1061
- lines.push(`router.get('/health', (_req, res) => {`);
1062
- }
1063
- lines.push(
1064
- ` res.json({ status: 'ok', service: '${this.escapeStringValue(service.name, "TypeScript")}' });`
1065
- );
1066
- lines.push(`});`);
1067
- lines.push("");
1068
- }
1069
- lines.push(`export { router as ${routerName} };`);
1070
- } else {
1071
- lines.push(`import type { FastifyInstance } from 'fastify';`);
1072
- lines.push("");
1073
- lines.push(`export async function ${routerName}(app: FastifyInstance) {`);
1074
- for (const route of service.routes) {
1075
- const methodLower = route.method.toLowerCase();
1076
- lines.push(` // ${route.method} ${route.path}`);
1077
- lines.push(
1078
- ` app.${methodLower}('${this.escapeStringValue(route.path, "TypeScript")}', async (request, reply) => {`
1079
- );
1080
- lines.push(` // TODO: Implement ${route.handlerName}`);
1081
- lines.push(
1082
- ` return { message: '${this.escapeStringValue(route.handlerName, "TypeScript")} not implemented' };`
1083
- );
1084
- lines.push(` });`);
1085
- lines.push("");
1086
- }
1087
- if (service.routes.length === 0) {
1088
- lines.push(` // Default health check`);
1089
- lines.push(` app.get('/health', async () => {`);
1090
- lines.push(
1091
- ` return { status: 'ok', service: '${this.escapeStringValue(service.name, "TypeScript")}' };`
1092
- );
1093
- lines.push(` });`);
1094
- lines.push("");
1095
- }
1096
- lines.push(`}`);
1097
- }
1098
- return lines.join("\n");
1960
+ /**
1961
+ * Find dialects that support a specific trait.
1962
+ */
1963
+ findByTrait(traitName) {
1964
+ return this.list().filter((d) => d.supportedTraits.includes(traitName));
1099
1965
  }
1100
- emitMiddlewareIndex(middleware) {
1101
- const lines = [];
1102
- lines.push(`/**`);
1103
- lines.push(` * Middleware stubs`);
1104
- lines.push(` * Auto-generated by HoloScript NodeServiceCompiler`);
1105
- lines.push(` */`);
1106
- lines.push("");
1107
- if (this.options.framework === "express") {
1108
- lines.push(`import type { Request, Response, NextFunction } from 'express';`);
1109
- lines.push("");
1110
- for (const mw of middleware) {
1111
- const fnName = this.toCamelCase(mw) + "Middleware";
1112
- lines.push(`export function ${fnName}(req: Request, _res: Response, next: NextFunction) {`);
1113
- lines.push(` // TODO: Implement ${mw} middleware`);
1114
- lines.push(` next();`);
1115
- lines.push(`}`);
1116
- lines.push("");
1117
- }
1118
- } else {
1119
- lines.push(
1120
- `import type { FastifyRequest, FastifyReply, HookHandlerDoneFunction } from 'fastify';`
1966
+ /**
1967
+ * Get all registered dialect names.
1968
+ */
1969
+ names() {
1970
+ return [...this.dialects.keys()];
1971
+ }
1972
+ /**
1973
+ * Get count of registered dialects.
1974
+ */
1975
+ get size() {
1976
+ return this.dialects.size;
1977
+ }
1978
+ /**
1979
+ * Execute a progressive lowering pipeline for a dialect.
1980
+ * Runs all registered lowering passes in priority order.
1981
+ */
1982
+ executeLoweringPipeline(dialectName, composition, options = {}) {
1983
+ const desc = this.dialects.get(dialectName);
1984
+ if (!desc) {
1985
+ throw new Error(`Unknown dialect "${dialectName}"`);
1986
+ }
1987
+ const passes = [...desc.loweringPasses || []].sort((a, b) => a.priority - b.priority);
1988
+ if (passes.length === 0) {
1989
+ throw new Error(
1990
+ `Dialect "${dialectName}" has no lowering passes. Use create() for direct compilation.`
1121
1991
  );
1122
- lines.push("");
1123
- for (const mw of middleware) {
1124
- const fnName = this.toCamelCase(mw) + "Middleware";
1125
- lines.push(
1126
- `export function ${fnName}(request: FastifyRequest, _reply: FastifyReply, done: HookHandlerDoneFunction) {`
1127
- );
1128
- lines.push(` // TODO: Implement ${mw} middleware`);
1129
- lines.push(` done();`);
1130
- lines.push(`}`);
1131
- lines.push("");
1992
+ }
1993
+ const context = {
1994
+ target: dialectName,
1995
+ options,
1996
+ previousPasses: /* @__PURE__ */ new Map(),
1997
+ diagnostics: []
1998
+ };
1999
+ let lastResult = { output: "" };
2000
+ for (const pass of passes) {
2001
+ lastResult = pass.lower(composition, context);
2002
+ context.previousPasses.set(pass.name, lastResult);
2003
+ if (lastResult.diagnostics) {
2004
+ context.diagnostics.push(...lastResult.diagnostics);
1132
2005
  }
2006
+ const hasError = lastResult.diagnostics?.some((d) => d.level === "error");
2007
+ if (hasError) break;
1133
2008
  }
1134
- return lines.join("\n");
2009
+ lastResult.diagnostics = context.diagnostics;
2010
+ return lastResult;
1135
2011
  }
1136
- emitPackageJson(projectName) {
1137
- const name = this.toKebab(projectName || "holoscript-service");
1138
- const isExpress = this.options.framework === "express";
1139
- const pkg = {
1140
- name,
1141
- version: "0.1.0",
1142
- description: `Generated by HoloScript NodeServiceCompiler`,
1143
- main: this.options.typescript ? "dist/index.js" : "index.js",
1144
- scripts: {
1145
- ...this.options.typescript ? {
1146
- build: "tsc",
1147
- start: "node dist/index.js",
1148
- dev: "tsx watch index.ts"
1149
- } : {
1150
- start: "node index.js",
1151
- dev: "node --watch index.js"
1152
- }
1153
- },
1154
- dependencies: isExpress ? { express: "^4.21.0" } : { fastify: "^5.0.0" },
1155
- ...this.options.typescript && {
1156
- devDependencies: {
1157
- typescript: "^5.5.0",
1158
- tsx: "^4.0.0",
1159
- ...isExpress ? { "@types/express": "^4.17.21", "@types/node": "^20.0.0" } : { "@types/node": "^20.0.0" }
1160
- }
1161
- }
1162
- };
1163
- return JSON.stringify(pkg, null, 2);
2012
+ };
2013
+ exports.DialectRegistry = new DialectRegistryImpl();
2014
+ _autoBooted = false;
2015
+ }
2016
+ });
2017
+
2018
+ // src/compiler/index.ts
2019
+ chunkBF2235SI_cjs.init_CompilerBase();
2020
+ chunkBF2235SI_cjs.init_CompilerDocumentationGenerator();
2021
+ chunkQ5SJOGHQ_cjs.init_R3FCompiler();
2022
+ chunkHE7ULERA_cjs.init_UnityCompiler();
2023
+ chunkXXINBTZK_cjs.init_GodotCompiler();
2024
+ chunk33LSUQDD_cjs.init_BabylonCompiler();
2025
+ chunkXWPNTWDN_cjs.init_PlayCanvasCompiler();
2026
+ chunkQ5JT3YML_cjs.init_ARCompiler();
2027
+ chunkFFKU7BTK_cjs.init_OpenXRCompiler();
2028
+ chunkZ34RLXRA_cjs.init_VRChatCompiler();
2029
+ chunk5O6TQC6M_cjs.init_VisionOSCompiler();
2030
+ chunkNCUKG4SK_cjs.init_AndroidCompiler();
2031
+ chunk4XSNJCLC_cjs.init_AndroidXRCompiler();
2032
+ chunkCBJSLA2E_cjs.init_IOSCompiler();
2033
+ chunk6UEHYZ7V_cjs.init_WASMCompiler();
2034
+ chunkBND3ST2K_cjs.init_WebGPUCompiler();
2035
+ chunk7AGYRWKW_cjs.init_SDFCompiler();
2036
+ chunkQLEAOI3Q_cjs.init_DTDLCompiler();
2037
+ chunk6TZPZCOJ_cjs.init_URDFCompiler();
2038
+ chunkB5TCIAPQ_cjs.init_StateCompiler();
2039
+
2040
+ // src/compiler/NextJSCompiler.ts
2041
+ chunkBF2235SI_cjs.init_CompilerBase();
2042
+ init_Native2DCompiler();
2043
+ function findTrait(composition, traitName) {
2044
+ const traits = composition.traits;
2045
+ if (!traits) return null;
2046
+ const found = traits.find((t) => t.name === traitName);
2047
+ return found?.config || null;
2048
+ }
2049
+ var NextJSCompiler = class extends chunkBF2235SI_cjs.CompilerBase {
2050
+ constructor(options = {}) {
2051
+ super();
2052
+ this.options = options;
2053
+ this.compilerName = "NextJSCompiler";
2054
+ }
2055
+ /**
2056
+ * Compile HoloComposition AST to Next.js App Router Code
2057
+ *
2058
+ * @param composition - HoloScript AST
2059
+ * @param agentToken - JWT or UCAN token proving agent identity
2060
+ * @param outputPath - Optional output file path for scope validation
2061
+ * @param sceneGraph - Optional pre-computed SSG
2062
+ */
2063
+ async compile(composition, agentToken, outputPath, _sceneGraph) {
2064
+ this.validateCompilerAccess(agentToken, outputPath);
2065
+ return this.buildNextRoute(composition);
2066
+ }
2067
+ validateCompilerAccess(agentToken, outputPath) {
2068
+ if (typeof agentToken === "object" && agentToken !== null) {
2069
+ this.validateCapabilityAccess(agentToken, outputPath);
2070
+ } else {
2071
+ this.validateASTAccess(agentToken);
2072
+ this.validateCodeGeneration(agentToken);
2073
+ if (outputPath) {
2074
+ this.validateOutputPath(agentToken, outputPath);
1164
2075
  }
1165
- emitTsConfig() {
1166
- const config = {
1167
- compilerOptions: {
1168
- target: "ES2022",
1169
- module: "NodeNext",
1170
- moduleResolution: "NodeNext",
1171
- outDir: "./dist",
1172
- rootDir: "./",
1173
- strict: true,
1174
- esModuleInterop: true,
1175
- skipLibCheck: true,
1176
- declaration: true
1177
- },
1178
- include: ["./**/*.ts"],
1179
- exclude: ["node_modules", "dist"]
1180
- };
1181
- return JSON.stringify(config, null, 2);
2076
+ this.validateSpatialZoneAccess(agentToken);
2077
+ }
2078
+ }
2079
+ buildNextRoute(composition) {
2080
+ const compiler = new exports.Native2DCompiler();
2081
+ const pageTrait = findTrait(composition, "page");
2082
+ const metaTrait = findTrait(composition, "metadata");
2083
+ const route = pageTrait?.route || `/${composition.name.toLowerCase().replace(/\s+/g, "-")}`;
2084
+ const isClient = pageTrait?.client !== false;
2085
+ const slotMap = this.options.slots || {};
2086
+ if (pageTrait?.redirect) {
2087
+ const redirectUrl = pageTrait.redirect;
2088
+ const lines2 = [
2089
+ `// @generated by HoloScript NextJSCompiler \u2014 DO NOT EDIT`,
2090
+ `import { redirect } from 'next/navigation';`,
2091
+ ``,
2092
+ `export default function RedirectPage() {`,
2093
+ ` redirect(${JSON.stringify(redirectUrl)});`,
2094
+ `}`
2095
+ ];
2096
+ if (metaTrait) {
2097
+ const metaEntries = [];
2098
+ if (metaTrait.title) metaEntries.push(` title: ${JSON.stringify(metaTrait.title)},`);
2099
+ if (metaTrait.description)
2100
+ metaEntries.push(` description: ${JSON.stringify(metaTrait.description)},`);
2101
+ lines2.push("");
2102
+ lines2.push(`export const metadata = {`);
2103
+ lines2.push(metaEntries.join("\n"));
2104
+ lines2.push(`};`);
1182
2105
  }
1183
- emitDockerfile() {
1184
- const nodeVer = this.options.nodeVersion;
1185
- return [
1186
- `FROM node:${nodeVer}-alpine AS builder`,
1187
- `WORKDIR /app`,
1188
- `COPY package*.json ./`,
1189
- `RUN npm ci`,
1190
- `COPY . .`,
1191
- ...this.options.typescript ? [`RUN npm run build`] : [],
1192
- ``,
1193
- `FROM node:${nodeVer}-alpine`,
1194
- `WORKDIR /app`,
1195
- `COPY --from=builder /app/package*.json ./`,
1196
- `RUN npm ci --omit=dev`,
1197
- ...this.options.typescript ? [`COPY --from=builder /app/dist ./dist`] : [`COPY --from=builder /app/*.js ./`],
1198
- `EXPOSE ${this.options.port}`,
1199
- `CMD ["npm", "start"]`,
1200
- ``
1201
- ].join("\n");
2106
+ const routePath2 = route.replace(/^\//, "") || "index";
2107
+ return {
2108
+ path: `${routePath2}/page.tsx`,
2109
+ code: lines2.join("\n")
2110
+ };
2111
+ }
2112
+ const compilerOptions = {
2113
+ format: "react",
2114
+ useUIComponents: true,
2115
+ slots: slotMap
2116
+ };
2117
+ const elements = composition.ui?.elements || composition.objects || [];
2118
+ const componentCode = compiler.generateReactComponent(
2119
+ composition.name,
2120
+ elements,
2121
+ composition,
2122
+ compilerOptions
2123
+ );
2124
+ const pageSafeComponentCode = componentCode.replace(
2125
+ /export\s+function\s+([A-Za-z0-9_]+)\s*\(/,
2126
+ "function $1("
2127
+ );
2128
+ const lines = [];
2129
+ if (isClient) {
2130
+ lines.push("'use client';");
2131
+ lines.push("");
2132
+ }
2133
+ lines.push(pageSafeComponentCode);
2134
+ if (metaTrait && !isClient) {
2135
+ const metaEntries = [];
2136
+ if (metaTrait.title) metaEntries.push(` title: ${JSON.stringify(metaTrait.title)},`);
2137
+ if (metaTrait.description)
2138
+ metaEntries.push(` description: ${JSON.stringify(metaTrait.description)},`);
2139
+ lines.push("");
2140
+ lines.push(`export const metadata = {`);
2141
+ lines.push(metaEntries.join("\n"));
2142
+ lines.push(`};`);
2143
+ }
2144
+ const routePath = route.replace(/^\//, "") || "index";
2145
+ return {
2146
+ path: `${routePath}/page.tsx`,
2147
+ code: lines.join("\n")
2148
+ };
2149
+ }
2150
+ };
2151
+
2152
+ // src/compiler/index.ts
2153
+ init_NextJSAPICompiler();
2154
+
2155
+ // src/compiler/MCPConfigCompiler.ts
2156
+ chunkBF2235SI_cjs.init_CompilerBase();
2157
+ init_DialectRegistry();
2158
+ var MCPConfigCompiler = class extends chunkBF2235SI_cjs.CompilerBase {
2159
+ constructor(options = {}) {
2160
+ super();
2161
+ this.compilerName = "MCPConfigCompiler";
2162
+ this.servers = [];
2163
+ this.options = {
2164
+ target: options.target ?? "generic",
2165
+ envFile: options.envFile ?? "",
2166
+ envValues: options.envValues ?? {},
2167
+ cwd: options.cwd ?? ""
2168
+ };
2169
+ }
2170
+ compile(composition, agentToken, outputPath) {
2171
+ this.validateCompilerAccess(agentToken, outputPath);
2172
+ this.servers = [];
2173
+ if (composition.domainBlocks) {
2174
+ for (const block of composition.domainBlocks) {
2175
+ if (block.domain === "mcp_servers" || block.name === "mcp_servers") {
2176
+ this.extractServersFromBlock(block);
2177
+ }
1202
2178
  }
1203
- // ── Utilities ──────────────────────────────────────────────────────────
1204
- /** Convert HoloObjectProperty[] to a Map for key-based lookup */
1205
- objectPropsToMap(props) {
1206
- const map = /* @__PURE__ */ new Map();
1207
- if (!props) return map;
1208
- for (const prop of props) {
1209
- map.set(prop.key, prop.value);
2179
+ }
2180
+ if (composition.objects) {
2181
+ for (const obj of composition.objects) {
2182
+ if (this.hasConnectorTrait(obj)) {
2183
+ this.servers.push(this.extractServerFromObject(obj));
1210
2184
  }
1211
- return map;
1212
2185
  }
1213
- ext(name) {
1214
- return this.options.typescript ? `${name}.ts` : `${name}.js`;
2186
+ }
2187
+ const config = this.generateConfig();
2188
+ return JSON.stringify(config, null, 2);
2189
+ }
2190
+ // ── Extraction ────────────────────────────────────────────────────────────
2191
+ extractServersFromBlock(block) {
2192
+ if (!block.children) return;
2193
+ for (const child of block.children) {
2194
+ if ("type" in child && child.type === "ObjectDecl") {
2195
+ const obj = child;
2196
+ this.servers.push(this.extractServerFromObject(obj));
1215
2197
  }
1216
- toFileName(name) {
1217
- return name.replace(/[^a-zA-Z0-9]/g, "-").replace(/-+/g, "-");
2198
+ }
2199
+ }
2200
+ extractServerFromObject(obj) {
2201
+ const props = this.objectPropsToMap(obj.properties);
2202
+ const traits = obj.traits || [];
2203
+ let transport = "http";
2204
+ const connectorTrait = traits.find((t) => t.name === "connector");
2205
+ if (connectorTrait?.config) {
2206
+ const t = this.resolveString(connectorTrait.config["transport"] || connectorTrait.config["_arg1"]);
2207
+ if (t === "stdio" || t === "sse" || t === "http") transport = t;
2208
+ }
2209
+ const envVars = [];
2210
+ for (const trait of traits) {
2211
+ if (trait.name === "env") {
2212
+ const varName = this.resolveString(trait.config["_arg0"] || trait.config["name"] || "");
2213
+ const header = this.resolveString(trait.config["header"] || "");
2214
+ if (varName) {
2215
+ envVars.push({ name: varName, header: header || void 0 });
2216
+ }
1218
2217
  }
1219
- toKebab(name) {
1220
- return name.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[^a-zA-Z0-9]/g, "-").replace(/-+/g, "-").toLowerCase();
2218
+ }
2219
+ return {
2220
+ name: obj.name,
2221
+ transport,
2222
+ url: this.resolveString(props.get("url")),
2223
+ command: this.resolveString(props.get("command")),
2224
+ args: this.resolveArray(props.get("args")),
2225
+ cwd: this.resolveString(props.get("cwd")),
2226
+ description: this.resolveString(props.get("description")),
2227
+ envVars
2228
+ };
2229
+ }
2230
+ hasConnectorTrait(obj) {
2231
+ return (obj.traits || []).some((t) => t.name === "connector");
2232
+ }
2233
+ // ── Config Generation ─────────────────────────────────────────────────────
2234
+ generateConfig() {
2235
+ const mcpServers = {};
2236
+ for (const server of this.servers) {
2237
+ mcpServers[server.name] = this.generateServerEntry(server);
2238
+ }
2239
+ const config = {
2240
+ _generated: "HoloScript MCPConfigCompiler",
2241
+ _target: this.options.target,
2242
+ _updated: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
2243
+ mcpServers
2244
+ };
2245
+ if (this.options.target === "claude") {
2246
+ config["$schema"] = "https://modelcontextprotocol.io/schemas/mcp-config.json";
2247
+ }
2248
+ return config;
2249
+ }
2250
+ generateServerEntry(server) {
2251
+ const entry = {};
2252
+ if (server.transport === "stdio") {
2253
+ entry.command = server.command || "node";
2254
+ if (server.args) entry.args = server.args;
2255
+ if (server.cwd || this.options.target === "antigravity") {
2256
+ entry.cwd = server.cwd || this.options.cwd || void 0;
1221
2257
  }
1222
- toCamelCase(name) {
1223
- const parts = name.replace(/[^a-zA-Z0-9]/g, " ").split(/\s+/).filter(Boolean);
1224
- if (parts.length === 0) return "unnamed";
1225
- return parts[0].toLowerCase() + parts.slice(1).map((p) => p.charAt(0).toUpperCase() + p.slice(1).toLowerCase()).join("");
2258
+ const envBlock = {};
2259
+ for (const ev of server.envVars) {
2260
+ if (!ev.header) {
2261
+ envBlock[ev.name] = this.resolveEnvValue(ev.name);
2262
+ }
1226
2263
  }
1227
- resolveString(val) {
1228
- if (val === void 0 || val === null) return void 0;
1229
- if (typeof val === "string") return val;
1230
- if (typeof val === "object" && "value" in val) return String(val.value);
1231
- return String(val);
2264
+ if (Object.keys(envBlock).length > 0) {
2265
+ entry.env = envBlock;
1232
2266
  }
1233
- resolveNumber(val) {
1234
- if (val === void 0 || val === null) return void 0;
1235
- if (typeof val === "number") return val;
1236
- if (typeof val === "string") {
1237
- const n = Number(val);
1238
- return isNaN(n) ? void 0 : n;
1239
- }
1240
- if (typeof val === "object" && "value" in val) {
1241
- const n = Number(val.value);
1242
- return isNaN(n) ? void 0 : n;
2267
+ } else {
2268
+ if (this.options.target === "antigravity") {
2269
+ entry.serverURL = server.url;
2270
+ } else {
2271
+ entry.url = server.url;
2272
+ }
2273
+ if (this.options.target !== "antigravity" && server.transport === "sse") {
2274
+ entry.transport = "sse";
2275
+ }
2276
+ const headers = {};
2277
+ for (const ev of server.envVars) {
2278
+ if (ev.header) {
2279
+ const [headerName, ...prefix] = ev.header.split(":");
2280
+ const prefixStr = prefix.join(":").trim();
2281
+ const value = this.resolveEnvValue(ev.name);
2282
+ headers[headerName.trim()] = prefixStr ? `${prefixStr} ${value}` : value;
2283
+ } else {
2284
+ headers[ev.name] = this.resolveEnvValue(ev.name);
1243
2285
  }
1244
- return void 0;
1245
2286
  }
1246
- };
1247
- exports.DialectRegistry.register({
1248
- name: "node-service",
1249
- domain: "service",
1250
- description: "Compiles @service traits to Express/Fastify Node.js applications",
1251
- supportedTraits: [
1252
- "service",
1253
- "endpoint",
1254
- "route",
1255
- "handler",
1256
- "middleware",
1257
- "http",
1258
- "gateway",
1259
- "proxy",
1260
- "load_balancer",
1261
- "auth",
1262
- "cors",
1263
- "rate_limit",
1264
- "validation"
1265
- ],
1266
- riskTier: "standard",
1267
- factory: (options) => new exports.NodeServiceCompiler(options),
1268
- outputExtensions: [".ts", ".js", ".json"],
1269
- experimental: true
1270
- });
2287
+ if (Object.keys(headers).length > 0) {
2288
+ entry.headers = headers;
2289
+ }
2290
+ }
2291
+ if (server.description) {
2292
+ entry.description = server.description;
2293
+ }
2294
+ return entry;
2295
+ }
2296
+ // ── Env Value Resolution ──────────────────────────────────────────────────
2297
+ resolveEnvValue(varName) {
2298
+ switch (this.options.target) {
2299
+ case "antigravity":
2300
+ return this.options.envValues[varName] || this.readEnvFile(varName) || `MISSING_${varName}`;
2301
+ case "vscode":
2302
+ return `\${env:${varName}}`;
2303
+ case "claude":
2304
+ case "cursor":
2305
+ case "generic":
2306
+ default:
2307
+ return `\${${varName}}`;
2308
+ }
2309
+ }
2310
+ readEnvFile(varName) {
2311
+ if (!this.options.envFile) return void 0;
2312
+ try {
2313
+ return this.options.envValues[varName];
2314
+ } catch {
2315
+ return void 0;
2316
+ }
2317
+ }
2318
+ // ── Helpers ───────────────────────────────────────────────────────────────
2319
+ objectPropsToMap(props) {
2320
+ const map = /* @__PURE__ */ new Map();
2321
+ if (!props) return map;
2322
+ for (const prop of props) {
2323
+ map.set(prop.key, prop.value);
2324
+ }
2325
+ return map;
1271
2326
  }
2327
+ resolveString(value) {
2328
+ if (!value) return void 0;
2329
+ if (typeof value === "string") return value;
2330
+ if (typeof value === "object" && "value" in value) {
2331
+ return String(value.value);
2332
+ }
2333
+ return String(value);
2334
+ }
2335
+ resolveArray(value) {
2336
+ if (!value) return void 0;
2337
+ if (Array.isArray(value)) {
2338
+ return value.map((v) => {
2339
+ if (typeof v === "string") return v;
2340
+ if (typeof v === "object" && v && "value" in v) return String(v.value);
2341
+ return String(v);
2342
+ });
2343
+ }
2344
+ return void 0;
2345
+ }
2346
+ };
2347
+ exports.DialectRegistry.register({
2348
+ name: "mcp-config",
2349
+ domain: "configuration",
2350
+ description: "Compiles .holo server definitions to IDE-specific MCP config JSON",
2351
+ supportedTraits: ["connector", "env"],
2352
+ factory: (options) => new MCPConfigCompiler(options),
2353
+ inputFormats: [".holo"],
2354
+ outputFormat: ".json"
1272
2355
  });
1273
2356
 
1274
2357
  // src/compiler/index.ts
1275
- chunkQHVVVN47_cjs.init_CompilerBase();
1276
- chunkQHVVVN47_cjs.init_CompilerDocumentationGenerator();
1277
- chunkTSWTWZ42_cjs.init_R3FCompiler();
1278
- chunk7KPI4EKH_cjs.init_UnityCompiler();
1279
- chunkNTMZSDXM_cjs.init_GodotCompiler();
1280
- chunk2UX5LRAP_cjs.init_BabylonCompiler();
1281
- chunkPQLGZKMC_cjs.init_PlayCanvasCompiler();
1282
- chunkY7VK5TH3_cjs.init_ARCompiler();
1283
- chunkXDXZM3ZP_cjs.init_OpenXRCompiler();
1284
- chunkDH5G2JUA_cjs.init_VRChatCompiler();
1285
- chunkEMO7HAKJ_cjs.init_VisionOSCompiler();
1286
- chunkWUXIRGZP_cjs.init_AndroidCompiler();
1287
- chunkPJMOXFPR_cjs.init_AndroidXRCompiler();
1288
- chunkYCMQQQ5U_cjs.init_IOSCompiler();
1289
- chunkNRUB55IT_cjs.init_WASMCompiler();
1290
- chunkDIEDKX5B_cjs.init_WebGPUCompiler();
1291
- chunk4KJ2R7VP_cjs.init_SDFCompiler();
1292
- chunkWFJIDI2N_cjs.init_DTDLCompiler();
1293
- chunkCQDOF3G7_cjs.init_URDFCompiler();
1294
- chunkWN3YF33G_cjs.init_StateCompiler();
1295
- init_NextJSAPICompiler();
1296
- chunkFEFHPUEM_cjs.init_Native2DCompiler();
2358
+ init_Native2DCompiler();
1297
2359
  init_NodeServiceCompiler();
1298
2360
  init_DialectRegistry();
1299
2361
  init_registerBuiltinDialects();
1300
2362
 
1301
- Object.defineProperty(exports, "NodeToyMapper", {
1302
- enumerable: true,
1303
- get: function () { return chunk27LWW5FU_cjs.NodeToyMapper; }
1304
- });
1305
- Object.defineProperty(exports, "mapNodeToyToShader", {
1306
- enumerable: true,
1307
- get: function () { return chunk27LWW5FU_cjs.mapNodeToyToShader; }
1308
- });
1309
2363
  Object.defineProperty(exports, "createReproducibilityContext", {
1310
2364
  enumerable: true,
1311
2365
  get: function () { return chunkVJ3L7CHT_cjs.createReproducibilityContext; }
@@ -1316,67 +2370,67 @@ Object.defineProperty(exports, "parseReproducibilityFlags", {
1316
2370
  });
1317
2371
  Object.defineProperty(exports, "GLTF_PIPELINE_TOOLS", {
1318
2372
  enumerable: true,
1319
- get: function () { return chunkBY3B7ZYV_cjs.GLTF_PIPELINE_TOOLS; }
2373
+ get: function () { return chunkKSGXLT74_cjs.GLTF_PIPELINE_TOOLS; }
1320
2374
  });
1321
2375
  Object.defineProperty(exports, "registerGLTFTools", {
1322
2376
  enumerable: true,
1323
- get: function () { return chunkBY3B7ZYV_cjs.registerGLTFTools; }
2377
+ get: function () { return chunkKSGXLT74_cjs.registerGLTFTools; }
1324
2378
  });
1325
- Object.defineProperty(exports, "CompilerBridge", {
2379
+ Object.defineProperty(exports, "NodeToyMapper", {
1326
2380
  enumerable: true,
1327
- get: function () { return chunkFEFHPUEM_cjs.CompilerBridge; }
2381
+ get: function () { return chunk27LWW5FU_cjs.NodeToyMapper; }
1328
2382
  });
1329
- Object.defineProperty(exports, "Native2DCompiler", {
2383
+ Object.defineProperty(exports, "mapNodeToyToShader", {
1330
2384
  enumerable: true,
1331
- get: function () { return chunkFEFHPUEM_cjs.Native2DCompiler; }
2385
+ get: function () { return chunk27LWW5FU_cjs.mapNodeToyToShader; }
1332
2386
  });
1333
- Object.defineProperty(exports, "NextJSCompiler", {
2387
+ Object.defineProperty(exports, "CompilerBridge", {
1334
2388
  enumerable: true,
1335
- get: function () { return chunkFEFHPUEM_cjs.NextJSCompiler; }
2389
+ get: function () { return chunkF3HH56EB_cjs.CompilerBridge; }
1336
2390
  });
1337
2391
  Object.defineProperty(exports, "USDZPipeline", {
1338
2392
  enumerable: true,
1339
- get: function () { return chunkFEFHPUEM_cjs.USDZPipeline; }
2393
+ get: function () { return chunkF3HH56EB_cjs.USDZPipeline; }
1340
2394
  });
1341
2395
  Object.defineProperty(exports, "bestCategoryForTraits", {
1342
2396
  enumerable: true,
1343
- get: function () { return chunkFEFHPUEM_cjs.bestCategoryForTraits; }
2397
+ get: function () { return chunkF3HH56EB_cjs.bestCategoryForTraits; }
1344
2398
  });
1345
2399
  Object.defineProperty(exports, "compilePipelineSource", {
1346
2400
  enumerable: true,
1347
- get: function () { return chunkFEFHPUEM_cjs.compilePipelineSource; }
2401
+ get: function () { return chunkF3HH56EB_cjs.compilePipelineSource; }
1348
2402
  });
1349
2403
  Object.defineProperty(exports, "compilePipelineSourceToNode", {
1350
2404
  enumerable: true,
1351
- get: function () { return chunkFEFHPUEM_cjs.compilePipelineSourceToNode; }
2405
+ get: function () { return chunkF3HH56EB_cjs.compilePipelineSourceToNode; }
1352
2406
  });
1353
2407
  Object.defineProperty(exports, "compilePipelineSourceToPython", {
1354
2408
  enumerable: true,
1355
- get: function () { return chunkFEFHPUEM_cjs.compilePipelineSourceToPython; }
2409
+ get: function () { return chunkF3HH56EB_cjs.compilePipelineSourceToPython; }
1356
2410
  });
1357
2411
  Object.defineProperty(exports, "compilePipelineToNode", {
1358
2412
  enumerable: true,
1359
- get: function () { return chunkFEFHPUEM_cjs.compilePipelineToNode; }
2413
+ get: function () { return chunkF3HH56EB_cjs.compilePipelineToNode; }
1360
2414
  });
1361
2415
  Object.defineProperty(exports, "compilePipelineToPython", {
1362
2416
  enumerable: true,
1363
- get: function () { return chunkFEFHPUEM_cjs.compilePipelineToPython; }
2417
+ get: function () { return chunkF3HH56EB_cjs.compilePipelineToPython; }
1364
2418
  });
1365
2419
  Object.defineProperty(exports, "quickSafetyCheck", {
1366
2420
  enumerable: true,
1367
- get: function () { return chunkFEFHPUEM_cjs.quickSafetyCheck; }
2421
+ get: function () { return chunkF3HH56EB_cjs.quickSafetyCheck; }
1368
2422
  });
1369
2423
  Object.defineProperty(exports, "runSafetyPass", {
1370
2424
  enumerable: true,
1371
- get: function () { return chunkFEFHPUEM_cjs.runSafetyPass; }
2425
+ get: function () { return chunkF3HH56EB_cjs.runSafetyPass; }
1372
2426
  });
1373
2427
  Object.defineProperty(exports, "selectModality", {
1374
2428
  enumerable: true,
1375
- get: function () { return chunkFEFHPUEM_cjs.selectModality; }
2429
+ get: function () { return chunkF3HH56EB_cjs.selectModality; }
1376
2430
  });
1377
2431
  Object.defineProperty(exports, "selectModalityForAll", {
1378
2432
  enumerable: true,
1379
- get: function () { return chunkFEFHPUEM_cjs.selectModalityForAll; }
2433
+ get: function () { return chunkF3HH56EB_cjs.selectModalityForAll; }
1380
2434
  });
1381
2435
  Object.defineProperty(exports, "generateHullGeometry", {
1382
2436
  enumerable: true,
@@ -1396,124 +2450,126 @@ Object.defineProperty(exports, "RemotionBridge", {
1396
2450
  });
1397
2451
  Object.defineProperty(exports, "SemanticSceneGraph", {
1398
2452
  enumerable: true,
1399
- get: function () { return chunkEJA7G2C4_cjs.SemanticSceneGraph; }
2453
+ get: function () { return chunk5WUNN6ZN_cjs.SemanticSceneGraph; }
1400
2454
  });
1401
2455
  Object.defineProperty(exports, "COCOExporter", {
1402
2456
  enumerable: true,
1403
2457
  get: function () { return chunkI6XZ5DZF_cjs.COCOExporterImpl; }
1404
2458
  });
1405
- Object.defineProperty(exports, "WebGPUCompiler", {
1406
- enumerable: true,
1407
- get: function () { return chunkDIEDKX5B_cjs.WebGPUCompiler; }
1408
- });
1409
2459
  Object.defineProperty(exports, "DTDLCompiler", {
1410
2460
  enumerable: true,
1411
- get: function () { return chunkWFJIDI2N_cjs.DTDLCompiler; }
2461
+ get: function () { return chunkQLEAOI3Q_cjs.DTDLCompiler; }
1412
2462
  });
1413
2463
  Object.defineProperty(exports, "URDFCompiler", {
1414
2464
  enumerable: true,
1415
- get: function () { return chunkCQDOF3G7_cjs.URDFCompiler; }
2465
+ get: function () { return chunk6TZPZCOJ_cjs.URDFCompiler; }
1416
2466
  });
1417
2467
  Object.defineProperty(exports, "USDPhysicsCompiler", {
1418
2468
  enumerable: true,
1419
- get: function () { return chunkVJVCD5T5_cjs.USDPhysicsCompiler; }
2469
+ get: function () { return chunkEQV4R3EV_cjs.USDPhysicsCompiler; }
1420
2470
  });
1421
2471
  Object.defineProperty(exports, "SDFCompiler", {
1422
2472
  enumerable: true,
1423
- get: function () { return chunk4KJ2R7VP_cjs.SDFCompiler; }
2473
+ get: function () { return chunk7AGYRWKW_cjs.SDFCompiler; }
1424
2474
  });
1425
2475
  Object.defineProperty(exports, "StateCompiler", {
1426
2476
  enumerable: true,
1427
- get: function () { return chunkWN3YF33G_cjs.StateCompiler; }
2477
+ get: function () { return chunkB5TCIAPQ_cjs.StateCompiler; }
1428
2478
  });
1429
2479
  Object.defineProperty(exports, "TraitCompositionCompiler", {
1430
2480
  enumerable: true,
1431
- get: function () { return chunkDN7UFU63_cjs.TraitCompositionCompiler; }
2481
+ get: function () { return chunkXRKWN5PL_cjs.TraitCompositionCompiler; }
1432
2482
  });
1433
2483
  Object.defineProperty(exports, "IncrementalCompiler", {
1434
2484
  enumerable: true,
1435
- get: function () { return chunk7H5UNJZD_cjs.IncrementalCompiler; }
1436
- });
1437
- Object.defineProperty(exports, "GodotCompiler", {
1438
- enumerable: true,
1439
- get: function () { return chunkNTMZSDXM_cjs.GodotCompiler; }
2485
+ get: function () { return chunkFSF7EQVA_cjs.IncrementalCompiler; }
1440
2486
  });
1441
2487
  Object.defineProperty(exports, "ENVIRONMENT_PRESETS", {
1442
2488
  enumerable: true,
1443
- get: function () { return chunkTSWTWZ42_cjs.ENVIRONMENT_PRESETS; }
2489
+ get: function () { return chunkQ5SJOGHQ_cjs.ENVIRONMENT_PRESETS; }
1444
2490
  });
1445
2491
  Object.defineProperty(exports, "R3FCompiler", {
1446
2492
  enumerable: true,
1447
- get: function () { return chunkTSWTWZ42_cjs.R3FCompiler; }
2493
+ get: function () { return chunkQ5SJOGHQ_cjs.R3FCompiler; }
1448
2494
  });
1449
2495
  Object.defineProperty(exports, "PlayCanvasCompiler", {
1450
2496
  enumerable: true,
1451
- get: function () { return chunkPQLGZKMC_cjs.PlayCanvasCompiler; }
2497
+ get: function () { return chunkXWPNTWDN_cjs.PlayCanvasCompiler; }
1452
2498
  });
1453
2499
  Object.defineProperty(exports, "AndroidCompiler", {
1454
2500
  enumerable: true,
1455
- get: function () { return chunkWUXIRGZP_cjs.AndroidCompiler; }
2501
+ get: function () { return chunkNCUKG4SK_cjs.AndroidCompiler; }
1456
2502
  });
1457
2503
  Object.defineProperty(exports, "AndroidXRCompiler", {
1458
2504
  enumerable: true,
1459
- get: function () { return chunkPJMOXFPR_cjs.AndroidXRCompiler; }
2505
+ get: function () { return chunk4XSNJCLC_cjs.AndroidXRCompiler; }
1460
2506
  });
1461
2507
  Object.defineProperty(exports, "IOSCompiler", {
1462
2508
  enumerable: true,
1463
- get: function () { return chunkYCMQQQ5U_cjs.IOSCompiler; }
2509
+ get: function () { return chunkCBJSLA2E_cjs.IOSCompiler; }
1464
2510
  });
1465
2511
  Object.defineProperty(exports, "VisionOSCompiler", {
1466
2512
  enumerable: true,
1467
- get: function () { return chunkEMO7HAKJ_cjs.VisionOSCompiler; }
2513
+ get: function () { return chunk5O6TQC6M_cjs.VisionOSCompiler; }
1468
2514
  });
1469
2515
  Object.defineProperty(exports, "WASMCompiler", {
1470
2516
  enumerable: true,
1471
- get: function () { return chunkNRUB55IT_cjs.WASMCompiler; }
2517
+ get: function () { return chunk6UEHYZ7V_cjs.WASMCompiler; }
2518
+ });
2519
+ Object.defineProperty(exports, "WebGPUCompiler", {
2520
+ enumerable: true,
2521
+ get: function () { return chunkBND3ST2K_cjs.WebGPUCompiler; }
1472
2522
  });
1473
2523
  Object.defineProperty(exports, "MultiLayerCompiler", {
1474
2524
  enumerable: true,
1475
- get: function () { return chunkXH7SE4HH_cjs.MultiLayerCompiler; }
2525
+ get: function () { return chunkZP4D3CSX_cjs.MultiLayerCompiler; }
1476
2526
  });
1477
2527
  Object.defineProperty(exports, "ARCompiler", {
1478
2528
  enumerable: true,
1479
- get: function () { return chunkY7VK5TH3_cjs.ARCompiler; }
2529
+ get: function () { return chunkQ5JT3YML_cjs.ARCompiler; }
1480
2530
  });
1481
2531
  Object.defineProperty(exports, "OpenXRCompiler", {
1482
2532
  enumerable: true,
1483
- get: function () { return chunkXDXZM3ZP_cjs.OpenXRCompiler; }
2533
+ get: function () { return chunkFFKU7BTK_cjs.OpenXRCompiler; }
1484
2534
  });
1485
2535
  Object.defineProperty(exports, "VRChatCompiler", {
1486
2536
  enumerable: true,
1487
- get: function () { return chunkDH5G2JUA_cjs.VRChatCompiler; }
2537
+ get: function () { return chunkZ34RLXRA_cjs.VRChatCompiler; }
1488
2538
  });
1489
2539
  Object.defineProperty(exports, "BabylonCompiler", {
1490
2540
  enumerable: true,
1491
- get: function () { return chunk2UX5LRAP_cjs.BabylonCompiler; }
2541
+ get: function () { return chunk33LSUQDD_cjs.BabylonCompiler; }
1492
2542
  });
1493
2543
  Object.defineProperty(exports, "UnityCompiler", {
1494
2544
  enumerable: true,
1495
- get: function () { return chunk7KPI4EKH_cjs.UnityCompiler; }
2545
+ get: function () { return chunkHE7ULERA_cjs.UnityCompiler; }
2546
+ });
2547
+ Object.defineProperty(exports, "GodotCompiler", {
2548
+ enumerable: true,
2549
+ get: function () { return chunkXXINBTZK_cjs.GodotCompiler; }
1496
2550
  });
1497
2551
  Object.defineProperty(exports, "CompilerBase", {
1498
2552
  enumerable: true,
1499
- get: function () { return chunkQHVVVN47_cjs.CompilerBase; }
2553
+ get: function () { return chunkBF2235SI_cjs.CompilerBase; }
1500
2554
  });
1501
2555
  Object.defineProperty(exports, "CompilerDocumentationGenerator", {
1502
2556
  enumerable: true,
1503
- get: function () { return chunkQHVVVN47_cjs.CompilerDocumentationGenerator; }
2557
+ get: function () { return chunkBF2235SI_cjs.CompilerDocumentationGenerator; }
1504
2558
  });
1505
2559
  Object.defineProperty(exports, "UnauthorizedCompilerAccessError", {
1506
2560
  enumerable: true,
1507
- get: function () { return chunkQHVVVN47_cjs.UnauthorizedCompilerAccessError; }
2561
+ get: function () { return chunkBF2235SI_cjs.UnauthorizedCompilerAccessError; }
1508
2562
  });
1509
2563
  Object.defineProperty(exports, "createTestCompilerToken", {
1510
2564
  enumerable: true,
1511
- get: function () { return chunkQHVVVN47_cjs.createTestCompilerToken; }
2565
+ get: function () { return chunkBF2235SI_cjs.createTestCompilerToken; }
1512
2566
  });
1513
2567
  Object.defineProperty(exports, "isCapabilityTokenCredential", {
1514
2568
  enumerable: true,
1515
- get: function () { return chunkQHVVVN47_cjs.isCapabilityTokenCredential; }
2569
+ get: function () { return chunkBF2235SI_cjs.isCapabilityTokenCredential; }
1516
2570
  });
2571
+ exports.MCPConfigCompiler = MCPConfigCompiler;
2572
+ exports.NextJSCompiler = NextJSCompiler;
1517
2573
  exports.compileAllToNextJSAPI = compileAllToNextJSAPI;
1518
2574
  exports.compileToNextJSAPI = compileToNextJSAPI;
1519
2575
  exports.ensureDialectsBooted = ensureDialectsBooted;