@holoscript/core 8.0.13 → 8.0.15

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 (191) hide show
  1. package/README.md +20 -13
  2. package/bin/holo-decision.mjs +133 -0
  3. package/bin/holoscript.cjs +0 -0
  4. package/dist/{GLTFPipeline-L76YTXKA.js → GLTFPipeline-FRBZIATS.js} +7 -7
  5. package/dist/{GLTFPipeline-ZWJN7GI6.cjs → GLTFPipeline-MTPP444P.cjs} +11 -11
  6. package/dist/{HoloCompositionParser-P4Y3CXKQ.js → HoloCompositionParser-2GVQAZ2X.js} +7 -7
  7. package/dist/HoloCompositionParser-3NDF6BMX.cjs +45 -0
  8. package/dist/HoloScriptPlusParser-URSIBEAW.cjs +30 -0
  9. package/dist/HoloScriptPlusParser-YCV6L7GI.js +13 -0
  10. package/dist/{HoloScriptRuntime-YBYXJHJN.cjs → HoloScriptRuntime-CRWI6C3P.cjs} +5 -5
  11. package/dist/{HoloScriptRuntime-UTRLJI5L.js → HoloScriptRuntime-IAZGHPFP.js} +4 -4
  12. package/dist/{SceneIRCompiler-63KA3M2F.js → SceneIRCompiler-BJQMKLWL.js} +7 -7
  13. package/dist/{SceneIRCompiler-KWUFHZ4O.cjs → SceneIRCompiler-RTPPDQAV.cjs} +12 -12
  14. package/dist/{chunk-FWCHPCD4.js → chunk-22AULOAL.js} +5 -5
  15. package/dist/{chunk-G35CAQ7I.cjs → chunk-2DJIS7TH.cjs} +5 -5
  16. package/dist/{chunk-LHUDAJQT.cjs → chunk-2PVEXEOL.cjs} +5 -5
  17. package/dist/{chunk-WWNCM473.js → chunk-2UP2J3OK.js} +4 -4
  18. package/dist/{chunk-HVX7QQYK.js → chunk-3AUYBQ5I.js} +3 -3
  19. package/dist/{chunk-TSTFYGGX.js → chunk-3MQAOMKD.js} +3 -3
  20. package/dist/{chunk-FWKEY4LD.js → chunk-4AGNARX6.js} +3 -3
  21. package/dist/{chunk-WNYXT4TE.cjs → chunk-4CQ7ULXZ.cjs} +3 -3
  22. package/dist/{chunk-U3D4SYQ5.js → chunk-5LCJDX5A.js} +3 -3
  23. package/dist/{chunk-IK6Z2HNC.js → chunk-6OQHLNTT.js} +2 -2
  24. package/dist/{chunk-EI3J6LTW.cjs → chunk-6RDHWSZM.cjs} +217 -217
  25. package/dist/{chunk-77QI552M.js → chunk-7AY66PZP.js} +3 -3
  26. package/dist/{chunk-7IDJDMPU.cjs → chunk-7FYSSI3C.cjs} +27 -2
  27. package/dist/{chunk-BP4KTMLY.js → chunk-7HDRN5BW.js} +4 -4
  28. package/dist/{chunk-SQAAWO4V.cjs → chunk-7YKNV2BE.cjs} +5 -5
  29. package/dist/{chunk-WTH23ISI.js → chunk-AAUQTR7I.js} +4 -4
  30. package/dist/{chunk-OC6GV5QH.cjs → chunk-AN3ZH7M7.cjs} +38 -38
  31. package/dist/{chunk-YW3I2FQL.js → chunk-ANMME7XT.js} +4 -2
  32. package/dist/{chunk-A4OOLBZD.js → chunk-ATRAK4RC.js} +5 -5
  33. package/dist/{chunk-BQJ3YBF3.js → chunk-AUF7HFOO.js} +724 -647
  34. package/dist/{chunk-2X3IPCBK.cjs → chunk-AUMTQV64.cjs} +7 -7
  35. package/dist/chunk-AUU4ACJP.cjs +1605 -0
  36. package/dist/{chunk-QQFB4RT2.cjs → chunk-BTVHY3UB.cjs} +2 -2
  37. package/dist/{chunk-ZK7KX5CD.cjs → chunk-CMEINO5I.cjs} +190 -74
  38. package/dist/{chunk-BCP4E7MD.cjs → chunk-CRUIGXF7.cjs} +26 -10
  39. package/dist/{chunk-2E6PP5UE.cjs → chunk-E2SNPMBO.cjs} +11 -11
  40. package/dist/{chunk-2BYAUHBO.js → chunk-E4YS5SIZ.js} +90 -25
  41. package/dist/{chunk-KFVNCW4Q.js → chunk-EKNWUSGW.js} +3 -3
  42. package/dist/{chunk-JEJ7TT54.js → chunk-ETIJOUIO.js} +4 -4
  43. package/dist/{chunk-FRSKLX6I.js → chunk-F33KLYOS.js} +12 -9
  44. package/dist/{chunk-GGR7QUKK.cjs → chunk-F47FEV4X.cjs} +40 -40
  45. package/dist/{chunk-J3UHV5T4.cjs → chunk-FCGTI7FO.cjs} +4 -4
  46. package/dist/{chunk-RRQIAJLQ.cjs → chunk-FGTXAVKG.cjs} +5 -5
  47. package/dist/{chunk-2KKOYZYI.cjs → chunk-FPGYWNNA.cjs} +5 -5
  48. package/dist/{chunk-65S62L4D.cjs → chunk-FQ4MYZYU.cjs} +20 -20
  49. package/dist/{chunk-UGQ3QNV6.js → chunk-FT4FGTR6.js} +24 -8
  50. package/dist/{chunk-Q4K2GEMW.cjs → chunk-FVNV4WHQ.cjs} +20 -17
  51. package/dist/{chunk-SJIRCTIS.cjs → chunk-HSGJFCVJ.cjs} +2 -2
  52. package/dist/{chunk-B3CWTCK2.js → chunk-IA7FCSRY.js} +27 -2
  53. package/dist/{chunk-OIBRWLPY.cjs → chunk-ILO2KMER.cjs} +55 -4
  54. package/dist/{chunk-ZRPALBQB.cjs → chunk-IPBSNGAN.cjs} +92 -27
  55. package/dist/{chunk-FHVPN7BN.js → chunk-IX2U3RQT.js} +3 -3
  56. package/dist/{chunk-QEDMOGF3.cjs → chunk-IYK6LMQ7.cjs} +7 -7
  57. package/dist/{chunk-G6EKZHXY.js → chunk-J3VVM6GV.js} +4 -4
  58. package/dist/{chunk-LMB555QB.cjs → chunk-J74S4ZMF.cjs} +18 -18
  59. package/dist/{chunk-36NPLOI4.cjs → chunk-JERWCCEJ.cjs} +4 -2
  60. package/dist/{chunk-RVNXBF2M.js → chunk-JTDDLCSP.js} +4 -4
  61. package/dist/{chunk-VTEXJOSD.cjs → chunk-K53L47NH.cjs} +30 -30
  62. package/dist/{chunk-IJU6AS67.cjs → chunk-LJTM5ONX.cjs} +23 -23
  63. package/dist/{chunk-G6KACNMO.js → chunk-LJVVOVA6.js} +4 -4
  64. package/dist/{chunk-PDXX5UI4.cjs → chunk-LNJKBQ2B.cjs} +38 -38
  65. package/dist/{chunk-EM2OGPYE.js → chunk-M2GDE3NV.js} +3 -3
  66. package/dist/{chunk-CP7V3ATL.js → chunk-MSZNGI5P.js} +52 -5
  67. package/dist/{chunk-P7JEKJTZ.cjs → chunk-N2BOTBPG.cjs} +27 -16
  68. package/dist/{chunk-LB3ZZMKT.cjs → chunk-NFALJJCH.cjs} +12 -12
  69. package/dist/{chunk-XF63CZ7E.cjs → chunk-NRZRBK25.cjs} +6 -6
  70. package/dist/{chunk-GZPUA2TL.cjs → chunk-NTSLNIY7.cjs} +10 -10
  71. package/dist/{chunk-Y57AVOM2.cjs → chunk-NZJOAWJM.cjs} +4 -4
  72. package/dist/{chunk-RXQNRZ5F.js → chunk-OG7RKWWX.js} +3 -3
  73. package/dist/{chunk-VVAAZITA.cjs → chunk-OQVHCYY4.cjs} +5 -5
  74. package/dist/{chunk-PJFTTSKE.js → chunk-PFZ5WLIP.js} +4 -4
  75. package/dist/{chunk-PXVAPGTR.cjs → chunk-PHLNABJD.cjs} +3788 -1138
  76. package/dist/{chunk-SQXAZHDG.js → chunk-PLK3DLTF.js} +3 -3
  77. package/dist/{chunk-QBY7LRN2.js → chunk-PMACVMHL.js} +3 -3
  78. package/dist/{chunk-DJ5BNRIS.js → chunk-PV2OXNP5.js} +3684 -1041
  79. package/dist/{chunk-F3YT6GUF.cjs → chunk-Q6VW7MGX.cjs} +14 -14
  80. package/dist/{chunk-DUG3OQAS.js → chunk-QC3CAVFN.js} +187 -70
  81. package/dist/{chunk-NQN5LFN4.cjs → chunk-QKLEDRHN.cjs} +19 -19
  82. package/dist/{chunk-2EGGAZT3.js → chunk-QS27OYBU.js} +3 -3
  83. package/dist/{chunk-4376VHNJ.js → chunk-RUB7WL6C.js} +3 -3
  84. package/dist/{chunk-5LVFTGKH.js → chunk-TW2AH2ZS.js} +3 -3
  85. package/dist/{chunk-AATYYLYK.js → chunk-TZM6DKSJ.js} +18 -7
  86. package/dist/{chunk-ESSEF6U2.js → chunk-U227RWXB.js} +3 -3
  87. package/dist/{chunk-TC7JEO6R.cjs → chunk-U6CQOM5Q.cjs} +711 -52
  88. package/dist/{chunk-Z557DVYN.js → chunk-ULT2QAV5.js} +4 -4
  89. package/dist/{chunk-S4O7CFHQ.cjs → chunk-VSO6HPDZ.cjs} +7 -7
  90. package/dist/{chunk-ONPVM4IV.js → chunk-WQJMSSJT.js} +698 -45
  91. package/dist/{chunk-GILYQ5VH.cjs → chunk-WXSDBWGM.cjs} +4 -4
  92. package/dist/{chunk-UTUD6GJI.js → chunk-X5PMMK7H.js} +3 -3
  93. package/dist/{chunk-IFW5IW4L.cjs → chunk-X5ZLSPU2.cjs} +742 -657
  94. package/dist/{chunk-QM7FJB5W.js → chunk-X727CQ7X.js} +5 -5
  95. package/dist/{chunk-566ZB4LZ.cjs → chunk-XHZYS4QO.cjs} +5 -5
  96. package/dist/{chunk-RZ2EPXO3.cjs → chunk-XRQCTTDC.cjs} +8 -8
  97. package/dist/{chunk-5FYMCVBY.js → chunk-YBIHSN55.js} +4 -4
  98. package/dist/{chunk-FG6PYGIZ.js → chunk-Z574GVI3.js} +4 -4
  99. package/dist/{chunk-ZVQMKUGJ.js → chunk-Z5V3KA7L.js} +2 -2
  100. package/dist/chunk-ZGDEOXGU.js +1571 -0
  101. package/dist/{chunk-IS7NTKY5.cjs → chunk-ZHW6TDZ6.cjs} +14 -14
  102. package/dist/{chunk-CKV5NYAE.js → chunk-ZPHCTPR6.js} +4 -4
  103. package/dist/{chunk-3IUHTGDD.cjs → chunk-ZXXC2GXB.cjs} +38 -38
  104. package/dist/cli/holoscript-runner.cjs +169 -20
  105. package/dist/cli/holoscript-runner.js +163 -14
  106. package/dist/compiler/agent-inference.cjs +8 -8
  107. package/dist/compiler/agent-inference.js +4 -4
  108. package/dist/compiler/android-xr.cjs +7 -7
  109. package/dist/compiler/android-xr.js +5 -5
  110. package/dist/compiler/android.cjs +6 -6
  111. package/dist/compiler/android.js +4 -4
  112. package/dist/compiler/context.cjs +6 -6
  113. package/dist/compiler/context.js +3 -3
  114. package/dist/compiler/daimon-seed.cjs +9 -9
  115. package/dist/compiler/daimon-seed.js +4 -4
  116. package/dist/compiler/domain-block-utils.cjs +165 -165
  117. package/dist/compiler/domain-block-utils.js +4 -4
  118. package/dist/compiler/dtdl.cjs +7 -7
  119. package/dist/compiler/dtdl.js +4 -4
  120. package/dist/compiler/gltf-pipeline.cjs +8 -8
  121. package/dist/compiler/gltf-pipeline.js +1 -1
  122. package/dist/compiler/godot.cjs +6 -6
  123. package/dist/compiler/godot.js +5 -5
  124. package/dist/compiler/incremental.cjs +8 -8
  125. package/dist/compiler/incremental.js +3 -3
  126. package/dist/compiler/index.cjs +2275 -212
  127. package/dist/compiler/index.d.ts +29 -1
  128. package/dist/compiler/index.js +2078 -66
  129. package/dist/compiler/ios.cjs +6 -6
  130. package/dist/compiler/ios.js +4 -4
  131. package/dist/compiler/llm-provider-capabilities.cjs +6 -6
  132. package/dist/compiler/llm-provider-capabilities.js +3 -3
  133. package/dist/compiler/openxr.cjs +6 -6
  134. package/dist/compiler/openxr.js +5 -5
  135. package/dist/compiler/sdf.cjs +7 -7
  136. package/dist/compiler/sdf.js +5 -5
  137. package/dist/compiler/state.cjs +6 -6
  138. package/dist/compiler/state.js +4 -4
  139. package/dist/compiler/trait-composition.cjs +7 -7
  140. package/dist/compiler/trait-composition.js +3 -3
  141. package/dist/compiler/unity.cjs +6 -6
  142. package/dist/compiler/unity.js +5 -5
  143. package/dist/compiler/unreal.cjs +7 -7
  144. package/dist/compiler/unreal.js +5 -5
  145. package/dist/compiler/urdf.cjs +14 -14
  146. package/dist/compiler/urdf.js +5 -5
  147. package/dist/compiler/usd-physics.cjs +7 -7
  148. package/dist/compiler/usd-physics.js +4 -4
  149. package/dist/compiler/visionos.cjs +6 -6
  150. package/dist/compiler/visionos.js +5 -5
  151. package/dist/compiler/vrchat.cjs +7 -7
  152. package/dist/compiler/vrchat.js +5 -5
  153. package/dist/compiler/wasm.cjs +10 -10
  154. package/dist/compiler/wasm.js +5 -5
  155. package/dist/compiler/webgpu.cjs +6 -6
  156. package/dist/compiler/webgpu.js +5 -5
  157. package/dist/constants.cjs +99 -99
  158. package/dist/constants.js +3 -3
  159. package/dist/debugger.cjs +5 -5
  160. package/dist/debugger.js +3 -3
  161. package/dist/{dist-GRMOP2UL.cjs → dist-YGATNURH.cjs} +705 -9
  162. package/dist/{dist-ZBUKU2JG.js → dist-ZEZXRCBG.js} +701 -10
  163. package/dist/entries/scripting.cjs +8 -8
  164. package/dist/entries/scripting.js +4 -4
  165. package/dist/evolution/index.cjs +20 -20
  166. package/dist/evolution/index.js +8 -8
  167. package/dist/index.cjs +1099 -826
  168. package/dist/index.d.ts +78 -5
  169. package/dist/index.js +265 -120
  170. package/dist/parser/HoloCompositionTypes.d.ts +1 -1
  171. package/dist/parser.cjs +21 -21
  172. package/dist/parser.js +7 -7
  173. package/dist/reconstruction/index.cjs +127 -38
  174. package/dist/reconstruction/index.d.ts +159 -0
  175. package/dist/reconstruction/index.js +11 -2
  176. package/dist/runtime.cjs +9 -9
  177. package/dist/runtime.d.ts +1 -0
  178. package/dist/runtime.js +3 -3
  179. package/dist/traitDocs/traitDocs.cjs +8 -8
  180. package/dist/traitDocs/traitDocs.js +2 -2
  181. package/dist/traits/botanical-lotus.d.ts +61 -0
  182. package/dist/traits/index.cjs +761 -673
  183. package/dist/traits/index.d.ts +65 -0
  184. package/dist/traits/index.js +102 -27
  185. package/dist/types/HoloScriptPlus.d.ts +1 -1
  186. package/package.json +71 -65
  187. package/dist/HoloCompositionParser-6GW2BZID.cjs +0 -45
  188. package/dist/HoloScriptPlusParser-HQV6IJAH.js +0 -13
  189. package/dist/HoloScriptPlusParser-RFNHRMPE.cjs +0 -30
  190. package/dist/chunk-DVHZD5HV.cjs +0 -639
  191. package/dist/chunk-G72754QB.js +0 -625
@@ -3,12 +3,12 @@ import { checkLicenseCompatibility, ethToWei, calculateRevenueDistribution, form
3
3
  import { InteropContext } from '../chunk-TPZ3BN2D.js';
4
4
  import { AbsorbProcessor, ScriptTestRunner, HotReloadWatcher } from '../chunk-2M2DPHKB.js';
5
5
  import { generateProvenance } from '../chunk-4R6SBXDB.js';
6
- import { parse } from '../chunk-FRSKLX6I.js';
7
- import '../chunk-CP7V3ATL.js';
6
+ import { parse } from '../chunk-F33KLYOS.js';
7
+ import '../chunk-MSZNGI5P.js';
8
8
  import '../chunk-UNMVGZVW.js';
9
- import '../chunk-FWKEY4LD.js';
10
- import '../chunk-2EGGAZT3.js';
11
- import '../chunk-YW3I2FQL.js';
9
+ import '../chunk-4AGNARX6.js';
10
+ import '../chunk-QS27OYBU.js';
11
+ import '../chunk-ANMME7XT.js';
12
12
  import '../chunk-7I74JWPW.js';
13
13
  import '../chunk-2I3XAGMF.js';
14
14
  import '../chunk-MD4IVS42.js';
@@ -20,7 +20,7 @@ import * as fs from 'fs';
20
20
  import * as path from 'path';
21
21
  import * as readline from 'readline';
22
22
  import { spawn } from 'child_process';
23
- import { randomUUID } from 'crypto';
23
+ import { randomUUID, createHash } from 'crypto';
24
24
 
25
25
  init_safeJsonParse();
26
26
  var engineRuntimeModule;
@@ -680,6 +680,65 @@ async function runDaemon(runtime, opts) {
680
680
  rl.once("close", () => resolve2());
681
681
  });
682
682
  }
683
+ var RUN_RECEIPT_SCHEMA = "holoscript.cli.run-receipt.v1";
684
+ var RUN_SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".holo", ".hs", ".hsplus"]);
685
+ function sha256(value) {
686
+ return `sha256:${createHash("sha256").update(value).digest("hex")}`;
687
+ }
688
+ function summarizeRunParseErrors(errors) {
689
+ if (!Array.isArray(errors)) return [];
690
+ return errors.slice(0, 8).map((error) => {
691
+ const item = error && typeof error === "object" ? error : {};
692
+ const summary = {
693
+ message: typeof item.message === "string" ? item.message : "HoloScript parse failed"
694
+ };
695
+ if (typeof item.code === "string") summary.code = item.code;
696
+ if (Number.isInteger(item.line)) summary.line = item.line;
697
+ if (Number.isInteger(item.column)) summary.column = item.column;
698
+ return summary;
699
+ });
700
+ }
701
+ function integerStat(stats, key) {
702
+ const value = stats[key];
703
+ return typeof value === "number" && Number.isInteger(value) && value >= 0 ? value : null;
704
+ }
705
+ function normalizeRuntimeCounters(stats) {
706
+ return {
707
+ tickCount: integerStat(stats, "tickCount") ?? integerStat(stats, "updateCount"),
708
+ nodesProcessed: integerStat(stats, "nodesProcessed"),
709
+ instanceCount: integerStat(stats, "instanceCount"),
710
+ peakInstanceCount: integerStat(stats, "peakInstanceCount"),
711
+ eventCount: integerStat(stats, "eventCount")
712
+ };
713
+ }
714
+ function resolvePortableRunOutput(output) {
715
+ if (!output) return void 0;
716
+ const portable = output.replace(/\\/gu, "/");
717
+ const segments = portable.split("/");
718
+ if (path.isAbsolute(output) || /^[a-z]:/iu.test(portable) || portable.startsWith("//") || segments.some((segment) => segment === "..") || path.extname(portable).toLowerCase() !== ".json") {
719
+ throw new Error("Run receipt output must be a portable, relative .json path");
720
+ }
721
+ const resolved = path.resolve(process.cwd(), output);
722
+ const relative2 = path.relative(process.cwd(), resolved);
723
+ if (relative2.startsWith("..") || path.isAbsolute(relative2)) {
724
+ throw new Error("Run receipt output must stay within the working directory");
725
+ }
726
+ return resolved;
727
+ }
728
+ function emitRunReceipt(opts, outputPath, stableReceipt) {
729
+ const receipt = {
730
+ ...stableReceipt,
731
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
732
+ receiptHash: sha256(JSON.stringify(stableReceipt))
733
+ };
734
+ if (outputPath) {
735
+ fs.mkdirSync(path.dirname(outputPath), { recursive: true });
736
+ fs.writeFileSync(outputPath, `${JSON.stringify(receipt, null, 2)}
737
+ `, "utf-8");
738
+ }
739
+ if (opts.json) console.log(JSON.stringify(receipt));
740
+ return receipt;
741
+ }
683
742
  async function runScript(opts) {
684
743
  if (!opts.file) {
685
744
  console.error("Error: No input file specified");
@@ -692,8 +751,57 @@ async function runScript(opts) {
692
751
  }
693
752
  const source = fs.readFileSync(filePath, "utf-8");
694
753
  const ext = path.extname(filePath);
695
- console.log(`[holoscript] Running ${path.basename(filePath)} (target: ${opts.target})`);
754
+ const outputPath = resolvePortableRunOutput(opts.output);
755
+ if (opts.watch && (opts.json || outputPath)) {
756
+ throw new Error("Run receipts cannot be combined with --watch");
757
+ }
758
+ if (!opts.json) {
759
+ console.log(`[holoscript] Running ${path.basename(filePath)} (target: ${opts.target})`);
760
+ }
761
+ if (!RUN_SOURCE_EXTENSIONS.has(ext.toLowerCase())) {
762
+ const errors = [
763
+ {
764
+ code: "CLI001",
765
+ message: "HoloScript run accepts only .holo, .hs, or .hsplus source"
766
+ }
767
+ ];
768
+ emitRunReceipt(opts, outputPath, {
769
+ schema: RUN_RECEIPT_SCHEMA,
770
+ ok: false,
771
+ source: {
772
+ file: path.basename(filePath),
773
+ extension: ext.toLowerCase(),
774
+ digest: sha256(source),
775
+ parsePassed: false,
776
+ errors
777
+ },
778
+ execution: null
779
+ });
780
+ if (!opts.json) console.error(`[holoscript] Admission failed \u2014 ${errors[0].message}`);
781
+ process.exitCode = 2;
782
+ return;
783
+ }
696
784
  const parseResult = parse(source);
785
+ if (!parseResult.success || !parseResult.ast) {
786
+ const errors = summarizeRunParseErrors(parseResult.errors);
787
+ emitRunReceipt(opts, outputPath, {
788
+ schema: RUN_RECEIPT_SCHEMA,
789
+ ok: false,
790
+ source: {
791
+ file: path.basename(filePath),
792
+ extension: ext.toLowerCase(),
793
+ digest: sha256(source),
794
+ parsePassed: false,
795
+ errors
796
+ },
797
+ execution: null
798
+ });
799
+ if (!opts.json) {
800
+ console.error(`[holoscript] Parse failed \u2014 ${errors[0]?.message ?? "invalid HoloScript"}`);
801
+ }
802
+ process.exitCode = 2;
803
+ return;
804
+ }
697
805
  const ast = parseResult.ast;
698
806
  if (opts.debug) {
699
807
  console.log(`[holoscript] Parsed ${ast.body?.length || 0} top-level nodes`);
@@ -740,9 +848,44 @@ async function runScript(opts) {
740
848
  runTicks(runtime, opts.ticks);
741
849
  runtime.stop();
742
850
  const stats = runtime.getStats();
743
- console.log(
744
- `[holoscript] Complete \u2014 ${stats.tickCount} ticks, ${stats.nodesProcessed} nodes processed`
745
- );
851
+ const counters = normalizeRuntimeCounters(stats);
852
+ const sceneRuntime = runtime;
853
+ const scene = sceneRuntime.getSceneReceipt?.() ?? {
854
+ schema: "holoscript-headless-scene-receipt-unavailable-v1",
855
+ rootId: null,
856
+ objectCount: 0,
857
+ objects: []
858
+ };
859
+ const stableReceipt = {
860
+ schema: RUN_RECEIPT_SCHEMA,
861
+ ok: true,
862
+ source: {
863
+ file: path.basename(filePath),
864
+ extension: ext.toLowerCase(),
865
+ digest: sha256(source),
866
+ parsePassed: true,
867
+ topLevelNodes: ast.body?.length ?? 0
868
+ },
869
+ execution: {
870
+ target: opts.target,
871
+ profile: profile.name,
872
+ requestedTicks: opts.ticks,
873
+ counters,
874
+ scene,
875
+ policy: {
876
+ shellAllowed: opts.allowShell,
877
+ networkAllowed: opts.allowedHosts.length > 0,
878
+ allowedPathCount: opts.allowedPaths.length
879
+ }
880
+ }
881
+ };
882
+ emitRunReceipt(opts, outputPath, stableReceipt);
883
+ if (!opts.json) {
884
+ const objectCount = integerStat(scene, "objectCount") ?? 0;
885
+ console.log(
886
+ `[holoscript] Complete \u2014 ${counters.tickCount ?? "unknown"} ticks, ${objectCount} scene objects`
887
+ );
888
+ }
746
889
  if (opts.watch) {
747
890
  console.log(`[holoscript] Watching for changes... (Ctrl+C to stop)`);
748
891
  const watcher = new HotReloadWatcher({
@@ -758,6 +901,10 @@ async function runScript(opts) {
758
901
  try {
759
902
  const newSource = fs.readFileSync(filePath, "utf-8");
760
903
  const newParseResult = parse(newSource);
904
+ if (!newParseResult.success || !newParseResult.ast) {
905
+ const parseError = summarizeRunParseErrors(newParseResult.errors)[0];
906
+ throw new Error(parseError?.message ?? "invalid HoloScript");
907
+ }
761
908
  const newAst = newParseResult.ast;
762
909
  const newRuntime = createHeadlessRuntime(newAst, {
763
910
  profile: opts.profile === "headless" ? HEADLESS_PROFILE : getProfile(opts.profile),
@@ -768,9 +915,11 @@ async function runScript(opts) {
768
915
  newRuntime.start();
769
916
  runTicks(newRuntime, opts.ticks);
770
917
  newRuntime.stop();
771
- const newStats = newRuntime.getStats();
918
+ const newStats = normalizeRuntimeCounters(
919
+ newRuntime.getStats()
920
+ );
772
921
  console.log(
773
- `[holoscript] Complete \u2014 ${newStats.tickCount} ticks, ${newStats.nodesProcessed} nodes`
922
+ `[holoscript] Complete \u2014 ${newStats.tickCount ?? "unknown"} ticks, ${newStats.nodesProcessed ?? "unknown"} nodes`
774
923
  );
775
924
  } catch (err) {
776
925
  console.error(`[holoscript] Error:`, err.message);
@@ -1955,7 +2104,7 @@ async function holoMeshDaemonScript(opts) {
1955
2104
  const meshConfig = {
1956
2105
  orchestratorUrl: process.env.MCP_ORCHESTRATOR_URL || "https://mcp-orchestrator-production-45f9.up.railway.app",
1957
2106
  apiKey: process.env.HOLOSCRIPT_API_KEY,
1958
- workspace: process.env.HOLOMESH_WORKSPACE || "ai-ecosystem",
2107
+ workspace: process.env.HOLOMESH_WORKSPACE || "default",
1959
2108
  agentName: process.env.HOLOMESH_AGENT_NAME || "holomesh-agent",
1960
2109
  discoveryIntervalMs: 5 * 60 * 1e3,
1961
2110
  inboxIntervalMs: 60 * 1e3,
@@ -2210,7 +2359,7 @@ function showHelp() {
2210
2359
  HoloScript CLI \u2014 Headless Runner v5.0
2211
2360
 
2212
2361
  Usage:
2213
- holoscript run <file> [--target node|python|ros2] [--profile headless|minimal|full] [--ticks <n>] [--daemon] [--debug]
2362
+ holoscript run <file> [--target node|python|ros2] [--profile headless|minimal|full] [--ticks <n>] [--output <receipt.json>] [--json] [--daemon] [--debug]
2214
2363
  holoscript test <file> [--debug]
2215
2364
  holoscript compile <file> [--target node|python] [--output <path>] [--enforce-gotchas]
2216
2365
  holoscript deploy <file> [--share] [--publish] [--price <eth>] [--mint-nft] [--wallet-key <key>] [--author <name>] [--license <type>] [--server <url>]
@@ -2,30 +2,30 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkBCP4E7MD_cjs = require('../chunk-BCP4E7MD.cjs');
6
- require('../chunk-ZK7KX5CD.cjs');
7
- require('../chunk-7IDJDMPU.cjs');
5
+ var chunkCRUIGXF7_cjs = require('../chunk-CRUIGXF7.cjs');
6
+ require('../chunk-CMEINO5I.cjs');
7
+ require('../chunk-7FYSSI3C.cjs');
8
8
  require('../chunk-CI33NINL.cjs');
9
9
  require('../chunk-Q47JEE2C.cjs');
10
10
  require('../chunk-ZHPMP447.cjs');
11
11
 
12
- chunkBCP4E7MD_cjs.init_AgentInferenceExportTarget();
12
+ chunkCRUIGXF7_cjs.init_AgentInferenceExportTarget();
13
13
 
14
14
  Object.defineProperty(exports, "AgentInferenceCompiler", {
15
15
  enumerable: true,
16
- get: function () { return chunkBCP4E7MD_cjs.AgentInferenceCompiler; }
16
+ get: function () { return chunkCRUIGXF7_cjs.AgentInferenceCompiler; }
17
17
  });
18
18
  Object.defineProperty(exports, "createAgentInferenceCompiler", {
19
19
  enumerable: true,
20
- get: function () { return chunkBCP4E7MD_cjs.createAgentInferenceCompiler; }
20
+ get: function () { return chunkCRUIGXF7_cjs.createAgentInferenceCompiler; }
21
21
  });
22
22
  Object.defineProperty(exports, "createPythonAgentInferenceCompiler", {
23
23
  enumerable: true,
24
- get: function () { return chunkBCP4E7MD_cjs.createPythonAgentInferenceCompiler; }
24
+ get: function () { return chunkCRUIGXF7_cjs.createPythonAgentInferenceCompiler; }
25
25
  });
26
26
  Object.defineProperty(exports, "default", {
27
27
  enumerable: true,
28
- get: function () { return chunkBCP4E7MD_cjs.AgentInferenceExportTarget_default; }
28
+ get: function () { return chunkCRUIGXF7_cjs.AgentInferenceExportTarget_default; }
29
29
  });
30
30
  //# sourceMappingURL=agent-inference.cjs.map
31
31
  //# sourceMappingURL=agent-inference.cjs.map
@@ -1,7 +1,7 @@
1
- import { init_AgentInferenceExportTarget } from '../chunk-UGQ3QNV6.js';
2
- export { AgentInferenceCompiler, createAgentInferenceCompiler, createPythonAgentInferenceCompiler, AgentInferenceExportTarget_default as default } from '../chunk-UGQ3QNV6.js';
3
- import '../chunk-DUG3OQAS.js';
4
- import '../chunk-B3CWTCK2.js';
1
+ import { init_AgentInferenceExportTarget } from '../chunk-FT4FGTR6.js';
2
+ export { AgentInferenceCompiler, createAgentInferenceCompiler, createPythonAgentInferenceCompiler, AgentInferenceExportTarget_default as default } from '../chunk-FT4FGTR6.js';
3
+ import '../chunk-QC3CAVFN.js';
4
+ import '../chunk-IA7FCSRY.js';
5
5
  import '../chunk-5CURIYGT.js';
6
6
  import '../chunk-RAN3ECAS.js';
7
7
  import '../chunk-W4GABFCR.js';
@@ -1,25 +1,25 @@
1
1
  'use strict';
2
2
 
3
- var chunkNQN5LFN4_cjs = require('../chunk-NQN5LFN4.cjs');
3
+ var chunkQKLEDRHN_cjs = require('../chunk-QKLEDRHN.cjs');
4
4
  require('../chunk-CFVK26P4.cjs');
5
5
  require('../chunk-TZCFKZ6Z.cjs');
6
- require('../chunk-QEDMOGF3.cjs');
6
+ require('../chunk-IYK6LMQ7.cjs');
7
7
  require('../chunk-VHORVGCG.cjs');
8
- require('../chunk-ZK7KX5CD.cjs');
9
- require('../chunk-7IDJDMPU.cjs');
8
+ require('../chunk-CMEINO5I.cjs');
9
+ require('../chunk-7FYSSI3C.cjs');
10
10
  require('../chunk-CI33NINL.cjs');
11
11
  require('../chunk-Q47JEE2C.cjs');
12
12
  require('../chunk-ZHPMP447.cjs');
13
13
 
14
- chunkNQN5LFN4_cjs.init_AndroidXRCompiler();
14
+ chunkQKLEDRHN_cjs.init_AndroidXRCompiler();
15
15
 
16
16
  Object.defineProperty(exports, "AndroidXRCompiler", {
17
17
  enumerable: true,
18
- get: function () { return chunkNQN5LFN4_cjs.AndroidXRCompiler; }
18
+ get: function () { return chunkQKLEDRHN_cjs.AndroidXRCompiler; }
19
19
  });
20
20
  Object.defineProperty(exports, "compileToAndroidXR", {
21
21
  enumerable: true,
22
- get: function () { return chunkNQN5LFN4_cjs.compileToAndroidXR; }
22
+ get: function () { return chunkQKLEDRHN_cjs.compileToAndroidXR; }
23
23
  });
24
24
  //# sourceMappingURL=android-xr.cjs.map
25
25
  //# sourceMappingURL=android-xr.cjs.map
@@ -1,11 +1,11 @@
1
- import { init_AndroidXRCompiler } from '../chunk-G6KACNMO.js';
2
- export { AndroidXRCompiler, compileToAndroidXR } from '../chunk-G6KACNMO.js';
1
+ import { init_AndroidXRCompiler } from '../chunk-LJVVOVA6.js';
2
+ export { AndroidXRCompiler, compileToAndroidXR } from '../chunk-LJVVOVA6.js';
3
3
  import '../chunk-CBSDJF3B.js';
4
4
  import '../chunk-DJNH4HFW.js';
5
- import '../chunk-5LVFTGKH.js';
5
+ import '../chunk-TW2AH2ZS.js';
6
6
  import '../chunk-UCVZXQ63.js';
7
- import '../chunk-DUG3OQAS.js';
8
- import '../chunk-B3CWTCK2.js';
7
+ import '../chunk-QC3CAVFN.js';
8
+ import '../chunk-IA7FCSRY.js';
9
9
  import '../chunk-5CURIYGT.js';
10
10
  import '../chunk-RAN3ECAS.js';
11
11
  import '../chunk-W4GABFCR.js';
@@ -1,24 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var chunk2KKOYZYI_cjs = require('../chunk-2KKOYZYI.cjs');
3
+ var chunkFPGYWNNA_cjs = require('../chunk-FPGYWNNA.cjs');
4
4
  require('../chunk-CFVK26P4.cjs');
5
- require('../chunk-ZK7KX5CD.cjs');
6
- require('../chunk-7IDJDMPU.cjs');
5
+ require('../chunk-CMEINO5I.cjs');
6
+ require('../chunk-7FYSSI3C.cjs');
7
7
  require('../chunk-CI33NINL.cjs');
8
8
  require('../chunk-AWXFEAQL.cjs');
9
9
  require('../chunk-N74QRJGP.cjs');
10
10
  require('../chunk-Q47JEE2C.cjs');
11
11
  require('../chunk-ZHPMP447.cjs');
12
12
 
13
- chunk2KKOYZYI_cjs.init_AndroidCompiler();
13
+ chunkFPGYWNNA_cjs.init_AndroidCompiler();
14
14
 
15
15
  Object.defineProperty(exports, "AndroidCompiler", {
16
16
  enumerable: true,
17
- get: function () { return chunk2KKOYZYI_cjs.AndroidCompiler; }
17
+ get: function () { return chunkFPGYWNNA_cjs.AndroidCompiler; }
18
18
  });
19
19
  Object.defineProperty(exports, "compileToAndroid", {
20
20
  enumerable: true,
21
- get: function () { return chunk2KKOYZYI_cjs.compileToAndroid; }
21
+ get: function () { return chunkFPGYWNNA_cjs.compileToAndroid; }
22
22
  });
23
23
  //# sourceMappingURL=android.cjs.map
24
24
  //# sourceMappingURL=android.cjs.map
@@ -1,8 +1,8 @@
1
- import { init_AndroidCompiler } from '../chunk-HVX7QQYK.js';
2
- export { AndroidCompiler, compileToAndroid } from '../chunk-HVX7QQYK.js';
1
+ import { init_AndroidCompiler } from '../chunk-3AUYBQ5I.js';
2
+ export { AndroidCompiler, compileToAndroid } from '../chunk-3AUYBQ5I.js';
3
3
  import '../chunk-CBSDJF3B.js';
4
- import '../chunk-DUG3OQAS.js';
5
- import '../chunk-B3CWTCK2.js';
4
+ import '../chunk-QC3CAVFN.js';
5
+ import '../chunk-IA7FCSRY.js';
6
6
  import '../chunk-5CURIYGT.js';
7
7
  import '../chunk-7I74JWPW.js';
8
8
  import '../chunk-MD4IVS42.js';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunk566ZB4LZ_cjs = require('../chunk-566ZB4LZ.cjs');
4
- require('../chunk-ZK7KX5CD.cjs');
5
- require('../chunk-7IDJDMPU.cjs');
3
+ var chunkXHZYS4QO_cjs = require('../chunk-XHZYS4QO.cjs');
4
+ require('../chunk-CMEINO5I.cjs');
5
+ require('../chunk-7FYSSI3C.cjs');
6
6
  require('../chunk-CI33NINL.cjs');
7
7
  require('../chunk-Q47JEE2C.cjs');
8
8
  require('../chunk-ZHPMP447.cjs');
@@ -11,15 +11,15 @@ require('../chunk-ZHPMP447.cjs');
11
11
 
12
12
  Object.defineProperty(exports, "ContextCompileError", {
13
13
  enumerable: true,
14
- get: function () { return chunk566ZB4LZ_cjs.ContextCompileError; }
14
+ get: function () { return chunkXHZYS4QO_cjs.ContextCompileError; }
15
15
  });
16
16
  Object.defineProperty(exports, "ContextCompiler", {
17
17
  enumerable: true,
18
- get: function () { return chunk566ZB4LZ_cjs.ContextCompiler; }
18
+ get: function () { return chunkXHZYS4QO_cjs.ContextCompiler; }
19
19
  });
20
20
  Object.defineProperty(exports, "createContextCompiler", {
21
21
  enumerable: true,
22
- get: function () { return chunk566ZB4LZ_cjs.createContextCompiler; }
22
+ get: function () { return chunkXHZYS4QO_cjs.createContextCompiler; }
23
23
  });
24
24
  //# sourceMappingURL=context.cjs.map
25
25
  //# sourceMappingURL=context.cjs.map
@@ -1,6 +1,6 @@
1
- export { ContextCompileError, ContextCompiler, createContextCompiler } from '../chunk-UTUD6GJI.js';
2
- import '../chunk-DUG3OQAS.js';
3
- import '../chunk-B3CWTCK2.js';
1
+ export { ContextCompileError, ContextCompiler, createContextCompiler } from '../chunk-X5PMMK7H.js';
2
+ import '../chunk-QC3CAVFN.js';
3
+ import '../chunk-IA7FCSRY.js';
4
4
  import '../chunk-5CURIYGT.js';
5
5
  import '../chunk-RAN3ECAS.js';
6
6
  import '../chunk-W4GABFCR.js';
@@ -2,35 +2,35 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkVVAAZITA_cjs = require('../chunk-VVAAZITA.cjs');
5
+ var chunkOQVHCYY4_cjs = require('../chunk-OQVHCYY4.cjs');
6
6
  require('../chunk-356N4NPM.cjs');
7
- require('../chunk-ZK7KX5CD.cjs');
8
- require('../chunk-7IDJDMPU.cjs');
7
+ require('../chunk-CMEINO5I.cjs');
8
+ require('../chunk-7FYSSI3C.cjs');
9
9
  require('../chunk-CI33NINL.cjs');
10
10
  require('../chunk-Q47JEE2C.cjs');
11
11
  require('../chunk-ZHPMP447.cjs');
12
12
 
13
- chunkVVAAZITA_cjs.init_DaimonSeedCompiler();
13
+ chunkOQVHCYY4_cjs.init_DaimonSeedCompiler();
14
14
 
15
15
  Object.defineProperty(exports, "DaimonSeedCompiler", {
16
16
  enumerable: true,
17
- get: function () { return chunkVVAAZITA_cjs.DaimonSeedCompiler; }
17
+ get: function () { return chunkOQVHCYY4_cjs.DaimonSeedCompiler; }
18
18
  });
19
19
  Object.defineProperty(exports, "computeExportFidelity", {
20
20
  enumerable: true,
21
- get: function () { return chunkVVAAZITA_cjs.computeExportFidelity; }
21
+ get: function () { return chunkOQVHCYY4_cjs.computeExportFidelity; }
22
22
  });
23
23
  Object.defineProperty(exports, "createDaimonSeedCompiler", {
24
24
  enumerable: true,
25
- get: function () { return chunkVVAAZITA_cjs.createDaimonSeedCompiler; }
25
+ get: function () { return chunkOQVHCYY4_cjs.createDaimonSeedCompiler; }
26
26
  });
27
27
  Object.defineProperty(exports, "default", {
28
28
  enumerable: true,
29
- get: function () { return chunkVVAAZITA_cjs.DaimonSeedCompiler_default; }
29
+ get: function () { return chunkOQVHCYY4_cjs.DaimonSeedCompiler_default; }
30
30
  });
31
31
  Object.defineProperty(exports, "runHysteresisExp2", {
32
32
  enumerable: true,
33
- get: function () { return chunkVVAAZITA_cjs.runHysteresisExp2; }
33
+ get: function () { return chunkOQVHCYY4_cjs.runHysteresisExp2; }
34
34
  });
35
35
  //# sourceMappingURL=daimon-seed.cjs.map
36
36
  //# sourceMappingURL=daimon-seed.cjs.map
@@ -1,8 +1,8 @@
1
- import { init_DaimonSeedCompiler } from '../chunk-QBY7LRN2.js';
2
- export { DaimonSeedCompiler, computeExportFidelity, createDaimonSeedCompiler, DaimonSeedCompiler_default as default, runHysteresisExp2 } from '../chunk-QBY7LRN2.js';
1
+ import { init_DaimonSeedCompiler } from '../chunk-PMACVMHL.js';
2
+ export { DaimonSeedCompiler, computeExportFidelity, createDaimonSeedCompiler, DaimonSeedCompiler_default as default, runHysteresisExp2 } from '../chunk-PMACVMHL.js';
3
3
  import '../chunk-JBQXZIWB.js';
4
- import '../chunk-DUG3OQAS.js';
5
- import '../chunk-B3CWTCK2.js';
4
+ import '../chunk-QC3CAVFN.js';
5
+ import '../chunk-IA7FCSRY.js';
6
6
  import '../chunk-5CURIYGT.js';
7
7
  import '../chunk-RAN3ECAS.js';
8
8
  import '../chunk-W4GABFCR.js';