@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.
- package/README.md +20 -13
- package/bin/holo-decision.mjs +133 -0
- package/bin/holoscript.cjs +0 -0
- package/dist/{GLTFPipeline-L76YTXKA.js → GLTFPipeline-FRBZIATS.js} +7 -7
- package/dist/{GLTFPipeline-ZWJN7GI6.cjs → GLTFPipeline-MTPP444P.cjs} +11 -11
- package/dist/{HoloCompositionParser-P4Y3CXKQ.js → HoloCompositionParser-2GVQAZ2X.js} +7 -7
- package/dist/HoloCompositionParser-3NDF6BMX.cjs +45 -0
- package/dist/HoloScriptPlusParser-URSIBEAW.cjs +30 -0
- package/dist/HoloScriptPlusParser-YCV6L7GI.js +13 -0
- package/dist/{HoloScriptRuntime-YBYXJHJN.cjs → HoloScriptRuntime-CRWI6C3P.cjs} +5 -5
- package/dist/{HoloScriptRuntime-UTRLJI5L.js → HoloScriptRuntime-IAZGHPFP.js} +4 -4
- package/dist/{SceneIRCompiler-63KA3M2F.js → SceneIRCompiler-BJQMKLWL.js} +7 -7
- package/dist/{SceneIRCompiler-KWUFHZ4O.cjs → SceneIRCompiler-RTPPDQAV.cjs} +12 -12
- package/dist/{chunk-FWCHPCD4.js → chunk-22AULOAL.js} +5 -5
- package/dist/{chunk-G35CAQ7I.cjs → chunk-2DJIS7TH.cjs} +5 -5
- package/dist/{chunk-LHUDAJQT.cjs → chunk-2PVEXEOL.cjs} +5 -5
- package/dist/{chunk-WWNCM473.js → chunk-2UP2J3OK.js} +4 -4
- package/dist/{chunk-HVX7QQYK.js → chunk-3AUYBQ5I.js} +3 -3
- package/dist/{chunk-TSTFYGGX.js → chunk-3MQAOMKD.js} +3 -3
- package/dist/{chunk-FWKEY4LD.js → chunk-4AGNARX6.js} +3 -3
- package/dist/{chunk-WNYXT4TE.cjs → chunk-4CQ7ULXZ.cjs} +3 -3
- package/dist/{chunk-U3D4SYQ5.js → chunk-5LCJDX5A.js} +3 -3
- package/dist/{chunk-IK6Z2HNC.js → chunk-6OQHLNTT.js} +2 -2
- package/dist/{chunk-EI3J6LTW.cjs → chunk-6RDHWSZM.cjs} +217 -217
- package/dist/{chunk-77QI552M.js → chunk-7AY66PZP.js} +3 -3
- package/dist/{chunk-7IDJDMPU.cjs → chunk-7FYSSI3C.cjs} +27 -2
- package/dist/{chunk-BP4KTMLY.js → chunk-7HDRN5BW.js} +4 -4
- package/dist/{chunk-SQAAWO4V.cjs → chunk-7YKNV2BE.cjs} +5 -5
- package/dist/{chunk-WTH23ISI.js → chunk-AAUQTR7I.js} +4 -4
- package/dist/{chunk-OC6GV5QH.cjs → chunk-AN3ZH7M7.cjs} +38 -38
- package/dist/{chunk-YW3I2FQL.js → chunk-ANMME7XT.js} +4 -2
- package/dist/{chunk-A4OOLBZD.js → chunk-ATRAK4RC.js} +5 -5
- package/dist/{chunk-BQJ3YBF3.js → chunk-AUF7HFOO.js} +724 -647
- package/dist/{chunk-2X3IPCBK.cjs → chunk-AUMTQV64.cjs} +7 -7
- package/dist/chunk-AUU4ACJP.cjs +1605 -0
- package/dist/{chunk-QQFB4RT2.cjs → chunk-BTVHY3UB.cjs} +2 -2
- package/dist/{chunk-ZK7KX5CD.cjs → chunk-CMEINO5I.cjs} +190 -74
- package/dist/{chunk-BCP4E7MD.cjs → chunk-CRUIGXF7.cjs} +26 -10
- package/dist/{chunk-2E6PP5UE.cjs → chunk-E2SNPMBO.cjs} +11 -11
- package/dist/{chunk-2BYAUHBO.js → chunk-E4YS5SIZ.js} +90 -25
- package/dist/{chunk-KFVNCW4Q.js → chunk-EKNWUSGW.js} +3 -3
- package/dist/{chunk-JEJ7TT54.js → chunk-ETIJOUIO.js} +4 -4
- package/dist/{chunk-FRSKLX6I.js → chunk-F33KLYOS.js} +12 -9
- package/dist/{chunk-GGR7QUKK.cjs → chunk-F47FEV4X.cjs} +40 -40
- package/dist/{chunk-J3UHV5T4.cjs → chunk-FCGTI7FO.cjs} +4 -4
- package/dist/{chunk-RRQIAJLQ.cjs → chunk-FGTXAVKG.cjs} +5 -5
- package/dist/{chunk-2KKOYZYI.cjs → chunk-FPGYWNNA.cjs} +5 -5
- package/dist/{chunk-65S62L4D.cjs → chunk-FQ4MYZYU.cjs} +20 -20
- package/dist/{chunk-UGQ3QNV6.js → chunk-FT4FGTR6.js} +24 -8
- package/dist/{chunk-Q4K2GEMW.cjs → chunk-FVNV4WHQ.cjs} +20 -17
- package/dist/{chunk-SJIRCTIS.cjs → chunk-HSGJFCVJ.cjs} +2 -2
- package/dist/{chunk-B3CWTCK2.js → chunk-IA7FCSRY.js} +27 -2
- package/dist/{chunk-OIBRWLPY.cjs → chunk-ILO2KMER.cjs} +55 -4
- package/dist/{chunk-ZRPALBQB.cjs → chunk-IPBSNGAN.cjs} +92 -27
- package/dist/{chunk-FHVPN7BN.js → chunk-IX2U3RQT.js} +3 -3
- package/dist/{chunk-QEDMOGF3.cjs → chunk-IYK6LMQ7.cjs} +7 -7
- package/dist/{chunk-G6EKZHXY.js → chunk-J3VVM6GV.js} +4 -4
- package/dist/{chunk-LMB555QB.cjs → chunk-J74S4ZMF.cjs} +18 -18
- package/dist/{chunk-36NPLOI4.cjs → chunk-JERWCCEJ.cjs} +4 -2
- package/dist/{chunk-RVNXBF2M.js → chunk-JTDDLCSP.js} +4 -4
- package/dist/{chunk-VTEXJOSD.cjs → chunk-K53L47NH.cjs} +30 -30
- package/dist/{chunk-IJU6AS67.cjs → chunk-LJTM5ONX.cjs} +23 -23
- package/dist/{chunk-G6KACNMO.js → chunk-LJVVOVA6.js} +4 -4
- package/dist/{chunk-PDXX5UI4.cjs → chunk-LNJKBQ2B.cjs} +38 -38
- package/dist/{chunk-EM2OGPYE.js → chunk-M2GDE3NV.js} +3 -3
- package/dist/{chunk-CP7V3ATL.js → chunk-MSZNGI5P.js} +52 -5
- package/dist/{chunk-P7JEKJTZ.cjs → chunk-N2BOTBPG.cjs} +27 -16
- package/dist/{chunk-LB3ZZMKT.cjs → chunk-NFALJJCH.cjs} +12 -12
- package/dist/{chunk-XF63CZ7E.cjs → chunk-NRZRBK25.cjs} +6 -6
- package/dist/{chunk-GZPUA2TL.cjs → chunk-NTSLNIY7.cjs} +10 -10
- package/dist/{chunk-Y57AVOM2.cjs → chunk-NZJOAWJM.cjs} +4 -4
- package/dist/{chunk-RXQNRZ5F.js → chunk-OG7RKWWX.js} +3 -3
- package/dist/{chunk-VVAAZITA.cjs → chunk-OQVHCYY4.cjs} +5 -5
- package/dist/{chunk-PJFTTSKE.js → chunk-PFZ5WLIP.js} +4 -4
- package/dist/{chunk-PXVAPGTR.cjs → chunk-PHLNABJD.cjs} +3788 -1138
- package/dist/{chunk-SQXAZHDG.js → chunk-PLK3DLTF.js} +3 -3
- package/dist/{chunk-QBY7LRN2.js → chunk-PMACVMHL.js} +3 -3
- package/dist/{chunk-DJ5BNRIS.js → chunk-PV2OXNP5.js} +3684 -1041
- package/dist/{chunk-F3YT6GUF.cjs → chunk-Q6VW7MGX.cjs} +14 -14
- package/dist/{chunk-DUG3OQAS.js → chunk-QC3CAVFN.js} +187 -70
- package/dist/{chunk-NQN5LFN4.cjs → chunk-QKLEDRHN.cjs} +19 -19
- package/dist/{chunk-2EGGAZT3.js → chunk-QS27OYBU.js} +3 -3
- package/dist/{chunk-4376VHNJ.js → chunk-RUB7WL6C.js} +3 -3
- package/dist/{chunk-5LVFTGKH.js → chunk-TW2AH2ZS.js} +3 -3
- package/dist/{chunk-AATYYLYK.js → chunk-TZM6DKSJ.js} +18 -7
- package/dist/{chunk-ESSEF6U2.js → chunk-U227RWXB.js} +3 -3
- package/dist/{chunk-TC7JEO6R.cjs → chunk-U6CQOM5Q.cjs} +711 -52
- package/dist/{chunk-Z557DVYN.js → chunk-ULT2QAV5.js} +4 -4
- package/dist/{chunk-S4O7CFHQ.cjs → chunk-VSO6HPDZ.cjs} +7 -7
- package/dist/{chunk-ONPVM4IV.js → chunk-WQJMSSJT.js} +698 -45
- package/dist/{chunk-GILYQ5VH.cjs → chunk-WXSDBWGM.cjs} +4 -4
- package/dist/{chunk-UTUD6GJI.js → chunk-X5PMMK7H.js} +3 -3
- package/dist/{chunk-IFW5IW4L.cjs → chunk-X5ZLSPU2.cjs} +742 -657
- package/dist/{chunk-QM7FJB5W.js → chunk-X727CQ7X.js} +5 -5
- package/dist/{chunk-566ZB4LZ.cjs → chunk-XHZYS4QO.cjs} +5 -5
- package/dist/{chunk-RZ2EPXO3.cjs → chunk-XRQCTTDC.cjs} +8 -8
- package/dist/{chunk-5FYMCVBY.js → chunk-YBIHSN55.js} +4 -4
- package/dist/{chunk-FG6PYGIZ.js → chunk-Z574GVI3.js} +4 -4
- package/dist/{chunk-ZVQMKUGJ.js → chunk-Z5V3KA7L.js} +2 -2
- package/dist/chunk-ZGDEOXGU.js +1571 -0
- package/dist/{chunk-IS7NTKY5.cjs → chunk-ZHW6TDZ6.cjs} +14 -14
- package/dist/{chunk-CKV5NYAE.js → chunk-ZPHCTPR6.js} +4 -4
- package/dist/{chunk-3IUHTGDD.cjs → chunk-ZXXC2GXB.cjs} +38 -38
- package/dist/cli/holoscript-runner.cjs +169 -20
- package/dist/cli/holoscript-runner.js +163 -14
- package/dist/compiler/agent-inference.cjs +8 -8
- package/dist/compiler/agent-inference.js +4 -4
- package/dist/compiler/android-xr.cjs +7 -7
- package/dist/compiler/android-xr.js +5 -5
- package/dist/compiler/android.cjs +6 -6
- package/dist/compiler/android.js +4 -4
- package/dist/compiler/context.cjs +6 -6
- package/dist/compiler/context.js +3 -3
- package/dist/compiler/daimon-seed.cjs +9 -9
- package/dist/compiler/daimon-seed.js +4 -4
- package/dist/compiler/domain-block-utils.cjs +165 -165
- package/dist/compiler/domain-block-utils.js +4 -4
- package/dist/compiler/dtdl.cjs +7 -7
- package/dist/compiler/dtdl.js +4 -4
- package/dist/compiler/gltf-pipeline.cjs +8 -8
- package/dist/compiler/gltf-pipeline.js +1 -1
- package/dist/compiler/godot.cjs +6 -6
- package/dist/compiler/godot.js +5 -5
- package/dist/compiler/incremental.cjs +8 -8
- package/dist/compiler/incremental.js +3 -3
- package/dist/compiler/index.cjs +2275 -212
- package/dist/compiler/index.d.ts +29 -1
- package/dist/compiler/index.js +2078 -66
- package/dist/compiler/ios.cjs +6 -6
- package/dist/compiler/ios.js +4 -4
- package/dist/compiler/llm-provider-capabilities.cjs +6 -6
- package/dist/compiler/llm-provider-capabilities.js +3 -3
- package/dist/compiler/openxr.cjs +6 -6
- package/dist/compiler/openxr.js +5 -5
- package/dist/compiler/sdf.cjs +7 -7
- package/dist/compiler/sdf.js +5 -5
- package/dist/compiler/state.cjs +6 -6
- package/dist/compiler/state.js +4 -4
- package/dist/compiler/trait-composition.cjs +7 -7
- package/dist/compiler/trait-composition.js +3 -3
- package/dist/compiler/unity.cjs +6 -6
- package/dist/compiler/unity.js +5 -5
- package/dist/compiler/unreal.cjs +7 -7
- package/dist/compiler/unreal.js +5 -5
- package/dist/compiler/urdf.cjs +14 -14
- package/dist/compiler/urdf.js +5 -5
- package/dist/compiler/usd-physics.cjs +7 -7
- package/dist/compiler/usd-physics.js +4 -4
- package/dist/compiler/visionos.cjs +6 -6
- package/dist/compiler/visionos.js +5 -5
- package/dist/compiler/vrchat.cjs +7 -7
- package/dist/compiler/vrchat.js +5 -5
- package/dist/compiler/wasm.cjs +10 -10
- package/dist/compiler/wasm.js +5 -5
- package/dist/compiler/webgpu.cjs +6 -6
- package/dist/compiler/webgpu.js +5 -5
- package/dist/constants.cjs +99 -99
- package/dist/constants.js +3 -3
- package/dist/debugger.cjs +5 -5
- package/dist/debugger.js +3 -3
- package/dist/{dist-GRMOP2UL.cjs → dist-YGATNURH.cjs} +705 -9
- package/dist/{dist-ZBUKU2JG.js → dist-ZEZXRCBG.js} +701 -10
- package/dist/entries/scripting.cjs +8 -8
- package/dist/entries/scripting.js +4 -4
- package/dist/evolution/index.cjs +20 -20
- package/dist/evolution/index.js +8 -8
- package/dist/index.cjs +1099 -826
- package/dist/index.d.ts +78 -5
- package/dist/index.js +265 -120
- package/dist/parser/HoloCompositionTypes.d.ts +1 -1
- package/dist/parser.cjs +21 -21
- package/dist/parser.js +7 -7
- package/dist/reconstruction/index.cjs +127 -38
- package/dist/reconstruction/index.d.ts +159 -0
- package/dist/reconstruction/index.js +11 -2
- package/dist/runtime.cjs +9 -9
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +3 -3
- package/dist/traitDocs/traitDocs.cjs +8 -8
- package/dist/traitDocs/traitDocs.js +2 -2
- package/dist/traits/botanical-lotus.d.ts +61 -0
- package/dist/traits/index.cjs +761 -673
- package/dist/traits/index.d.ts +65 -0
- package/dist/traits/index.js +102 -27
- package/dist/types/HoloScriptPlus.d.ts +1 -1
- package/package.json +71 -65
- package/dist/HoloCompositionParser-6GW2BZID.cjs +0 -45
- package/dist/HoloScriptPlusParser-HQV6IJAH.js +0 -13
- package/dist/HoloScriptPlusParser-RFNHRMPE.cjs +0 -30
- package/dist/chunk-DVHZD5HV.cjs +0 -639
- package/dist/chunk-G72754QB.js +0 -625
package/dist/compiler/index.cjs
CHANGED
|
@@ -1,100 +1,175 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkXHZYS4QO_cjs = require('../chunk-XHZYS4QO.cjs');
|
|
4
|
+
var chunk2DJIS7TH_cjs = require('../chunk-2DJIS7TH.cjs');
|
|
5
|
+
var chunk4CQ7ULXZ_cjs = require('../chunk-4CQ7ULXZ.cjs');
|
|
6
6
|
var chunkOV46CCA2_cjs = require('../chunk-OV46CCA2.cjs');
|
|
7
7
|
var chunkS6YWHCKV_cjs = require('../chunk-S6YWHCKV.cjs');
|
|
8
8
|
var chunkVJ3L7CHT_cjs = require('../chunk-VJ3L7CHT.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var chunkIPBSNGAN_cjs = require('../chunk-IPBSNGAN.cjs');
|
|
10
|
+
var chunkPHLNABJD_cjs = require('../chunk-PHLNABJD.cjs');
|
|
11
11
|
var chunkFT6TDR2O_cjs = require('../chunk-FT6TDR2O.cjs');
|
|
12
12
|
require('../chunk-LDYZWNJW.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunkF47FEV4X_cjs = require('../chunk-F47FEV4X.cjs');
|
|
14
14
|
require('../chunk-KROXXBK5.cjs');
|
|
15
|
-
var
|
|
15
|
+
var chunkOQVHCYY4_cjs = require('../chunk-OQVHCYY4.cjs');
|
|
16
16
|
var chunkGKFCHGCM_cjs = require('../chunk-GKFCHGCM.cjs');
|
|
17
17
|
var chunkI6XZ5DZF_cjs = require('../chunk-I6XZ5DZF.cjs');
|
|
18
18
|
var chunkXUILI4KB_cjs = require('../chunk-XUILI4KB.cjs');
|
|
19
19
|
var chunkQHSAVOOL_cjs = require('../chunk-QHSAVOOL.cjs');
|
|
20
|
-
var
|
|
21
|
-
var
|
|
20
|
+
var chunkCRUIGXF7_cjs = require('../chunk-CRUIGXF7.cjs');
|
|
21
|
+
var chunkX5ZLSPU2_cjs = require('../chunk-X5ZLSPU2.cjs');
|
|
22
22
|
require('../chunk-YKY2JBER.cjs');
|
|
23
|
-
require('../chunk-
|
|
23
|
+
require('../chunk-BTVHY3UB.cjs');
|
|
24
24
|
var chunkN2ILK7BF_cjs = require('../chunk-N2ILK7BF.cjs');
|
|
25
25
|
require('../chunk-DN6F4DHH.cjs');
|
|
26
26
|
require('../chunk-XHIV6326.cjs');
|
|
27
27
|
require('../chunk-3FOKASKO.cjs');
|
|
28
28
|
require('../chunk-ENZCIQZC.cjs');
|
|
29
29
|
require('../chunk-4PDEPEQW.cjs');
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
30
|
+
var chunkFQ4MYZYU_cjs = require('../chunk-FQ4MYZYU.cjs');
|
|
31
|
+
var chunkQ6VW7MGX_cjs = require('../chunk-Q6VW7MGX.cjs');
|
|
32
|
+
var chunkAUMTQV64_cjs = require('../chunk-AUMTQV64.cjs');
|
|
33
|
+
var chunkVSO6HPDZ_cjs = require('../chunk-VSO6HPDZ.cjs');
|
|
34
34
|
require('../chunk-V6GXFSK7.cjs');
|
|
35
|
-
var
|
|
35
|
+
var chunkXRQCTTDC_cjs = require('../chunk-XRQCTTDC.cjs');
|
|
36
36
|
require('../chunk-R75BSDH7.cjs');
|
|
37
|
-
var
|
|
38
|
-
var
|
|
37
|
+
var chunkFPGYWNNA_cjs = require('../chunk-FPGYWNNA.cjs');
|
|
38
|
+
var chunkQKLEDRHN_cjs = require('../chunk-QKLEDRHN.cjs');
|
|
39
39
|
require('../chunk-CFVK26P4.cjs');
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
40
|
+
var chunkK53L47NH_cjs = require('../chunk-K53L47NH.cjs');
|
|
41
|
+
var chunkJ74S4ZMF_cjs = require('../chunk-J74S4ZMF.cjs');
|
|
42
|
+
var chunkNTSLNIY7_cjs = require('../chunk-NTSLNIY7.cjs');
|
|
43
|
+
var chunkU6CQOM5Q_cjs = require('../chunk-U6CQOM5Q.cjs');
|
|
44
|
+
var chunkFGTXAVKG_cjs = require('../chunk-FGTXAVKG.cjs');
|
|
45
|
+
var chunkN2BOTBPG_cjs = require('../chunk-N2BOTBPG.cjs');
|
|
46
46
|
require('../chunk-356N4NPM.cjs');
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
require('../chunk-
|
|
47
|
+
var chunkZHW6TDZ6_cjs = require('../chunk-ZHW6TDZ6.cjs');
|
|
48
|
+
var chunkZXXC2GXB_cjs = require('../chunk-ZXXC2GXB.cjs');
|
|
49
|
+
var chunkLNJKBQ2B_cjs = require('../chunk-LNJKBQ2B.cjs');
|
|
50
|
+
require('../chunk-LJTM5ONX.cjs');
|
|
51
51
|
var chunkTZCFKZ6Z_cjs = require('../chunk-TZCFKZ6Z.cjs');
|
|
52
|
-
var
|
|
53
|
-
require('../chunk-
|
|
52
|
+
var chunkAN3ZH7M7_cjs = require('../chunk-AN3ZH7M7.cjs');
|
|
53
|
+
require('../chunk-IYK6LMQ7.cjs');
|
|
54
54
|
var chunkVHORVGCG_cjs = require('../chunk-VHORVGCG.cjs');
|
|
55
|
-
var
|
|
56
|
-
var
|
|
55
|
+
var chunkCMEINO5I_cjs = require('../chunk-CMEINO5I.cjs');
|
|
56
|
+
var chunk7FYSSI3C_cjs = require('../chunk-7FYSSI3C.cjs');
|
|
57
57
|
require('../chunk-CI33NINL.cjs');
|
|
58
58
|
require('../chunk-VW5CRJBE.cjs');
|
|
59
59
|
require('../chunk-HCX4SMFK.cjs');
|
|
60
60
|
require('../chunk-3VBO3IYQ.cjs');
|
|
61
61
|
require('../chunk-YP5CHEYU.cjs');
|
|
62
|
-
require('../chunk-
|
|
63
|
-
require('../chunk-
|
|
62
|
+
require('../chunk-6RDHWSZM.cjs');
|
|
63
|
+
require('../chunk-JERWCCEJ.cjs');
|
|
64
64
|
require('../chunk-AWXFEAQL.cjs');
|
|
65
65
|
require('../chunk-4FIBOJW6.cjs');
|
|
66
66
|
require('../chunk-N74QRJGP.cjs');
|
|
67
67
|
var chunkGJNCFRJU_cjs = require('../chunk-GJNCFRJU.cjs');
|
|
68
|
-
require('../chunk-
|
|
68
|
+
require('../chunk-HSGJFCVJ.cjs');
|
|
69
69
|
require('../chunk-ILRBGFVD.cjs');
|
|
70
70
|
require('../chunk-ESBXUYOC.cjs');
|
|
71
71
|
var chunkQ47JEE2C_cjs = require('../chunk-Q47JEE2C.cjs');
|
|
72
72
|
require('../chunk-ZHPMP447.cjs');
|
|
73
73
|
var ans = require('@holoscript/core-types/ans');
|
|
74
|
+
var crypto = require('crypto');
|
|
75
|
+
|
|
76
|
+
// src/compiler/index.ts
|
|
77
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
78
|
+
chunkCMEINO5I_cjs.init_CompilerDocumentationGenerator();
|
|
79
|
+
|
|
80
|
+
// src/compiler/SceneIRTsxEmitter.ts
|
|
81
|
+
var GENERATED_HEADER = "// @generated by HoloScript SceneIRTsxEmitter -- DO NOT EDIT";
|
|
82
|
+
function emitSceneIRTsx(root, options = {}) {
|
|
83
|
+
const componentName = sanitizeComponentName(options.componentName ?? root.id ?? "HoloScene");
|
|
84
|
+
const sceneConstName = `${componentName}SceneIR`;
|
|
85
|
+
const imports = [
|
|
86
|
+
options.includeCanvas ?? true ? "import { Canvas } from '@react-three/fiber';" : "",
|
|
87
|
+
"import { HoloSceneIRRenderer } from '@holoscript/r3f-renderer';"
|
|
88
|
+
].filter(Boolean);
|
|
89
|
+
const source = options.sourcePath ? `// source: ${options.sourcePath}
|
|
90
|
+
` : "";
|
|
91
|
+
if (options.includeCanvas === false) {
|
|
92
|
+
return [
|
|
93
|
+
GENERATED_HEADER,
|
|
94
|
+
source.trimEnd(),
|
|
95
|
+
...imports,
|
|
96
|
+
"",
|
|
97
|
+
`const ${sceneConstName} = ${json(root)};`,
|
|
98
|
+
"",
|
|
99
|
+
`export function ${componentName}() {`,
|
|
100
|
+
` return <HoloSceneIRRenderer node={${sceneConstName}} />;`,
|
|
101
|
+
"}",
|
|
102
|
+
"",
|
|
103
|
+
`export default ${componentName};`,
|
|
104
|
+
""
|
|
105
|
+
].filter((line, idx) => line !== "" || idx !== 1).join("\n");
|
|
106
|
+
}
|
|
107
|
+
return [
|
|
108
|
+
GENERATED_HEADER,
|
|
109
|
+
source.trimEnd(),
|
|
110
|
+
...imports,
|
|
111
|
+
"",
|
|
112
|
+
`const ${sceneConstName} = ${json(root)};`,
|
|
113
|
+
"",
|
|
114
|
+
`export function ${componentName}() {`,
|
|
115
|
+
" return (",
|
|
116
|
+
" <Canvas>",
|
|
117
|
+
` <HoloSceneIRRenderer node={${sceneConstName}} />`,
|
|
118
|
+
" </Canvas>",
|
|
119
|
+
" );",
|
|
120
|
+
"}",
|
|
121
|
+
"",
|
|
122
|
+
`export default ${componentName};`,
|
|
123
|
+
""
|
|
124
|
+
].filter((line, idx) => line !== "" || idx !== 1).join("\n");
|
|
125
|
+
}
|
|
126
|
+
function sanitizeComponentName(name) {
|
|
127
|
+
const words = name.replace(/[^A-Za-z0-9_$]+/g, " ").trim().split(/\s+/).filter(Boolean);
|
|
128
|
+
const joined = words.map((word) => word[0].toUpperCase() + word.slice(1)).join("");
|
|
129
|
+
const candidate = joined || "HoloScene";
|
|
130
|
+
return /^[A-Za-z_$]/.test(candidate) ? candidate : `HoloScene${candidate}`;
|
|
131
|
+
}
|
|
132
|
+
function json(value) {
|
|
133
|
+
return JSON.stringify(normalizeValue(value), null, 2).replace(/</g, "\\u003c");
|
|
134
|
+
}
|
|
135
|
+
function normalizeValue(value) {
|
|
136
|
+
if (ArrayBuffer.isView(value) && !(value instanceof DataView)) {
|
|
137
|
+
return Array.from(value);
|
|
138
|
+
}
|
|
139
|
+
if (Array.isArray(value)) {
|
|
140
|
+
return value.map((entry) => normalizeValue(entry));
|
|
141
|
+
}
|
|
142
|
+
if (value && typeof value === "object") {
|
|
143
|
+
const out = {};
|
|
144
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
145
|
+
out[key] = normalizeValue(entry);
|
|
146
|
+
}
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
149
|
+
return value;
|
|
150
|
+
}
|
|
74
151
|
|
|
75
152
|
// src/compiler/index.ts
|
|
76
|
-
chunkZK7KX5CD_cjs.init_CompilerBase();
|
|
77
|
-
chunkZK7KX5CD_cjs.init_CompilerDocumentationGenerator();
|
|
78
153
|
chunkVHORVGCG_cjs.init_PerceptualColorPass();
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
154
|
+
chunkLNJKBQ2B_cjs.init_UnityCompiler();
|
|
155
|
+
chunkAN3ZH7M7_cjs.init_GodotCompiler();
|
|
156
|
+
chunkZHW6TDZ6_cjs.init_OpenXRCompiler();
|
|
157
|
+
chunkZXXC2GXB_cjs.init_VRChatCompiler();
|
|
158
|
+
chunkJ74S4ZMF_cjs.init_VisionOSCompiler();
|
|
159
|
+
chunkFPGYWNNA_cjs.init_AndroidCompiler();
|
|
160
|
+
chunkQKLEDRHN_cjs.init_AndroidXRCompiler();
|
|
161
|
+
chunkK53L47NH_cjs.init_IOSCompiler();
|
|
162
|
+
chunkNTSLNIY7_cjs.init_WASMCompiler();
|
|
163
|
+
chunkU6CQOM5Q_cjs.init_WebGPUCompiler();
|
|
89
164
|
chunkTZCFKZ6Z_cjs.init_PlatformConditionalCompilerMixin();
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
165
|
+
chunkQ6VW7MGX_cjs.init_SDFCompiler();
|
|
166
|
+
chunkFGTXAVKG_cjs.init_DTDLCompiler();
|
|
167
|
+
chunkN2BOTBPG_cjs.init_URDFCompiler();
|
|
168
|
+
chunkAUMTQV64_cjs.init_StateCompiler();
|
|
94
169
|
|
|
95
170
|
// src/compiler/MultiLayerCompiler.ts
|
|
96
|
-
|
|
97
|
-
var MultiLayerCompiler = class extends
|
|
171
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
172
|
+
var MultiLayerCompiler = class extends chunkCMEINO5I_cjs.CompilerBase {
|
|
98
173
|
constructor(_options) {
|
|
99
174
|
super();
|
|
100
175
|
this.compilerName = "MultiLayerCompiler";
|
|
@@ -110,12 +185,12 @@ var MultiLayerCompiler = class extends chunkZK7KX5CD_cjs.CompilerBase {
|
|
|
110
185
|
};
|
|
111
186
|
|
|
112
187
|
// src/compiler/NextJSCompiler.ts
|
|
113
|
-
|
|
188
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
114
189
|
|
|
115
190
|
// src/compiler/Native2DCompiler.ts
|
|
116
|
-
|
|
191
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
117
192
|
chunkQ47JEE2C_cjs.init_safeJsonParse();
|
|
118
|
-
var
|
|
193
|
+
var _Native2DCompiler = class _Native2DCompiler extends chunkCMEINO5I_cjs.CompilerBase {
|
|
119
194
|
constructor() {
|
|
120
195
|
super(...arguments);
|
|
121
196
|
this.compilerName = "Native2DCompiler";
|
|
@@ -128,7 +203,22 @@ var Native2DCompiler = class extends chunkZK7KX5CD_cjs.CompilerBase {
|
|
|
128
203
|
this._stateFields = /* @__PURE__ */ new Map();
|
|
129
204
|
this._fetchCalls = [];
|
|
130
205
|
this._hookCalls = [];
|
|
206
|
+
this._computedBindings = [];
|
|
131
207
|
this._options = {};
|
|
208
|
+
/** Honest mode (composition-level `@honest`): every data-bound element MUST carry
|
|
209
|
+
* `@provenance_bound` or the compiler refuses to emit it (HONEST-UNSOURCED). This is
|
|
210
|
+
* the Receipt-Bound Surface constitution — the surface cannot emit an unsourced pixel. */
|
|
211
|
+
this._honestMode = false;
|
|
212
|
+
this._verifiedViewMode = false;
|
|
213
|
+
/** Valid projection roots: composition state keys + @fetch into-slots (pre-scanned). */
|
|
214
|
+
this._projectionRoots = /* @__PURE__ */ new Set();
|
|
215
|
+
/**
|
|
216
|
+
* Verified projections collected during traversal (@verified_view v1): the machine-readable
|
|
217
|
+
* view contract that co-emits with the surface — a portable, hash-bound receipt of what
|
|
218
|
+
* every element renders, so an independent consumer can re-derive it from the ARTIFACT
|
|
219
|
+
* (not the source). Populated by resolveProjection; emitted as `export const holoViewContract`.
|
|
220
|
+
*/
|
|
221
|
+
this._collectedProjections = [];
|
|
132
222
|
}
|
|
133
223
|
// @ts-expect-error During migration
|
|
134
224
|
compile(composition, agentToken, outputPath, options) {
|
|
@@ -148,13 +238,46 @@ var Native2DCompiler = class extends chunkZK7KX5CD_cjs.CompilerBase {
|
|
|
148
238
|
this._stateFields.clear();
|
|
149
239
|
this._fetchCalls = [];
|
|
150
240
|
this._hookCalls = [];
|
|
241
|
+
this._computedBindings = [];
|
|
151
242
|
this._options = options || {};
|
|
243
|
+
this._honestMode = (composition?.traits ?? []).some((t) => t?.name === "honest");
|
|
244
|
+
this._verifiedViewMode = (composition?.traits ?? []).some((t) => t?.name === "verified_view");
|
|
152
245
|
const safeName = name.replace(/[^a-zA-Z0-9]/g, "");
|
|
153
246
|
if (composition?.state?.properties) {
|
|
154
247
|
for (const prop of composition.state.properties) {
|
|
155
248
|
this._stateFields.set(prop.key, prop.value ?? null);
|
|
156
249
|
}
|
|
157
250
|
}
|
|
251
|
+
this._projectionRoots = new Set(this._stateFields.keys());
|
|
252
|
+
this._collectedProjections = [];
|
|
253
|
+
const scanProjectionRoots = (objs) => {
|
|
254
|
+
for (const o of objs) {
|
|
255
|
+
for (const t of o.traits ?? []) {
|
|
256
|
+
if (t?.name === "fetch") {
|
|
257
|
+
const into = t.config?.into;
|
|
258
|
+
this._projectionRoots.add(typeof into === "string" && into ? into : "data");
|
|
259
|
+
}
|
|
260
|
+
if (t?.name === "each") {
|
|
261
|
+
const as = t.config?.as;
|
|
262
|
+
this._projectionRoots.add(typeof as === "string" && as ? as : "item");
|
|
263
|
+
}
|
|
264
|
+
if (t?.name === "computed") {
|
|
265
|
+
const nm = t.config?.name;
|
|
266
|
+
if (typeof nm === "string" && nm) this._projectionRoots.add(nm);
|
|
267
|
+
}
|
|
268
|
+
if (t?.name === "hook") {
|
|
269
|
+
const returns = t.config?.returns;
|
|
270
|
+
if (typeof returns === "string") {
|
|
271
|
+
for (const r of returns.split(",").map((s) => s.trim())) {
|
|
272
|
+
if (r) this._projectionRoots.add(r);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if (Array.isArray(o.children)) scanProjectionRoots(o.children);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
scanProjectionRoots(objects);
|
|
158
281
|
const jsx = objects.map((obj) => this.generateReactNode(obj)).join("\n ");
|
|
159
282
|
const imports = [];
|
|
160
283
|
const reactImports = /* @__PURE__ */ new Set();
|
|
@@ -172,6 +295,17 @@ var Native2DCompiler = class extends chunkZK7KX5CD_cjs.CompilerBase {
|
|
|
172
295
|
for (const h of this._hookCalls) {
|
|
173
296
|
imports.push(`import { ${h.name} } from '${h.import}';`);
|
|
174
297
|
}
|
|
298
|
+
const computedImports = /* @__PURE__ */ new Map();
|
|
299
|
+
for (const b of this._computedBindings) {
|
|
300
|
+
if (b.from && b.uses.length) {
|
|
301
|
+
const set = computedImports.get(b.from) || /* @__PURE__ */ new Set();
|
|
302
|
+
b.uses.forEach((u) => set.add(u));
|
|
303
|
+
computedImports.set(b.from, set);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
for (const [from, uses] of computedImports) {
|
|
307
|
+
imports.push(`import { ${[...uses].join(", ")} } from '${from}';`);
|
|
308
|
+
}
|
|
175
309
|
const stateHooks = [];
|
|
176
310
|
for (const [key, value] of this._stateFields) {
|
|
177
311
|
const capitalKey = key.charAt(0).toUpperCase() + key.slice(1);
|
|
@@ -194,25 +328,36 @@ var Native2DCompiler = class extends chunkZK7KX5CD_cjs.CompilerBase {
|
|
|
194
328
|
const hookBindings = [];
|
|
195
329
|
for (const h of this._hookCalls) {
|
|
196
330
|
const members = h.returns.split(",").map((s) => s.trim()).filter((s) => /^[A-Za-z_$][\w$]*$/.test(s));
|
|
331
|
+
const call = `${h.name}(${h.args ?? ""})`;
|
|
197
332
|
hookBindings.push(
|
|
198
|
-
members.length > 0 ? ` const { ${members.join(", ")} } = ${
|
|
333
|
+
members.length > 0 ? ` const { ${members.join(", ")} } = ${call};` : ` ${call};`
|
|
199
334
|
);
|
|
200
335
|
}
|
|
336
|
+
const computedLines = [];
|
|
337
|
+
for (const b of this._computedBindings) {
|
|
338
|
+
computedLines.push(` const ${b.name} = ${b.expr};`);
|
|
339
|
+
}
|
|
340
|
+
const viewContract = this.buildViewContract();
|
|
341
|
+
const rootAttrs = viewContract ? ` data-holo-view-contract="${viewContract.hash}"` : "";
|
|
342
|
+
const contractExport = viewContract ? `
|
|
343
|
+
|
|
344
|
+
export const holoViewContract = ${viewContract.json} as const;` : "";
|
|
201
345
|
return `${imports.join("\n")}
|
|
202
346
|
|
|
203
347
|
// @generated by HoloScript Native2DCompiler \u2014 DO NOT EDIT
|
|
204
348
|
export function ${safeName}Component() {${hookBindings.length > 0 ? "\n" + hookBindings.join("\n") : ""}
|
|
205
349
|
${stateHooks.join("\n")}
|
|
206
350
|
${fetchEffects.join("\n")}
|
|
351
|
+
${computedLines.join("\n")}
|
|
207
352
|
|
|
208
353
|
return (
|
|
209
|
-
<div className="holoscript-2d-root w-full h-full">
|
|
354
|
+
<div className="holoscript-2d-root w-full h-full"${rootAttrs}>
|
|
210
355
|
${jsx}
|
|
211
356
|
</div>
|
|
212
357
|
);
|
|
213
358
|
}
|
|
214
359
|
|
|
215
|
-
export default ${safeName}Component
|
|
360
|
+
export default ${safeName}Component;${contractExport}
|
|
216
361
|
`;
|
|
217
362
|
}
|
|
218
363
|
generateReactNode(obj) {
|
|
@@ -254,8 +399,39 @@ export default ${safeName}Component;
|
|
|
254
399
|
if (/['"`\\]/.test(importPath)) {
|
|
255
400
|
throw new Error(`Native2DCompiler @hook: invalid import path ${JSON.stringify(importPath)}`);
|
|
256
401
|
}
|
|
402
|
+
let hookArgs = "";
|
|
403
|
+
if (traits.hook.args != null) {
|
|
404
|
+
hookArgs = String(traits.hook.args);
|
|
405
|
+
if (!/^[a-zA-Z0-9_$.,(){}\[\]'"/\s*+\-%<>=?:!&|]+$/.test(hookArgs)) {
|
|
406
|
+
throw new Error(`Native2DCompiler @hook: unsafe args ${JSON.stringify(hookArgs)}`);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
257
409
|
if (!this._hookCalls.some((h) => h.name === hookName)) {
|
|
258
|
-
this._hookCalls.push({
|
|
410
|
+
this._hookCalls.push({
|
|
411
|
+
name: hookName,
|
|
412
|
+
import: importPath,
|
|
413
|
+
returns: String(traits.hook.returns || ""),
|
|
414
|
+
args: hookArgs || void 0
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
if (traits.computed?.name && traits.computed?.expr) {
|
|
419
|
+
const cname = String(traits.computed.name);
|
|
420
|
+
const expr = String(traits.computed.expr);
|
|
421
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(cname)) {
|
|
422
|
+
throw new Error(`Native2DCompiler @computed: invalid name ${JSON.stringify(cname)}`);
|
|
423
|
+
}
|
|
424
|
+
if (!/^[a-zA-Z0-9_$.,()\[\]'"/\s*+\-%<>=?:!&|]+$/.test(expr)) {
|
|
425
|
+
throw new Error(`Native2DCompiler @computed: unsafe expr ${JSON.stringify(expr)}`);
|
|
426
|
+
}
|
|
427
|
+
const from = traits.computed.from ? String(traits.computed.from) : "";
|
|
428
|
+
if (from && /['"`\\]/.test(from)) {
|
|
429
|
+
throw new Error(`Native2DCompiler @computed: invalid import path ${JSON.stringify(from)}`);
|
|
430
|
+
}
|
|
431
|
+
const usesRaw = traits.computed.uses;
|
|
432
|
+
const uses = (Array.isArray(usesRaw) ? usesRaw : usesRaw ? [usesRaw] : []).map(String).filter((u) => /^[A-Za-z_$][\w$]*$/.test(u));
|
|
433
|
+
if (!this._computedBindings.some((b) => b.name === cname)) {
|
|
434
|
+
this._computedBindings.push({ name: cname, expr, from: from || void 0, uses });
|
|
259
435
|
}
|
|
260
436
|
}
|
|
261
437
|
let tag = traits.theme?.tag || traits.panel?.tag || (typeof obj.type === "string" ? obj.type.toLowerCase() : void 0) || "div";
|
|
@@ -289,6 +465,10 @@ export default ${safeName}Component;
|
|
|
289
465
|
const styles = this.buildStyles(traits);
|
|
290
466
|
const classes = this.buildClasses(traits);
|
|
291
467
|
let props = ``;
|
|
468
|
+
const prov = this.resolveProvenance(traits, obj);
|
|
469
|
+
if (prov) props += prov.propsStr;
|
|
470
|
+
const proj = this.resolveProjection(traits, obj);
|
|
471
|
+
if (proj) props += proj;
|
|
292
472
|
if (traits.theme?.className) {
|
|
293
473
|
classes.push(traits.theme.className);
|
|
294
474
|
}
|
|
@@ -311,10 +491,15 @@ export default ${safeName}Component;
|
|
|
311
491
|
props += ` style={${JSON.stringify(combinedStyles)}}`;
|
|
312
492
|
}
|
|
313
493
|
if (tierExpr) {
|
|
314
|
-
const
|
|
494
|
+
const tierFamilies = this.tierColorFamilies(traits);
|
|
495
|
+
const cleaned = this.stripColorFamilies(
|
|
496
|
+
this.resolveColorConflicts(classes.join(" ")),
|
|
497
|
+
tierFamilies
|
|
498
|
+
);
|
|
499
|
+
const staticPrefix = cleaned ? `${cleaned} ` : "";
|
|
315
500
|
props += ` className={\`${staticPrefix}\${${tierExpr}}\`}`;
|
|
316
501
|
} else if (classes.length > 0) {
|
|
317
|
-
props += ` className="${classes.join(" ")}"`;
|
|
502
|
+
props += ` className="${this.resolveColorConflicts(classes.join(" "))}"`;
|
|
318
503
|
}
|
|
319
504
|
if (traits.theme?.attributes) {
|
|
320
505
|
try {
|
|
@@ -365,7 +550,10 @@ export default ${safeName}Component;
|
|
|
365
550
|
if (stateVar) {
|
|
366
551
|
const setter = `set${stateVar.charAt(0).toUpperCase()}${stateVar.slice(1)}`;
|
|
367
552
|
const valueExpr = subPath ? `${stateVar}.${subPath}` : stateVar;
|
|
368
|
-
|
|
553
|
+
const inputType = String(traits.input?.type || "").toLowerCase();
|
|
554
|
+
const numeric = traits.model.cast === "number" || inputType === "range" || inputType === "number";
|
|
555
|
+
const getter = numeric ? "Number(e.target.value)" : "e.target.value";
|
|
556
|
+
props += ` value={${valueExpr}} onChange={(e) => ${setter}(${getter})}`;
|
|
369
557
|
}
|
|
370
558
|
}
|
|
371
559
|
if (traits.image?.src) props += ` src="${traits.image.src}"`;
|
|
@@ -374,6 +562,9 @@ export default ${safeName}Component;
|
|
|
374
562
|
if (traits.input?.placeholder) props += ` placeholder="${traits.input.placeholder}"`;
|
|
375
563
|
if (traits.input?.type) props += ` type="${traits.input.type}"`;
|
|
376
564
|
if (traits.input?.required) props += ` required`;
|
|
565
|
+
if (traits.input?.min != null) props += ` min="${String(traits.input.min)}"`;
|
|
566
|
+
if (traits.input?.max != null) props += ` max="${String(traits.input.max)}"`;
|
|
567
|
+
if (traits.input?.step != null) props += ` step="${String(traits.input.step)}"`;
|
|
377
568
|
if (traits.button?.type) props += ` type="${traits.button.type}"`;
|
|
378
569
|
const childrenMarkup = (obj.children || obj.objects || []).map((child) => this.generateReactNode(child)).join("\n");
|
|
379
570
|
const content = traits.text?.content || traits.button?.content || traits.link?.content || traits.icon?.name;
|
|
@@ -383,12 +574,23 @@ export default ${safeName}Component;
|
|
|
383
574
|
} else if (content) {
|
|
384
575
|
safeContent = `{\`${content.replace(/`/g, "\\`").replace(/\$/g, "\\$")}\`}`;
|
|
385
576
|
}
|
|
577
|
+
if (prov && safeContent && _Native2DCompiler.PROVENANCE_GLYPH[prov.cls]) {
|
|
578
|
+
safeContent += `<sup className="holo-prov-mark" title=${JSON.stringify(
|
|
579
|
+
`provenance: ${prov.cls}`
|
|
580
|
+
)}>${_Native2DCompiler.PROVENANCE_GLYPH[prov.cls]}</sup>`;
|
|
581
|
+
}
|
|
386
582
|
const each = this.buildEachIterator(traits);
|
|
387
583
|
const keyProp = each ? ` key={i}` : "";
|
|
388
584
|
let element;
|
|
389
585
|
if (tag === "style") {
|
|
390
586
|
const escapedStyle = (content || "").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
391
587
|
element = `<style${keyProp} dangerouslySetInnerHTML={{ __html: \`${escapedStyle}\` }} />`;
|
|
588
|
+
} else if (traits.sparkline?.state) {
|
|
589
|
+
element = this.buildSparklineElement(traits, props, keyProp);
|
|
590
|
+
} else if (traits.chart?.state) {
|
|
591
|
+
element = this.buildChartElement(traits, props, keyProp);
|
|
592
|
+
} else if (traits.live_proof?.claim) {
|
|
593
|
+
element = this.buildLiveProofElement(traits, keyProp);
|
|
392
594
|
} else if (tag === "img" || tag === "input") {
|
|
393
595
|
element = `<${tag}${props}${keyProp} />`;
|
|
394
596
|
} else {
|
|
@@ -895,7 +1097,13 @@ export default ${safeName}Component;
|
|
|
895
1097
|
* : (snap?.fps ?? 0) >= 30 ? "text-amber-400"
|
|
896
1098
|
* : "text-red-400"
|
|
897
1099
|
*
|
|
898
|
-
* Each tier may specify `gte` (>=), `gt` (>), `lte` (<=), and/or `lt` (<)
|
|
1100
|
+
* Each tier may specify `gte` (>=), `gt` (>), `lte` (<=), and/or `lt` (<) for
|
|
1101
|
+
* numeric thresholds, OR `eq`/`neq` for exact-match categories (e.g. a
|
|
1102
|
+
* security audit outcome: `{ eq: "denied", className: "text-red-400" }`).
|
|
1103
|
+
* `eq`/`neq` accept a string or a number; string operands pass the same
|
|
1104
|
+
* injection guard as `@when eq` and are emitted via JSON.stringify. When any
|
|
1105
|
+
* tier compares strings, the bound value is coerced to `''` (not `0`) so the
|
|
1106
|
+
* cascade stays total before state loads without mis-coercing a string to 0.
|
|
899
1107
|
* Conditions on one tier are AND-ed. A tier with no bounds is the
|
|
900
1108
|
* unconditional fallback (its className is the trailing `:` branch). If no
|
|
901
1109
|
* tier is unconditional, an empty-string fallback is appended so the
|
|
@@ -909,8 +1117,11 @@ export default ${safeName}Component;
|
|
|
909
1117
|
String(bind.path || ""),
|
|
910
1118
|
"@bind tiers"
|
|
911
1119
|
);
|
|
912
|
-
const valueRef = `(${baseExpr} ?? 0)`;
|
|
913
1120
|
const tiers = bind.tiers;
|
|
1121
|
+
const usesStringCompare = tiers.some(
|
|
1122
|
+
(t) => typeof t.eq === "string" || typeof t.neq === "string"
|
|
1123
|
+
);
|
|
1124
|
+
const valueRef = usesStringCompare ? `(${baseExpr} ?? '')` : `(${baseExpr} ?? 0)`;
|
|
914
1125
|
const branches = [];
|
|
915
1126
|
for (const tier of tiers) {
|
|
916
1127
|
const className = typeof tier.className === "string" ? tier.className : "";
|
|
@@ -919,6 +1130,16 @@ export default ${safeName}Component;
|
|
|
919
1130
|
if (typeof tier.gt === "number") conditions.push(`${valueRef} > ${tier.gt}`);
|
|
920
1131
|
if (typeof tier.lte === "number") conditions.push(`${valueRef} <= ${tier.lte}`);
|
|
921
1132
|
if (typeof tier.lt === "number") conditions.push(`${valueRef} < ${tier.lt}`);
|
|
1133
|
+
if (typeof tier.eq === "number") conditions.push(`${valueRef} === ${tier.eq}`);
|
|
1134
|
+
else if (typeof tier.eq === "string")
|
|
1135
|
+
conditions.push(
|
|
1136
|
+
`${valueRef} === ${JSON.stringify(this.assertSafeLiteral(tier.eq, "@bind tier eq"))}`
|
|
1137
|
+
);
|
|
1138
|
+
if (typeof tier.neq === "number") conditions.push(`${valueRef} !== ${tier.neq}`);
|
|
1139
|
+
else if (typeof tier.neq === "string")
|
|
1140
|
+
conditions.push(
|
|
1141
|
+
`${valueRef} !== ${JSON.stringify(this.assertSafeLiteral(tier.neq, "@bind tier neq"))}`
|
|
1142
|
+
);
|
|
922
1143
|
branches.push({
|
|
923
1144
|
condition: conditions.length > 0 ? conditions.join(" && ") : null,
|
|
924
1145
|
className
|
|
@@ -941,6 +1162,309 @@ export default ${safeName}Component;
|
|
|
941
1162
|
fallback
|
|
942
1163
|
);
|
|
943
1164
|
}
|
|
1165
|
+
/**
|
|
1166
|
+
* @sparkline: render a bound numeric array as an inline SVG polyline — the
|
|
1167
|
+
* smallest slice of native data-viz (no axes/legend). The points are computed
|
|
1168
|
+
* at render time from the array, normalized into a fixed viewBox
|
|
1169
|
+
* (`width`×`height`, default 100×30) with `preserveAspectRatio="none"` so the
|
|
1170
|
+
* SVG fills its CSS box. `state`(+optional `path`) is the array; `valueKey`
|
|
1171
|
+
* reads a number out of object items (e.g. items `{sizeKb}` → valueKey
|
|
1172
|
+
* "sizeKb"); `stroke` is a themeable line-color class (default
|
|
1173
|
+
* `stroke-studio-accent`). Container styling (`@theme`/`@layout`) rides in on
|
|
1174
|
+
* `props`. Dependency-free, injection-safe: identifiers are validated and the
|
|
1175
|
+
* points expression uses string concatenation (no inner template literals).
|
|
1176
|
+
*/
|
|
1177
|
+
buildSparklineElement(traits, props, keyProp) {
|
|
1178
|
+
const sp = traits.sparkline;
|
|
1179
|
+
const state = this.assertSafeDotPath(String(sp.state), "@sparkline state");
|
|
1180
|
+
const path = sp.path ? String(sp.path) : "";
|
|
1181
|
+
if (path) this.assertSafeDotPath(path, "@sparkline path");
|
|
1182
|
+
const arrayRef = this.buildStatePathExpr(state, path, "@sparkline");
|
|
1183
|
+
const W = Number.isInteger(sp.width) && sp.width > 0 ? sp.width : 100;
|
|
1184
|
+
const H = Number.isInteger(sp.height) && sp.height > 0 ? sp.height : 30;
|
|
1185
|
+
let valueExpr = "d";
|
|
1186
|
+
if (sp.valueKey != null) {
|
|
1187
|
+
const vk = String(sp.valueKey);
|
|
1188
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(vk)) {
|
|
1189
|
+
throw new Error(`Native2DCompiler @sparkline: invalid valueKey ${JSON.stringify(vk)}`);
|
|
1190
|
+
}
|
|
1191
|
+
valueExpr = `d?.${vk}`;
|
|
1192
|
+
}
|
|
1193
|
+
const stroke = typeof sp.stroke === "string" ? this.assertSafeLiteral(sp.stroke, "@sparkline stroke") : "stroke-studio-accent";
|
|
1194
|
+
const strokeWidth = /^[0-9]+(\.[0-9]+)?$/.test(String(sp.strokeWidth ?? "")) ? String(sp.strokeWidth) : "1.5";
|
|
1195
|
+
const points = `((__a) => { const __v = (__a ?? []).map((d) => Number(${valueExpr}) || 0); if (!__v.length) return ''; const __mn = Math.min(...__v), __mx = Math.max(...__v), __r = (__mx - __mn) || 1, __sx = __v.length > 1 ? ${W} / (__v.length - 1) : 0; return __v.map((y, i) => (i * __sx).toFixed(2) + ',' + (${H} - ((y - __mn) / __r) * ${H}).toFixed(2)).join(' '); })(${arrayRef})`;
|
|
1196
|
+
return `<svg${props}${keyProp} data-baseline="min" viewBox="0 0 ${W} ${H}" preserveAspectRatio="none">
|
|
1197
|
+
<polyline fill="none" className="${stroke}" strokeWidth="${strokeWidth}" points={${points}} />
|
|
1198
|
+
</svg>`;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* @chart: the fuller native data-viz primitive — a bar / line / area chart with
|
|
1202
|
+
* a baseline axis and (bar) crisp category labels. Unlike @sparkline (fill-the-box,
|
|
1203
|
+
* no axes), @chart uses a fixed-aspect viewBox with margins so `<text>` labels stay
|
|
1204
|
+
* undistorted. Geometry is computed at render time from the bound array; a bar chart
|
|
1205
|
+
* emits one `<rect>` per item, line/area emit a `<polyline>`/`<polygon>` over the
|
|
1206
|
+
* plot region. Injection-safe: `state`/`path`/`valueKey`/`labelKey` are validated
|
|
1207
|
+
* identifiers/dot-paths, `stroke`/`fill` pass the literal guard, and the point math
|
|
1208
|
+
* uses string concatenation (no inner template literals).
|
|
1209
|
+
*
|
|
1210
|
+
* `@chart { kind: "bar"|"line"|"area", state, path?, valueKey?, labelKey?,
|
|
1211
|
+
* width?, height?, stroke?, fill? }`
|
|
1212
|
+
*/
|
|
1213
|
+
buildChartElement(traits, props, keyProp) {
|
|
1214
|
+
const ch = traits.chart;
|
|
1215
|
+
const kind = ch.kind === "line" || ch.kind === "area" ? ch.kind : "bar";
|
|
1216
|
+
const state = this.assertSafeDotPath(String(ch.state), "@chart state");
|
|
1217
|
+
const path = ch.path ? String(ch.path) : "";
|
|
1218
|
+
if (path) this.assertSafeDotPath(path, "@chart path");
|
|
1219
|
+
const arrayRef = this.buildStatePathExpr(state, path, "@chart");
|
|
1220
|
+
let valueExpr = "d";
|
|
1221
|
+
if (ch.valueKey != null) {
|
|
1222
|
+
const vk = String(ch.valueKey);
|
|
1223
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(vk)) {
|
|
1224
|
+
throw new Error(`Native2DCompiler @chart: invalid valueKey ${JSON.stringify(vk)}`);
|
|
1225
|
+
}
|
|
1226
|
+
valueExpr = `d?.${vk}`;
|
|
1227
|
+
}
|
|
1228
|
+
let labelKey = "";
|
|
1229
|
+
if (ch.labelKey != null) {
|
|
1230
|
+
labelKey = String(ch.labelKey);
|
|
1231
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(labelKey)) {
|
|
1232
|
+
throw new Error(`Native2DCompiler @chart: invalid labelKey ${JSON.stringify(labelKey)}`);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
let classKey = "";
|
|
1236
|
+
if (ch.classKey != null) {
|
|
1237
|
+
classKey = String(ch.classKey);
|
|
1238
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(classKey)) {
|
|
1239
|
+
throw new Error(`Native2DCompiler @chart: invalid classKey ${JSON.stringify(classKey)}`);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
const W = Number.isInteger(ch.width) && ch.width > 0 ? ch.width : 280;
|
|
1243
|
+
const H = Number.isInteger(ch.height) && ch.height > 0 ? ch.height : 140;
|
|
1244
|
+
const stroke = typeof ch.stroke === "string" ? this.assertSafeLiteral(ch.stroke, "@chart stroke") : "stroke-studio-accent";
|
|
1245
|
+
const fill = typeof ch.fill === "string" ? this.assertSafeLiteral(ch.fill, "@chart fill") : "fill-studio-accent";
|
|
1246
|
+
const PX = 6;
|
|
1247
|
+
const PT = 8;
|
|
1248
|
+
const PB = labelKey && kind === "bar" ? 16 : 6;
|
|
1249
|
+
const plotW = W - 2 * PX;
|
|
1250
|
+
const plotH = H - PT - PB;
|
|
1251
|
+
const baselineY = H - PB;
|
|
1252
|
+
const baseline = `<line x1="${PX}" y1="${baselineY}" x2="${W - PX}" y2="${baselineY}" className="stroke-studio-border" strokeWidth="0.5" />`;
|
|
1253
|
+
const provDefs = classKey ? `<defs><pattern id="holo-hatch" width="4" height="4" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><line x1="0" y1="0" x2="0" y2="4" className="stroke-studio-accent" strokeWidth="1.2" /></pattern><pattern id="holo-dots" width="3" height="3" patternUnits="userSpaceOnUse"><circle cx="1.5" cy="1.5" r="0.6" className="fill-studio-accent" /></pattern></defs>` : "";
|
|
1254
|
+
let body;
|
|
1255
|
+
if (kind === "bar") {
|
|
1256
|
+
const label = labelKey ? `<text x={__x + __bw / 2} y={${H - 4}} textAnchor="middle" className="fill-studio-muted" fontSize="6">{String(d?.${labelKey} ?? '')}</text>` : "";
|
|
1257
|
+
const provFill = classKey ? ` fill={d?.${classKey} === "inferred" ? "url(#holo-hatch)" : d?.${classKey} === "generative" ? "url(#holo-dots)" : undefined} data-provenance-class={String(d?.${classKey} ?? "")}` : "";
|
|
1258
|
+
body = `{((__a) => { const __d = (__a ?? []); const __v = __d.map((d) => Number(${valueExpr}) || 0); const __max = Math.max(1, ...__v); const __n = __d.length || 1; const __slot = ${plotW} / __n; const __bw = Math.max(1, Math.min(__slot * 0.62, __slot - 1)); return __d.map((d, i) => { const __h = Math.max(0, Number(${valueExpr}) || 0) / __max * ${plotH}; const __x = ${PX} + i * __slot + (__slot - __bw) / 2; const __y = ${baselineY} - __h; return (<g key={i}><rect x={__x} y={__y} width={__bw} height={__h} className="${fill}"${provFill} rx="0.5" />${label}</g>); }); })(${arrayRef})}`;
|
|
1259
|
+
} else {
|
|
1260
|
+
const norm = this._honestMode ? `const __mn = 0, __r = Math.max(1, ...__v), ` : `const __mn = Math.min(...__v), __mx = Math.max(...__v), __r = (__mx - __mn) || 1, `;
|
|
1261
|
+
const yExpr = this._honestMode ? "Math.max(0, y)" : "y";
|
|
1262
|
+
const pts = `((__a) => { const __v = (__a ?? []).map((d) => Number(${valueExpr}) || 0); if (!__v.length) return ''; ` + norm + `__sx = __v.length > 1 ? ${plotW} / (__v.length - 1) : 0; return __v.map((y, i) => (${PX} + i * __sx).toFixed(2) + ',' + (${baselineY} - ((${yExpr} - __mn) / __r) * ${plotH}).toFixed(2)).join(' '); })(${arrayRef})`;
|
|
1263
|
+
const line = `<polyline fill="none" className="${stroke}" strokeWidth="1.5" points={${pts}} />`;
|
|
1264
|
+
if (kind === "area") {
|
|
1265
|
+
const areaPts = `((__p) => __p ? __p + ' ' + ${W - PX} + ',' + ${baselineY} + ' ' + ${PX} + ',' + ${baselineY} : '')(${pts})`;
|
|
1266
|
+
body = `<polygon className="${fill}" fillOpacity="0.25" points={${areaPts}} />
|
|
1267
|
+
${line}`;
|
|
1268
|
+
} else {
|
|
1269
|
+
body = line;
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
const baselineAttr = ` data-baseline="${kind === "bar" || this._honestMode ? "zero" : "min"}"`;
|
|
1273
|
+
const clampedAttr = kind === "bar" || this._honestMode ? ` data-clamped={String(((__a) => (__a ?? []).some((d) => (Number(${valueExpr}) || 0) < 0))(${arrayRef}))}` : "";
|
|
1274
|
+
return `<svg${props}${keyProp}${baselineAttr}${clampedAttr} viewBox="0 0 ${W} ${H}">
|
|
1275
|
+
${provDefs}
|
|
1276
|
+
${baseline}
|
|
1277
|
+
${body}
|
|
1278
|
+
</svg>`;
|
|
1279
|
+
}
|
|
1280
|
+
/**
|
|
1281
|
+
* Receipt-Bound Surface enforcement + emission (@honest / @provenance_bound).
|
|
1282
|
+
*
|
|
1283
|
+
* A "data-bound" element (one that renders a value from state via @bind/@chart/
|
|
1284
|
+
* @sparkline/@model) must, in honest mode, carry `@provenance_bound {source, class}`
|
|
1285
|
+
* — otherwise the compiler THROWS (HONEST-UNSOURCED): the surface cannot emit an
|
|
1286
|
+
* unsourced pixel. When provenance IS present, this returns the inline receipt
|
|
1287
|
+
* attributes (`data-holo-provenance` = a machine-readable {source,class,confidence}
|
|
1288
|
+
* an independent consumer can re-derive against, `data-provenance-class`) plus the
|
|
1289
|
+
* class so the caller can add a visible honesty glyph to text values. An unknown
|
|
1290
|
+
* class is rejected (fail toward lower trust — never silently upgraded to measured).
|
|
1291
|
+
* Returns null when the element is not provenance-bound (no attributes, no glyph).
|
|
1292
|
+
*/
|
|
1293
|
+
/**
|
|
1294
|
+
* @verified_view / @projects — the admission gate for agent-authored
|
|
1295
|
+
* surfaces (slice 4 of the Receipt-Bound Surface, honest v0).
|
|
1296
|
+
*
|
|
1297
|
+
* `@projects { node: "stats.sessions" }` is the AUTHOR'S CLAIM of which
|
|
1298
|
+
* world-model node an element renders. This compiler owns the actual data
|
|
1299
|
+
* path (@bind/@chart/@sparkline/@model → state[.path]), so the claim is
|
|
1300
|
+
* verified as compiler-owned DATA-FLOW — the two sides are independently
|
|
1301
|
+
* authored, which is exactly what the shallow "source is non-empty" version
|
|
1302
|
+
* (rejected as theater in the slice-4 warning) lacks. Checks, all fatal
|
|
1303
|
+
* (VIEW-UNGROUNDED):
|
|
1304
|
+
* 1. a declared projection must MATCH the element's actual bound path —
|
|
1305
|
+
* "the agent says sessions but wired revenue" fails to compile;
|
|
1306
|
+
* 2. a projection must root in a REAL node (composition state or a @fetch
|
|
1307
|
+
* into-slot) — a hallucinated node fails to compile;
|
|
1308
|
+
* 3. a projection on an element with NO data binding is a lie by
|
|
1309
|
+
* construction — fails to compile;
|
|
1310
|
+
* 4. under composition-level `@verified_view`, every data-bound element
|
|
1311
|
+
* MUST declare a projection (mirrors HONEST-UNSOURCED).
|
|
1312
|
+
* Checks 1–3 are always-on (a lying receipt is worse than none); check 4 is
|
|
1313
|
+
* the mode. Verified elements emit `data-holo-projects` so independent
|
|
1314
|
+
* consumers can re-check the claim against the artifact. HONEST SCOPE:
|
|
1315
|
+
* runtime re-derivation against a live graph.holo world model (the full
|
|
1316
|
+
* research-spec `projects:` semantics + SimulationContract co-emission) is
|
|
1317
|
+
* v1+ — this v0 proves what the compiler can prove, statically.
|
|
1318
|
+
*/
|
|
1319
|
+
resolveProjection(traits, obj) {
|
|
1320
|
+
const nm = () => String(obj.name ?? "element");
|
|
1321
|
+
const src = traits.bind?.state ? { state: traits.bind.state, path: traits.bind.path } : traits.chart?.state ? { state: traits.chart.state, path: traits.chart.path } : traits.sparkline?.state ? { state: traits.sparkline.state, path: traits.sparkline.path } : traits.model?.state ? { state: traits.model.state, path: traits.model.path } : (
|
|
1322
|
+
// @each renders a LIST from state — the element's provenance is the bound array.
|
|
1323
|
+
traits.each?.state ? { state: traits.each.state, path: traits.each.path } : null
|
|
1324
|
+
);
|
|
1325
|
+
const actualPath = src ? `${String(src.state)}${src.path ? "." + String(src.path) : ""}` : null;
|
|
1326
|
+
const pj = traits.projects;
|
|
1327
|
+
if (!pj) {
|
|
1328
|
+
if (this._verifiedViewMode && actualPath) {
|
|
1329
|
+
throw new Error(
|
|
1330
|
+
`Native2DCompiler @verified_view: VIEW-UNGROUNDED \u2014 "${nm()}" renders data without @projects {node}; an agent-authored surface ships only if every element declares what it renders`
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
return null;
|
|
1334
|
+
}
|
|
1335
|
+
const node = this.assertSafeDotPath(String(pj.node ?? ""), "@projects node");
|
|
1336
|
+
if (!actualPath) {
|
|
1337
|
+
throw new Error(
|
|
1338
|
+
`Native2DCompiler @projects: VIEW-UNGROUNDED \u2014 "${nm()}" claims to project "${node}" but has no data binding at all; the claim is a lie by construction`
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1341
|
+
if (node !== actualPath) {
|
|
1342
|
+
throw new Error(
|
|
1343
|
+
`Native2DCompiler @projects: VIEW-UNGROUNDED \u2014 "${nm()}" claims to project "${node}" but is actually bound to "${actualPath}"; the surface would lie about its source`
|
|
1344
|
+
);
|
|
1345
|
+
}
|
|
1346
|
+
const root = node.split(".")[0];
|
|
1347
|
+
if (!this._projectionRoots.has(root)) {
|
|
1348
|
+
throw new Error(
|
|
1349
|
+
`Native2DCompiler @projects: VIEW-UNGROUNDED \u2014 "${nm()}" projects "${node}" but no state node "${root}" exists (hallucinated node; declared state keys and @fetch slots: ${[...this._projectionRoots].join(", ") || "none"})`
|
|
1350
|
+
);
|
|
1351
|
+
}
|
|
1352
|
+
const b = traits.bind;
|
|
1353
|
+
const identity = !!b?.state && b.precision === void 0 && b.prefix === void 0 && b.suffix === void 0 && !b.tiers && !traits.chart && !traits.sparkline && !traits.each && !traits.model;
|
|
1354
|
+
let transform;
|
|
1355
|
+
if (b?.state && !traits.chart && !traits.sparkline && !traits.each && !traits.model && (b.precision !== void 0 || b.prefix !== void 0 || b.suffix !== void 0)) {
|
|
1356
|
+
transform = {};
|
|
1357
|
+
if (typeof b.precision === "number") transform.precision = b.precision;
|
|
1358
|
+
if (b.prefix !== void 0) transform.prefix = String(b.prefix);
|
|
1359
|
+
if (b.suffix !== void 0) transform.suffix = String(b.suffix);
|
|
1360
|
+
}
|
|
1361
|
+
let entity;
|
|
1362
|
+
if (pj.entity !== void 0) {
|
|
1363
|
+
const e = String(pj.entity);
|
|
1364
|
+
if (!/^[A-Za-z0-9_.:-]+$/.test(e)) {
|
|
1365
|
+
throw new Error(
|
|
1366
|
+
`Native2DCompiler @projects: invalid entity id ${JSON.stringify(e)} on "${nm()}" (allowed: alphanumerics and . : _ -)`
|
|
1367
|
+
);
|
|
1368
|
+
}
|
|
1369
|
+
entity = e;
|
|
1370
|
+
}
|
|
1371
|
+
this._collectedProjections.push({
|
|
1372
|
+
element: nm(),
|
|
1373
|
+
node,
|
|
1374
|
+
...entity ? { entity } : {},
|
|
1375
|
+
identity,
|
|
1376
|
+
...transform ? { transform } : {}
|
|
1377
|
+
});
|
|
1378
|
+
return ` data-holo-projects="${node}"`;
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* @verified_view v1 — build the co-emitted view contract: a portable, sha256-bound JSON
|
|
1382
|
+
* receipt of every verified projection plus the valid state roots. The contract travels
|
|
1383
|
+
* WITH the compiled artifact (`export const holoViewContract` + a `data-holo-view-contract`
|
|
1384
|
+
* hash on the root), so an independent consumer re-derives the projection set from the
|
|
1385
|
+
* emitted `data-holo-projects` attributes and checks it against this contract — the two
|
|
1386
|
+
* emission paths cannot silently drift, and the surface's honesty becomes one verifiable
|
|
1387
|
+
* receipt instead of N scattered attributes (W.772). Returns null outside @verified_view
|
|
1388
|
+
* mode (un-gated surfaces carry no contract). Canonical: projections sorted by
|
|
1389
|
+
* (element, node) and roots sorted, so the hash is stable across traversal order.
|
|
1390
|
+
*
|
|
1391
|
+
* NOTE (v1 scope): this makes the projection contract portable and independently
|
|
1392
|
+
* re-checkable from the ARTIFACT — the foundation for runtime re-derivation. Verifying the
|
|
1393
|
+
* bound value against a LIVE graph.holo world model at runtime is the deeper v1 still to be
|
|
1394
|
+
* designed.
|
|
1395
|
+
*/
|
|
1396
|
+
buildViewContract() {
|
|
1397
|
+
if (!this._verifiedViewMode) return null;
|
|
1398
|
+
const projections = [...this._collectedProjections].sort(
|
|
1399
|
+
(a, b) => a.element === b.element ? a.node.localeCompare(b.node) : a.element.localeCompare(b.element)
|
|
1400
|
+
);
|
|
1401
|
+
const stateRoots = [...this._projectionRoots].sort();
|
|
1402
|
+
const body = { version: _Native2DCompiler.VIEW_CONTRACT_VERSION, projections, stateRoots };
|
|
1403
|
+
const hash = crypto.createHash("sha256").update(JSON.stringify(body)).digest("hex");
|
|
1404
|
+
return { json: JSON.stringify({ ...body, contractHash: hash }), hash };
|
|
1405
|
+
}
|
|
1406
|
+
resolveProvenance(traits, obj) {
|
|
1407
|
+
const dataBound = !!(traits.bind?.state || traits.chart?.state && !traits.chart?.classKey || traits.sparkline?.state || traits.model);
|
|
1408
|
+
const pb = traits.provenance_bound;
|
|
1409
|
+
if (this._honestMode && dataBound && !pb) {
|
|
1410
|
+
const nm = String(obj.name ?? "element");
|
|
1411
|
+
throw new Error(
|
|
1412
|
+
`Native2DCompiler @honest: HONEST-UNSOURCED \u2014 "${nm}" renders data without @provenance_bound {source, class}; the surface cannot emit an unsourced pixel`
|
|
1413
|
+
);
|
|
1414
|
+
}
|
|
1415
|
+
if (!pb) return null;
|
|
1416
|
+
const cls = String(pb.class ?? "");
|
|
1417
|
+
if (!_Native2DCompiler.PROVENANCE_CLASSES.has(cls)) {
|
|
1418
|
+
throw new Error(
|
|
1419
|
+
`Native2DCompiler @provenance_bound: invalid class ${JSON.stringify(cls)} \u2014 expected measured|derived|inferred|generative (unknown classes fail toward lower trust, never default to measured)`
|
|
1420
|
+
);
|
|
1421
|
+
}
|
|
1422
|
+
const source = this.assertSafeLiteral(String(pb.source ?? ""), "@provenance_bound source");
|
|
1423
|
+
const receipt = { source, class: cls };
|
|
1424
|
+
if (pb.confidence != null) {
|
|
1425
|
+
const c = Number(pb.confidence);
|
|
1426
|
+
if (Number.isFinite(c) && c >= 0 && c <= 1) receipt.confidence = c;
|
|
1427
|
+
}
|
|
1428
|
+
const propsStr = ` data-holo-provenance='${JSON.stringify(receipt)}' data-provenance-class="${cls}"`;
|
|
1429
|
+
return { propsStr, cls };
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* @live_proof: the falsifiable surface — the receipt is load-bearing RENDER STATE.
|
|
1433
|
+
*
|
|
1434
|
+
* `@live_proof { claim, label? }` declares a boolean claim over state (a theorem the
|
|
1435
|
+
* element asserts). It compiles to a self-styled verdict badge whose colour + text
|
|
1436
|
+
* FLIP live as the claim breaks: `✓ <label> holds` (green) vs `✗ <label> FALSIFIED`
|
|
1437
|
+
* (red). Because the claim re-evaluates on every render, dragging a bound parameter
|
|
1438
|
+
* (via a sibling @model slider) past the point where the theorem fails flips the
|
|
1439
|
+
* badge in-band — FALSIFIED is a render state, not a console log.
|
|
1440
|
+
*
|
|
1441
|
+
* DISCIPLINE (W.767/W.769): the claim must re-derive from INDEPENDENT state fields
|
|
1442
|
+
* (e.g. `capacity >= load * factor`), never re-read the displayed value — a
|
|
1443
|
+
* self-referential claim proves nothing. The compiler cannot enforce independence,
|
|
1444
|
+
* but the emitted `data-proof-claim` makes the predicate auditable. The claim is
|
|
1445
|
+
* injection-safe (same char-class as @computed; no backticks/semicolons).
|
|
1446
|
+
*
|
|
1447
|
+
* HONESTY LABEL (@verified_view v1 groundwork): the emitted `data-proof-state` re-runs the
|
|
1448
|
+
* SAME `cond` the badge renders from, so today it proves DISPLAY-FAITHFULNESS (the badge
|
|
1449
|
+
* matches its own formula), NOT independently-verified TRUTH of the claim. We refuse to let
|
|
1450
|
+
* that masquerade — `data-proof-independence="self-referential"` marks it so no consumer (or
|
|
1451
|
+
* the moat's own claims) mistakes it for a real proof. A v1 runtime verifier that re-derives
|
|
1452
|
+
* the claim's inputs through a path the render did not author (an external state store or a
|
|
1453
|
+
* solver/StateAuthority oracle) flips this to `"verified"`. Until that oracle exists, honest
|
|
1454
|
+
* labeling is the only non-theatre option (see research/2026-07-10_verified-view-v1-design.md).
|
|
1455
|
+
*/
|
|
1456
|
+
buildLiveProofElement(traits, keyProp) {
|
|
1457
|
+
const lp = traits.live_proof;
|
|
1458
|
+
const claim = String(lp.claim ?? "");
|
|
1459
|
+
if (!claim.trim() || !/^[a-zA-Z0-9_$.,()\[\]'"/\s*+\-%<>=?:!&|]+$/.test(claim)) {
|
|
1460
|
+
throw new Error(`Native2DCompiler @live_proof: unsafe or empty claim ${JSON.stringify(claim)}`);
|
|
1461
|
+
}
|
|
1462
|
+
const label = lp.label != null ? this.assertSafeLiteral(String(lp.label), "@live_proof label") : "Claim";
|
|
1463
|
+
const cond = `(${claim})`;
|
|
1464
|
+
return `<div${keyProp} data-proof-claim={${JSON.stringify(claim)}} data-proof-independence="self-referential" data-proof-state={${cond} ? "pass" : "falsified"} className={\`rounded-md p-2 text-xs font-semibold \${${cond} ? "bg-studio-success/10 text-studio-success" : "bg-studio-error/10 text-studio-error"}\`}>
|
|
1465
|
+
{${cond} ? "\u2713 ${label} holds" : "\u2717 ${label} FALSIFIED"}
|
|
1466
|
+
</div>`;
|
|
1467
|
+
}
|
|
944
1468
|
buildHTMLBindAttributes(traits, staticClassName) {
|
|
945
1469
|
const bind = traits.bind;
|
|
946
1470
|
if (!bind?.state) return "";
|
|
@@ -1196,6 +1720,78 @@ export default ${safeName}Component;
|
|
|
1196
1720
|
}
|
|
1197
1721
|
return styles;
|
|
1198
1722
|
}
|
|
1723
|
+
/**
|
|
1724
|
+
* Resolve conflicting Tailwind COLOR utilities in a STATIC class string, keeping the LAST
|
|
1725
|
+
* of each color family. A node's @theme className is appended AFTER the variant defaults
|
|
1726
|
+
* (buildClasses), so this lets an authored token color win over a hardcoded default color
|
|
1727
|
+
* (e.g. @theme `text-studio-muted` overrides the caption default `text-gray-500`) — which
|
|
1728
|
+
* class actually wins otherwise depends on Tailwind's CSS emission order, not the class
|
|
1729
|
+
* attribute, so the default's raw color leaks unpredictably. Only color families are deduped
|
|
1730
|
+
* (text/bg/border/ring/…, incl. variant prefixes like hover:/focus:); sizes, spacing, and
|
|
1731
|
+
* layout are untouched, and text-<size> / border-<width> / ring-<width> are never colors.
|
|
1732
|
+
*/
|
|
1733
|
+
/**
|
|
1734
|
+
* The Tailwind COLOR family a token belongs to (incl. variant prefixes like
|
|
1735
|
+
* hover:/focus:), or null for a non-color token. Shared by conflict-resolution
|
|
1736
|
+
* and tier-family stripping. text-<size> / text-<align> / border|ring|divide-<width>
|
|
1737
|
+
* and arbitrary values ([10px], [#fff]) are NOT colors.
|
|
1738
|
+
*/
|
|
1739
|
+
colorFamilyKey(t) {
|
|
1740
|
+
const m = t.match(
|
|
1741
|
+
/^((?:[a-z-]+:)*)(text|bg|border|ring|ring-offset|divide|accent|fill|stroke|placeholder|caret|decoration|from|to|via)-(.+)$/
|
|
1742
|
+
);
|
|
1743
|
+
if (!m) return null;
|
|
1744
|
+
const [, variant, prop, rest] = m;
|
|
1745
|
+
if (rest.startsWith("[")) return null;
|
|
1746
|
+
if (prop === "text") {
|
|
1747
|
+
if (_Native2DCompiler.TEXT_SIZE_TOKENS.has(`text-${rest}`)) return null;
|
|
1748
|
+
if (["left", "center", "right", "justify", "start", "end"].includes(rest)) return null;
|
|
1749
|
+
}
|
|
1750
|
+
if (prop === "border" || prop === "divide") {
|
|
1751
|
+
if (/^([xytrbles]|\d+|[xytrbles]-\d+)$/.test(rest)) return null;
|
|
1752
|
+
}
|
|
1753
|
+
if (prop === "ring" && /^(\d+|inset)$/.test(rest)) return null;
|
|
1754
|
+
return `${variant}${prop}`;
|
|
1755
|
+
}
|
|
1756
|
+
resolveColorConflicts(classStr) {
|
|
1757
|
+
const tokens = classStr.split(/\s+/).filter(Boolean);
|
|
1758
|
+
const lastIndex = /* @__PURE__ */ new Map();
|
|
1759
|
+
tokens.forEach((t, i) => {
|
|
1760
|
+
const k = this.colorFamilyKey(t);
|
|
1761
|
+
if (k) lastIndex.set(k, i);
|
|
1762
|
+
});
|
|
1763
|
+
return tokens.filter((t, i) => {
|
|
1764
|
+
const k = this.colorFamilyKey(t);
|
|
1765
|
+
return k === null || lastIndex.get(k) === i;
|
|
1766
|
+
}).join(" ");
|
|
1767
|
+
}
|
|
1768
|
+
/**
|
|
1769
|
+
* The set of color families a @bind's tier classNames assign — so the caller
|
|
1770
|
+
* can strip those families from the static prefix (the dynamic tier cascade
|
|
1771
|
+
* owns them, and the static default would otherwise leak a raw color).
|
|
1772
|
+
*/
|
|
1773
|
+
tierColorFamilies(traits) {
|
|
1774
|
+
const families = /* @__PURE__ */ new Set();
|
|
1775
|
+
const tiers = traits?.bind?.tiers;
|
|
1776
|
+
if (!Array.isArray(tiers)) return families;
|
|
1777
|
+
for (const tier of tiers) {
|
|
1778
|
+
const cn = typeof tier?.className === "string" ? tier.className : "";
|
|
1779
|
+
for (const tok of cn.split(/\s+/).filter(Boolean)) {
|
|
1780
|
+
const k = this.colorFamilyKey(tok);
|
|
1781
|
+
if (k) families.add(k);
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
return families;
|
|
1785
|
+
}
|
|
1786
|
+
/** Drop every token whose color family is in `families` (removes a static
|
|
1787
|
+
* default color that a dynamic @bind tier cascade will always override). */
|
|
1788
|
+
stripColorFamilies(classStr, families) {
|
|
1789
|
+
if (families.size === 0) return classStr;
|
|
1790
|
+
return classStr.split(/\s+/).filter(Boolean).filter((t) => {
|
|
1791
|
+
const k = this.colorFamilyKey(t);
|
|
1792
|
+
return k === null || !families.has(k);
|
|
1793
|
+
}).join(" ");
|
|
1794
|
+
}
|
|
1199
1795
|
buildClasses(traits) {
|
|
1200
1796
|
const classes = [];
|
|
1201
1797
|
if (traits.text) {
|
|
@@ -1238,6 +1834,48 @@ export default ${safeName}Component;
|
|
|
1238
1834
|
return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1239
1835
|
}
|
|
1240
1836
|
};
|
|
1837
|
+
/** Version tag for the co-emitted `holoViewContract` (@verified_view v1). */
|
|
1838
|
+
_Native2DCompiler.VIEW_CONTRACT_VERSION = "holo-view-contract-v1";
|
|
1839
|
+
/**
|
|
1840
|
+
* 2D data-value provenance vocabulary, ordered by TRUST (highest → lowest),
|
|
1841
|
+
* aligned to the shipped 3D PointProvenanceClass idiom (observed | interpolated |
|
|
1842
|
+
* nlos-inferred | generative-extended). An UNKNOWN class is REJECTED, never
|
|
1843
|
+
* silently upgraded to `measured` — provenance fails toward lower trust, so a
|
|
1844
|
+
* typo can never make an inferred value read as sensor-attested.
|
|
1845
|
+
*/
|
|
1846
|
+
_Native2DCompiler.PROVENANCE_CLASSES = /* @__PURE__ */ new Set([
|
|
1847
|
+
"measured",
|
|
1848
|
+
// source-attested: a real sensor reading, DB value, on-chain fact
|
|
1849
|
+
"derived",
|
|
1850
|
+
// computed from measured values by a transparent bounded function
|
|
1851
|
+
"inferred",
|
|
1852
|
+
// model/heuristic estimate (a forecast) — honest that it is a guess
|
|
1853
|
+
"generative"
|
|
1854
|
+
// produced by a generative model (LLM-authored value)
|
|
1855
|
+
]);
|
|
1856
|
+
/** Visible honesty glyph appended to a non-`measured` text value (measured = trusted, no marker). */
|
|
1857
|
+
_Native2DCompiler.PROVENANCE_GLYPH = {
|
|
1858
|
+
measured: "",
|
|
1859
|
+
derived: "\xB0",
|
|
1860
|
+
inferred: "~",
|
|
1861
|
+
generative: "\u2726"
|
|
1862
|
+
};
|
|
1863
|
+
_Native2DCompiler.TEXT_SIZE_TOKENS = /* @__PURE__ */ new Set([
|
|
1864
|
+
"text-xs",
|
|
1865
|
+
"text-sm",
|
|
1866
|
+
"text-base",
|
|
1867
|
+
"text-lg",
|
|
1868
|
+
"text-xl",
|
|
1869
|
+
"text-2xl",
|
|
1870
|
+
"text-3xl",
|
|
1871
|
+
"text-4xl",
|
|
1872
|
+
"text-5xl",
|
|
1873
|
+
"text-6xl",
|
|
1874
|
+
"text-7xl",
|
|
1875
|
+
"text-8xl",
|
|
1876
|
+
"text-9xl"
|
|
1877
|
+
]);
|
|
1878
|
+
var Native2DCompiler = _Native2DCompiler;
|
|
1241
1879
|
|
|
1242
1880
|
// src/compiler/NextJSCompiler.ts
|
|
1243
1881
|
function findTrait(composition, traitName2) {
|
|
@@ -1246,7 +1884,7 @@ function findTrait(composition, traitName2) {
|
|
|
1246
1884
|
const found = traits.find((t) => t.name === traitName2);
|
|
1247
1885
|
return found?.config || null;
|
|
1248
1886
|
}
|
|
1249
|
-
var NextJSCompiler = class extends
|
|
1887
|
+
var NextJSCompiler = class extends chunkCMEINO5I_cjs.CompilerBase {
|
|
1250
1888
|
constructor(options = {}) {
|
|
1251
1889
|
super();
|
|
1252
1890
|
this.options = options;
|
|
@@ -1350,12 +1988,12 @@ var NextJSCompiler = class extends chunkZK7KX5CD_cjs.CompilerBase {
|
|
|
1350
1988
|
};
|
|
1351
1989
|
|
|
1352
1990
|
// src/compiler/index.ts
|
|
1353
|
-
|
|
1991
|
+
chunkPHLNABJD_cjs.init_NextJSAPICompiler();
|
|
1354
1992
|
|
|
1355
1993
|
// src/compiler/MCPConfigCompiler.ts
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
var MCPConfigCompiler = class extends
|
|
1994
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
1995
|
+
chunkPHLNABJD_cjs.init_DialectRegistry();
|
|
1996
|
+
var MCPConfigCompiler = class extends chunkCMEINO5I_cjs.CompilerBase {
|
|
1359
1997
|
constructor(options = {}) {
|
|
1360
1998
|
super();
|
|
1361
1999
|
this.compilerName = "MCPConfigCompiler";
|
|
@@ -1551,7 +2189,7 @@ var MCPConfigCompiler = class extends chunkZK7KX5CD_cjs.CompilerBase {
|
|
|
1551
2189
|
return void 0;
|
|
1552
2190
|
}
|
|
1553
2191
|
};
|
|
1554
|
-
|
|
2192
|
+
chunkPHLNABJD_cjs.DialectRegistry.register({
|
|
1555
2193
|
name: "mcp-config",
|
|
1556
2194
|
domain: "configuration",
|
|
1557
2195
|
description: "Compiles .holo MCP server connection definitions to IDE-specific client config JSON",
|
|
@@ -1562,10 +2200,1310 @@ chunkPXVAPGTR_cjs.DialectRegistry.register({
|
|
|
1562
2200
|
});
|
|
1563
2201
|
|
|
1564
2202
|
// src/compiler/index.ts
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
2203
|
+
chunkPHLNABJD_cjs.init_HoloMCPCompiler();
|
|
2204
|
+
chunkCRUIGXF7_cjs.init_AgentInferenceExportTarget();
|
|
2205
|
+
chunkPHLNABJD_cjs.init_OmnigentAgentYamlCompiler();
|
|
2206
|
+
chunkOQVHCYY4_cjs.init_DaimonSeedCompiler();
|
|
2207
|
+
|
|
2208
|
+
// src/compiler/HSIIRCompiler.ts
|
|
2209
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
2210
|
+
var HSI_IR_SCHEMA_VERSION = "holoscript.hsi-ir.v0.1.0";
|
|
2211
|
+
var HSI_TRACE_SCHEMA_VERSION = "holoscript.hsi-trace.v0.1.0";
|
|
2212
|
+
var HSI_LEARNING_GRAPH_SCHEMA_VERSION = "holoscript.learning-graph.v0.1.0";
|
|
2213
|
+
var HSI_AUDIT_SCHEMA_VERSION = "holoscript.hsi-audit.v0.1.0";
|
|
2214
|
+
var HSIAdmissionError = class extends Error {
|
|
2215
|
+
constructor(code, message) {
|
|
2216
|
+
super(`[${code}] ${message}`);
|
|
2217
|
+
this.name = "HSIAdmissionError";
|
|
2218
|
+
this.code = code;
|
|
2219
|
+
}
|
|
2220
|
+
};
|
|
2221
|
+
function hsiStableStringify(value) {
|
|
2222
|
+
if (value === null || typeof value !== "object") {
|
|
2223
|
+
return JSON.stringify(value) ?? "null";
|
|
2224
|
+
}
|
|
2225
|
+
if (Array.isArray(value)) {
|
|
2226
|
+
return `[${value.map((item) => hsiStableStringify(item)).join(",")}]`;
|
|
2227
|
+
}
|
|
2228
|
+
const record = value;
|
|
2229
|
+
const keys = Object.keys(record).filter((key) => record[key] !== void 0).sort();
|
|
2230
|
+
return `{${keys.map((key) => `${JSON.stringify(key)}:${hsiStableStringify(record[key])}`).join(",")}}`;
|
|
2231
|
+
}
|
|
2232
|
+
function hsiSha256(value) {
|
|
2233
|
+
return `sha256:${crypto.createHash("sha256").update(hsiStableStringify(value)).digest("hex")}`;
|
|
2234
|
+
}
|
|
2235
|
+
function hsiSourceTextDigest(source) {
|
|
2236
|
+
return `sha256:${crypto.createHash("sha256").update(source.replace(/\r\n/g, "\n")).digest("hex")}`;
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
// src/compiler/HSIIRCompiler.ts
|
|
2240
|
+
var HSI_OBSERVATION_MEDIATOR_EDGE = "shields";
|
|
2241
|
+
var ASSIGN_OPERATORS = /* @__PURE__ */ new Set(["=", "+=", "-=", "*=", "/="]);
|
|
2242
|
+
var BINARY_OPERATORS = /* @__PURE__ */ new Set([
|
|
2243
|
+
"+",
|
|
2244
|
+
"-",
|
|
2245
|
+
"*",
|
|
2246
|
+
"/",
|
|
2247
|
+
"%",
|
|
2248
|
+
"===",
|
|
2249
|
+
"!==",
|
|
2250
|
+
"==",
|
|
2251
|
+
"!=",
|
|
2252
|
+
"<",
|
|
2253
|
+
">",
|
|
2254
|
+
"<=",
|
|
2255
|
+
">=",
|
|
2256
|
+
"&&",
|
|
2257
|
+
"||"
|
|
2258
|
+
]);
|
|
2259
|
+
function spanOf(node) {
|
|
2260
|
+
const loc = node?.loc;
|
|
2261
|
+
if (!loc) return void 0;
|
|
2262
|
+
return {
|
|
2263
|
+
line: loc.start.line,
|
|
2264
|
+
column: loc.start.column,
|
|
2265
|
+
endLine: loc.end.line,
|
|
2266
|
+
endColumn: loc.end.column
|
|
2267
|
+
};
|
|
2268
|
+
}
|
|
2269
|
+
function scalarType(value) {
|
|
2270
|
+
if (value === null) return "null";
|
|
2271
|
+
return typeof value;
|
|
2272
|
+
}
|
|
2273
|
+
function asScalar(value, where) {
|
|
2274
|
+
if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
2275
|
+
return value;
|
|
2276
|
+
}
|
|
2277
|
+
throw new HSIAdmissionError(
|
|
2278
|
+
"unsupported-value",
|
|
2279
|
+
`${where}: HS-Core v0 admits scalar values only, got ${Array.isArray(value) ? "array" : typeof value}`
|
|
2280
|
+
);
|
|
2281
|
+
}
|
|
2282
|
+
function asTriple(value, where) {
|
|
2283
|
+
let arr;
|
|
2284
|
+
if (Array.isArray(value)) {
|
|
2285
|
+
arr = value;
|
|
2286
|
+
} else if (typeof value === "object" && value !== null && "x" in value) {
|
|
2287
|
+
const vec = value;
|
|
2288
|
+
arr = [vec["x"], vec["y"], vec["z"]];
|
|
2289
|
+
}
|
|
2290
|
+
if (!arr || arr.length !== 3 || !arr.every((n) => typeof n === "number" && Number.isFinite(n))) {
|
|
2291
|
+
throw new HSIAdmissionError("invalid-spatial", `${where}: position/scale must be a finite numeric triple`);
|
|
2292
|
+
}
|
|
2293
|
+
return [arr[0], arr[1], arr[2]];
|
|
2294
|
+
}
|
|
2295
|
+
function collectSlots(ir, into) {
|
|
2296
|
+
switch (ir.kind) {
|
|
2297
|
+
case "Identifier":
|
|
2298
|
+
into.add(ir.name);
|
|
2299
|
+
return;
|
|
2300
|
+
case "BinaryExpression":
|
|
2301
|
+
collectSlots(ir.left, into);
|
|
2302
|
+
collectSlots(ir.right, into);
|
|
2303
|
+
return;
|
|
2304
|
+
case "UnaryExpression":
|
|
2305
|
+
collectSlots(ir.argument, into);
|
|
2306
|
+
return;
|
|
2307
|
+
case "MemberExpression":
|
|
2308
|
+
collectSlots(ir.object, into);
|
|
2309
|
+
return;
|
|
2310
|
+
case "CallExpression":
|
|
2311
|
+
for (const arg of ir.arguments) collectSlots(arg, into);
|
|
2312
|
+
return;
|
|
2313
|
+
case "Literal":
|
|
2314
|
+
return;
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2317
|
+
function assertSlots(ir, allowed, where) {
|
|
2318
|
+
const used = /* @__PURE__ */ new Set();
|
|
2319
|
+
collectSlots(ir, used);
|
|
2320
|
+
for (const name of used) {
|
|
2321
|
+
if (!allowed.has(name)) {
|
|
2322
|
+
throw new HSIAdmissionError("unknown-slot", `${where}: expression reads undeclared slot "${name}"`);
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2325
|
+
return [...used].sort();
|
|
2326
|
+
}
|
|
2327
|
+
function lowerHoloExpression(expr, where) {
|
|
2328
|
+
switch (expr.type) {
|
|
2329
|
+
case "Literal":
|
|
2330
|
+
return { kind: "Literal", value: expr.value };
|
|
2331
|
+
case "Identifier":
|
|
2332
|
+
return { kind: "Identifier", name: expr.name };
|
|
2333
|
+
case "BinaryExpression": {
|
|
2334
|
+
if (!BINARY_OPERATORS.has(expr.operator)) {
|
|
2335
|
+
throw new HSIAdmissionError("unsupported-operator", `${where}: operator "${expr.operator}"`);
|
|
2336
|
+
}
|
|
2337
|
+
return {
|
|
2338
|
+
kind: "BinaryExpression",
|
|
2339
|
+
operator: expr.operator,
|
|
2340
|
+
left: lowerHoloExpression(expr.left, where),
|
|
2341
|
+
right: lowerHoloExpression(expr.right, where)
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2344
|
+
case "UnaryExpression":
|
|
2345
|
+
return {
|
|
2346
|
+
kind: "UnaryExpression",
|
|
2347
|
+
operator: expr.operator,
|
|
2348
|
+
argument: lowerHoloExpression(expr.argument, where)
|
|
2349
|
+
};
|
|
2350
|
+
case "MemberExpression": {
|
|
2351
|
+
if (expr.computed) {
|
|
2352
|
+
throw new HSIAdmissionError("unsupported-expression", `${where}: computed member access`);
|
|
2353
|
+
}
|
|
2354
|
+
return {
|
|
2355
|
+
kind: "MemberExpression",
|
|
2356
|
+
object: lowerHoloExpression(expr.object, where),
|
|
2357
|
+
property: expr.property
|
|
2358
|
+
};
|
|
2359
|
+
}
|
|
2360
|
+
default:
|
|
2361
|
+
throw new HSIAdmissionError("unsupported-expression", `${where}: ${expr.type} is outside HS-Core v0`);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
function lowerEntities(composition) {
|
|
2365
|
+
const templates = /* @__PURE__ */ new Map();
|
|
2366
|
+
for (const template of composition.templates ?? []) {
|
|
2367
|
+
if (templates.has(template.name)) {
|
|
2368
|
+
throw new HSIAdmissionError("duplicate-template", `template "${template.name}" declared twice`);
|
|
2369
|
+
}
|
|
2370
|
+
templates.set(template.name, template);
|
|
2371
|
+
}
|
|
2372
|
+
const entities = /* @__PURE__ */ new Map();
|
|
2373
|
+
for (const obj of composition.objects ?? []) {
|
|
2374
|
+
if (entities.has(obj.name)) {
|
|
2375
|
+
throw new HSIAdmissionError("duplicate-entity", `entity "${obj.name}" declared twice`);
|
|
2376
|
+
}
|
|
2377
|
+
if ((obj.children ?? []).length > 0) {
|
|
2378
|
+
throw new HSIAdmissionError("unsupported-value", `entity "${obj.name}": nested children are outside HS-Core v0`);
|
|
2379
|
+
}
|
|
2380
|
+
const components = {};
|
|
2381
|
+
const traitNames = /* @__PURE__ */ new Set();
|
|
2382
|
+
let template;
|
|
2383
|
+
if (obj.template !== void 0) {
|
|
2384
|
+
template = templates.get(obj.template);
|
|
2385
|
+
if (!template) {
|
|
2386
|
+
throw new HSIAdmissionError("unknown-archetype", `entity "${obj.name}" uses missing template "${obj.template}"`);
|
|
2387
|
+
}
|
|
2388
|
+
for (const prop of template.properties ?? []) {
|
|
2389
|
+
if (prop.key === "position" || prop.key === "scale") continue;
|
|
2390
|
+
components[prop.key] = asScalar(prop.value, `template "${template.name}".${prop.key}`);
|
|
2391
|
+
}
|
|
2392
|
+
for (const trait of template.traits ?? []) traitNames.add(trait.name);
|
|
2393
|
+
}
|
|
2394
|
+
let position;
|
|
2395
|
+
let scale;
|
|
2396
|
+
for (const prop of obj.properties ?? []) {
|
|
2397
|
+
if (prop.key === "position") {
|
|
2398
|
+
position = asTriple(prop.value, `entity "${obj.name}".position`);
|
|
2399
|
+
continue;
|
|
2400
|
+
}
|
|
2401
|
+
if (prop.key === "scale") {
|
|
2402
|
+
scale = asTriple(prop.value, `entity "${obj.name}".scale`);
|
|
2403
|
+
continue;
|
|
2404
|
+
}
|
|
2405
|
+
components[prop.key] = asScalar(prop.value, `entity "${obj.name}".${prop.key}`);
|
|
2406
|
+
}
|
|
2407
|
+
for (const trait of obj.traits ?? []) traitNames.add(trait.name);
|
|
2408
|
+
const opaqueValue = components["opaque"];
|
|
2409
|
+
const opacity = opaqueValue === void 0 ? "unknown" : opaqueValue === true ? "opaque" : "transparent";
|
|
2410
|
+
delete components["opaque"];
|
|
2411
|
+
const role = typeof components["role"] === "string" ? components["role"] : void 0;
|
|
2412
|
+
const entity = {
|
|
2413
|
+
id: `entity:${obj.name}`,
|
|
2414
|
+
name: obj.name,
|
|
2415
|
+
opacity,
|
|
2416
|
+
components,
|
|
2417
|
+
traits: [...traitNames].sort(),
|
|
2418
|
+
sourceSpan: spanOf(obj)
|
|
2419
|
+
};
|
|
2420
|
+
if (obj.template !== void 0) entity.archetype = obj.template;
|
|
2421
|
+
if (role !== void 0) entity.role = role;
|
|
2422
|
+
if (position === void 0 && obj.position !== void 0) {
|
|
2423
|
+
position = asTriple(obj.position, `entity "${obj.name}".position`);
|
|
2424
|
+
}
|
|
2425
|
+
if (scale === void 0 && obj.scale !== void 0) {
|
|
2426
|
+
scale = asTriple(obj.scale, `entity "${obj.name}".scale`);
|
|
2427
|
+
}
|
|
2428
|
+
if (position !== void 0) entity.position = position;
|
|
2429
|
+
if (scale !== void 0) entity.scale = scale;
|
|
2430
|
+
entities.set(obj.name, entity);
|
|
2431
|
+
}
|
|
2432
|
+
return { templates, entities };
|
|
2433
|
+
}
|
|
2434
|
+
function lowerRelations(composition, entities) {
|
|
2435
|
+
const relations = [];
|
|
2436
|
+
const connections = composition.connections ?? [];
|
|
2437
|
+
for (const conn of connections) {
|
|
2438
|
+
for (const endpoint of [conn.from, conn.to]) {
|
|
2439
|
+
if (!entities.has(endpoint)) {
|
|
2440
|
+
throw new HSIAdmissionError(
|
|
2441
|
+
"unknown-relation-endpoint",
|
|
2442
|
+
`connection ${conn.from} -> ${conn.to} references undeclared entity "${endpoint}"`
|
|
2443
|
+
);
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
const edgeType = conn.edgeType ?? "connects";
|
|
2447
|
+
relations.push({
|
|
2448
|
+
id: `relation:${conn.from}->${conn.to}:${edgeType}`,
|
|
2449
|
+
from: conn.from,
|
|
2450
|
+
to: conn.to,
|
|
2451
|
+
edgeType,
|
|
2452
|
+
sourceSpan: spanOf(conn)
|
|
2453
|
+
});
|
|
2454
|
+
}
|
|
2455
|
+
return relations;
|
|
2456
|
+
}
|
|
2457
|
+
function lowerState(composition) {
|
|
2458
|
+
const fields = [];
|
|
2459
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2460
|
+
for (const prop of composition.state?.properties ?? []) {
|
|
2461
|
+
if (seen.has(prop.key)) {
|
|
2462
|
+
throw new HSIAdmissionError("duplicate-state-key", `state key "${prop.key}" declared twice`);
|
|
2463
|
+
}
|
|
2464
|
+
seen.add(prop.key);
|
|
2465
|
+
const baseline = asScalar(prop.value, `state.${prop.key}`);
|
|
2466
|
+
fields.push({
|
|
2467
|
+
id: `state:world.${prop.key}`,
|
|
2468
|
+
key: prop.key,
|
|
2469
|
+
baseline,
|
|
2470
|
+
valueType: scalarType(baseline),
|
|
2471
|
+
reactive: prop.reactive === true,
|
|
2472
|
+
sourceSpan: spanOf(prop)
|
|
2473
|
+
});
|
|
2474
|
+
}
|
|
2475
|
+
return fields;
|
|
2476
|
+
}
|
|
2477
|
+
function deriveObservationPolicy(entities, relations) {
|
|
2478
|
+
const rules = [];
|
|
2479
|
+
const observers = [...entities.values()].filter((e) => e.role === "agent");
|
|
2480
|
+
const mediatorsByTarget = /* @__PURE__ */ new Map();
|
|
2481
|
+
for (const rel of relations) {
|
|
2482
|
+
if (rel.edgeType !== HSI_OBSERVATION_MEDIATOR_EDGE) continue;
|
|
2483
|
+
const list = mediatorsByTarget.get(rel.to) ?? [];
|
|
2484
|
+
list.push(entities.get(rel.from));
|
|
2485
|
+
mediatorsByTarget.set(rel.to, list);
|
|
2486
|
+
}
|
|
2487
|
+
for (const observer of observers) {
|
|
2488
|
+
for (const observed of entities.values()) {
|
|
2489
|
+
if (observed.name === observer.name) continue;
|
|
2490
|
+
if (observed.role === "barrier") continue;
|
|
2491
|
+
const mediators = (mediatorsByTarget.get(observed.name) ?? []).slice().sort((a, b) => a.name.localeCompare(b.name));
|
|
2492
|
+
const access = mediators.some((m) => m.opacity === "opaque") ? "blocked" : mediators.some((m) => m.opacity === "unknown") ? "unknown" : "visible";
|
|
2493
|
+
rules.push({
|
|
2494
|
+
id: `obs:${observer.name}->${observed.name}`,
|
|
2495
|
+
observer: observer.name,
|
|
2496
|
+
observed: observed.name,
|
|
2497
|
+
access,
|
|
2498
|
+
mediators: mediators.map((m) => m.name)
|
|
2499
|
+
});
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
return rules;
|
|
2503
|
+
}
|
|
2504
|
+
function lowerStatements(statements, handlerEvent, stateSlots, counter) {
|
|
2505
|
+
const effects = [];
|
|
2506
|
+
for (const stmt of statements) {
|
|
2507
|
+
const ordinal = counter.n++;
|
|
2508
|
+
const id = `effect:${handlerEvent}#${ordinal}`;
|
|
2509
|
+
switch (stmt.type) {
|
|
2510
|
+
case "Assignment": {
|
|
2511
|
+
if (!ASSIGN_OPERATORS.has(stmt.operator)) {
|
|
2512
|
+
throw new HSIAdmissionError("unsupported-operator", `${id}: assignment operator "${stmt.operator}"`);
|
|
2513
|
+
}
|
|
2514
|
+
const target = stmt.target.startsWith("state.") ? stmt.target.slice("state.".length) : stmt.target;
|
|
2515
|
+
if (!stateSlots.has(target)) {
|
|
2516
|
+
throw new HSIAdmissionError("unknown-assignment-target", `${id}: "${stmt.target}" is not a declared state key`);
|
|
2517
|
+
}
|
|
2518
|
+
const value = lowerHoloExpression(stmt.value, id);
|
|
2519
|
+
assertSlots(value, stateSlots, id);
|
|
2520
|
+
effects.push({ kind: "assign", id, target, operator: stmt.operator, value, sourceSpan: spanOf(stmt) });
|
|
2521
|
+
break;
|
|
2522
|
+
}
|
|
2523
|
+
case "EmitStatement": {
|
|
2524
|
+
effects.push({ kind: "emit", id, event: stmt.event, sourceSpan: spanOf(stmt) });
|
|
2525
|
+
break;
|
|
2526
|
+
}
|
|
2527
|
+
case "IfStatement": {
|
|
2528
|
+
const condition = lowerHoloExpression(stmt.condition, id);
|
|
2529
|
+
assertSlots(condition, stateSlots, id);
|
|
2530
|
+
effects.push({
|
|
2531
|
+
kind: "branch",
|
|
2532
|
+
id,
|
|
2533
|
+
condition,
|
|
2534
|
+
then: lowerStatements(stmt.consequent, handlerEvent, stateSlots, counter),
|
|
2535
|
+
else: lowerStatements(stmt.alternate ?? [], handlerEvent, stateSlots, counter),
|
|
2536
|
+
sourceSpan: spanOf(stmt)
|
|
2537
|
+
});
|
|
2538
|
+
break;
|
|
2539
|
+
}
|
|
2540
|
+
default:
|
|
2541
|
+
throw new HSIAdmissionError("unsupported-statement", `${id}: ${stmt.type} is outside HS-Core v0`);
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
return effects;
|
|
2545
|
+
}
|
|
2546
|
+
function lowerEventHandlers(composition, stateSlots) {
|
|
2547
|
+
const logic = composition.logic;
|
|
2548
|
+
const handlers = [];
|
|
2549
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2550
|
+
for (const handler of logic?.handlers ?? []) {
|
|
2551
|
+
if (seen.has(handler.event)) {
|
|
2552
|
+
throw new HSIAdmissionError("duplicate-handler", `handler "${handler.event}" declared twice`);
|
|
2553
|
+
}
|
|
2554
|
+
seen.add(handler.event);
|
|
2555
|
+
handlers.push({
|
|
2556
|
+
id: `event:${handler.event}`,
|
|
2557
|
+
event: handler.event,
|
|
2558
|
+
effects: lowerStatements(handler.body, handler.event, stateSlots, { n: 0 }),
|
|
2559
|
+
sourceSpan: spanOf(handler)
|
|
2560
|
+
});
|
|
2561
|
+
}
|
|
2562
|
+
return handlers;
|
|
2563
|
+
}
|
|
2564
|
+
function lowerMachine(machine) {
|
|
2565
|
+
const stateNames = Object.keys(machine.states ?? {});
|
|
2566
|
+
if (stateNames.length === 0) {
|
|
2567
|
+
throw new HSIAdmissionError("admission-skewed", `state machine "${machine.name}" declares no states`);
|
|
2568
|
+
}
|
|
2569
|
+
if (!stateNames.includes(machine.initialState)) {
|
|
2570
|
+
throw new HSIAdmissionError(
|
|
2571
|
+
"unknown-initial-state",
|
|
2572
|
+
`state machine "${machine.name}": initial state "${machine.initialState}" is not declared`
|
|
2573
|
+
);
|
|
2574
|
+
}
|
|
2575
|
+
const inputs = (machine.inputs ?? []).map((input) => ({
|
|
2576
|
+
id: `input:${machine.name}.${input.name}`,
|
|
2577
|
+
name: input.name,
|
|
2578
|
+
inputType: input.inputType,
|
|
2579
|
+
baseline: input.default !== void 0 ? input.default : input.inputType === "bool" || input.inputType === "trigger" ? false : 0
|
|
2580
|
+
}));
|
|
2581
|
+
const inputSlots = new Set(inputs.map((i) => i.name));
|
|
2582
|
+
const allTransitions = [];
|
|
2583
|
+
for (const t of machine.transitions ?? []) {
|
|
2584
|
+
allTransitions.push({ from: t.from && t.from !== "any" ? t.from : t.from ?? "any", t });
|
|
2585
|
+
}
|
|
2586
|
+
for (const stateName of stateNames) {
|
|
2587
|
+
for (const t of machine.states[stateName]?.transitions ?? []) {
|
|
2588
|
+
allTransitions.push({ from: t.from ?? stateName, t });
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
const ordinals = /* @__PURE__ */ new Map();
|
|
2592
|
+
const transitions = allTransitions.map(({ from, t }, declarationOrdinal) => {
|
|
2593
|
+
if (from !== "any" && !stateNames.includes(from)) {
|
|
2594
|
+
throw new HSIAdmissionError(
|
|
2595
|
+
"unknown-transition-endpoint",
|
|
2596
|
+
`state machine "${machine.name}": transition from undeclared state "${from}"`
|
|
2597
|
+
);
|
|
2598
|
+
}
|
|
2599
|
+
if (!stateNames.includes(t.target)) {
|
|
2600
|
+
throw new HSIAdmissionError(
|
|
2601
|
+
"unknown-transition-endpoint",
|
|
2602
|
+
`state machine "${machine.name}": transition to undeclared state "${t.target}"`
|
|
2603
|
+
);
|
|
2604
|
+
}
|
|
2605
|
+
const baseId = `transition:${machine.name}.${from}->${t.target}`;
|
|
2606
|
+
const ordinal = ordinals.get(baseId) ?? 0;
|
|
2607
|
+
ordinals.set(baseId, ordinal + 1);
|
|
2608
|
+
const id = `${baseId}#${ordinal}`;
|
|
2609
|
+
let guard;
|
|
2610
|
+
if (t.condition) {
|
|
2611
|
+
guard = lowerHoloExpression(t.condition, id);
|
|
2612
|
+
} else if ((t.conditions ?? []).length > 0) {
|
|
2613
|
+
for (const cond of t.conditions) {
|
|
2614
|
+
const clause = {
|
|
2615
|
+
kind: "BinaryExpression",
|
|
2616
|
+
operator: cond.operator,
|
|
2617
|
+
left: { kind: "Identifier", name: cond.parameter },
|
|
2618
|
+
right: { kind: "Literal", value: cond.value }
|
|
2619
|
+
};
|
|
2620
|
+
guard = guard ? { kind: "BinaryExpression", operator: cond.chain === "or" ? "||" : "&&", left: guard, right: clause } : clause;
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
if (!guard) {
|
|
2624
|
+
throw new HSIAdmissionError("admission-skewed", `${id}: transition has neither guard nor trigger condition`);
|
|
2625
|
+
}
|
|
2626
|
+
const reads = assertSlots(guard, inputSlots, id);
|
|
2627
|
+
const transition = {
|
|
2628
|
+
id,
|
|
2629
|
+
from,
|
|
2630
|
+
target: t.target,
|
|
2631
|
+
priority: declarationOrdinal,
|
|
2632
|
+
guard,
|
|
2633
|
+
reads,
|
|
2634
|
+
sourceSpan: spanOf(t)
|
|
2635
|
+
};
|
|
2636
|
+
if (t.event !== void 0) transition.event = t.event;
|
|
2637
|
+
return transition;
|
|
2638
|
+
});
|
|
2639
|
+
return {
|
|
2640
|
+
id: `machine:${machine.name}`,
|
|
2641
|
+
name: machine.name,
|
|
2642
|
+
initialState: machine.initialState,
|
|
2643
|
+
states: [...stateNames].sort(),
|
|
2644
|
+
inputs,
|
|
2645
|
+
transitions,
|
|
2646
|
+
sourceSpan: spanOf(machine)
|
|
2647
|
+
};
|
|
2648
|
+
}
|
|
2649
|
+
function lowerPredicates(composition, stateSlots) {
|
|
2650
|
+
const predicates = [];
|
|
2651
|
+
const slotList = [...stateSlots];
|
|
2652
|
+
const lowerClause = (kind, name, expr) => {
|
|
2653
|
+
const id = `${kind}:${name}`;
|
|
2654
|
+
let ir;
|
|
2655
|
+
try {
|
|
2656
|
+
ir = chunkX5ZLSPU2_cjs.parseExpressionToIR(expr, slotList);
|
|
2657
|
+
} catch (error) {
|
|
2658
|
+
if (error instanceof chunkX5ZLSPU2_cjs.ExpressionParseError) {
|
|
2659
|
+
throw new HSIAdmissionError("unparseable-clause", `${id}: ${error.message}`);
|
|
2660
|
+
}
|
|
2661
|
+
throw error;
|
|
2662
|
+
}
|
|
2663
|
+
return { id, name, kind, expression: ir, reads: assertSlots(ir, stateSlots, id), sourceSpan: spanOf(composition.contract) };
|
|
2664
|
+
};
|
|
2665
|
+
for (const clause of composition.contract?.preconditions ?? []) {
|
|
2666
|
+
predicates.push(lowerClause("precondition", clause.name, clause.expr));
|
|
2667
|
+
}
|
|
2668
|
+
for (const clause of composition.contract?.invariants ?? []) {
|
|
2669
|
+
predicates.push(lowerClause("invariant", clause.name, clause.expr));
|
|
2670
|
+
}
|
|
2671
|
+
for (const achievement of composition.achievements ?? []) {
|
|
2672
|
+
const id = `goal:${achievement.name}`;
|
|
2673
|
+
const ir = lowerHoloExpression(achievement.condition, id);
|
|
2674
|
+
predicates.push({
|
|
2675
|
+
id,
|
|
2676
|
+
name: achievement.name,
|
|
2677
|
+
kind: "goal",
|
|
2678
|
+
expression: ir,
|
|
2679
|
+
reads: assertSlots(ir, stateSlots, id),
|
|
2680
|
+
sourceSpan: spanOf(achievement)
|
|
2681
|
+
});
|
|
2682
|
+
}
|
|
2683
|
+
return predicates;
|
|
2684
|
+
}
|
|
2685
|
+
function lowerCompositionToHSIIR(composition, options = {}) {
|
|
2686
|
+
if (!composition || composition.type !== "Composition" || typeof composition.name !== "string" || composition.name.length === 0) {
|
|
2687
|
+
throw new HSIAdmissionError("empty-world", "input is not a named HoloComposition");
|
|
2688
|
+
}
|
|
2689
|
+
const { entities } = lowerEntities(composition);
|
|
2690
|
+
const stateFields = lowerState(composition);
|
|
2691
|
+
if (entities.size === 0 && stateFields.length === 0) {
|
|
2692
|
+
throw new HSIAdmissionError("empty-world", `composition "${composition.name}" declares no entities and no state`);
|
|
2693
|
+
}
|
|
2694
|
+
const relations = lowerRelations(composition, entities);
|
|
2695
|
+
const observationPolicy = deriveObservationPolicy(entities, relations);
|
|
2696
|
+
const stateSlots = new Set(stateFields.map((f) => f.key));
|
|
2697
|
+
const eventHandlers = lowerEventHandlers(composition, stateSlots);
|
|
2698
|
+
const machines = (composition.stateMachines ?? []).map(lowerMachine);
|
|
2699
|
+
const predicates = lowerPredicates(composition, stateSlots);
|
|
2700
|
+
const sourceDigest = options.sourceText !== void 0 ? hsiSourceTextDigest(options.sourceText) : hsiSha256({ compositionName: composition.name, note: "no-source-text-provided" });
|
|
2701
|
+
const byId = (items) => [...items].sort((a, b) => a.id.localeCompare(b.id));
|
|
2702
|
+
const docWithoutDigest = {
|
|
2703
|
+
schemaVersion: HSI_IR_SCHEMA_VERSION,
|
|
2704
|
+
kind: "HSIIR",
|
|
2705
|
+
world: { name: composition.name, sourceDigest },
|
|
2706
|
+
entities: byId([...entities.values()]),
|
|
2707
|
+
relations: byId(relations),
|
|
2708
|
+
state: byId(stateFields),
|
|
2709
|
+
observationPolicy: byId(observationPolicy),
|
|
2710
|
+
eventHandlers: byId(eventHandlers),
|
|
2711
|
+
machines: byId(machines),
|
|
2712
|
+
predicates: byId(predicates),
|
|
2713
|
+
declaredUnknowns: [
|
|
2714
|
+
"action-capabilities",
|
|
2715
|
+
"action-costs",
|
|
2716
|
+
"beliefs",
|
|
2717
|
+
"first-class-observations",
|
|
2718
|
+
"memory-events",
|
|
2719
|
+
"receipt-shape"
|
|
2720
|
+
],
|
|
2721
|
+
provenance: { compiler: "HSIIRCompiler" }
|
|
2722
|
+
};
|
|
2723
|
+
const deterministicDigest = hsiSha256(docWithoutDigest);
|
|
2724
|
+
return {
|
|
2725
|
+
...docWithoutDigest,
|
|
2726
|
+
provenance: { compiler: "HSIIRCompiler", deterministicDigest }
|
|
2727
|
+
};
|
|
2728
|
+
}
|
|
2729
|
+
var HSIIRCompiler = class extends chunkCMEINO5I_cjs.CompilerBase {
|
|
2730
|
+
constructor(options = {}) {
|
|
2731
|
+
super();
|
|
2732
|
+
this.compilerName = "HSIIRCompiler";
|
|
2733
|
+
this.options = options;
|
|
2734
|
+
}
|
|
2735
|
+
getRequiredCapability() {
|
|
2736
|
+
return ans.ANSCapabilityPath.HSI_IR;
|
|
2737
|
+
}
|
|
2738
|
+
compile(composition, agentToken, outputPath) {
|
|
2739
|
+
this.validateCompilerAccess(agentToken, outputPath);
|
|
2740
|
+
return JSON.stringify(lowerCompositionToHSIIR(composition, this.options), null, 2);
|
|
2741
|
+
}
|
|
2742
|
+
compileToFiles(composition, agentToken = "") {
|
|
2743
|
+
return { [this.defaultOutputFileName()]: this.compile(composition, agentToken) };
|
|
2744
|
+
}
|
|
2745
|
+
defaultOutputFileName() {
|
|
2746
|
+
return "hsi-ir.json";
|
|
2747
|
+
}
|
|
2748
|
+
};
|
|
2749
|
+
function createHSIIRCompiler(options) {
|
|
2750
|
+
return new HSIIRCompiler(options);
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
// src/compiler/HSIExactTrace.ts
|
|
2754
|
+
function snapshot(world) {
|
|
2755
|
+
const state = {};
|
|
2756
|
+
for (const key of Object.keys(world.state).sort()) state[key] = world.state[key];
|
|
2757
|
+
const machineStates = {};
|
|
2758
|
+
for (const name of [...world.machines.keys()].sort()) {
|
|
2759
|
+
machineStates[name] = world.machines.get(name).current;
|
|
2760
|
+
}
|
|
2761
|
+
return { state, machineStates, stateDigest: hsiSha256({ state, machineStates }) };
|
|
2762
|
+
}
|
|
2763
|
+
function evaluateGuard(guard, context) {
|
|
2764
|
+
return chunkX5ZLSPU2_cjs.evaluateExpressionIR(guard, context) === true;
|
|
2765
|
+
}
|
|
2766
|
+
function applyOperator(operator, before, operand, where) {
|
|
2767
|
+
if (operator === "=") {
|
|
2768
|
+
if (operand === null || typeof operand === "string" || typeof operand === "number" || typeof operand === "boolean") {
|
|
2769
|
+
return operand;
|
|
2770
|
+
}
|
|
2771
|
+
throw new HSIAdmissionError("unsupported-value", `${where}: assignment produced a non-scalar value`);
|
|
2772
|
+
}
|
|
2773
|
+
if (typeof before !== "number" || typeof operand !== "number" || !Number.isFinite(operand)) {
|
|
2774
|
+
throw new HSIAdmissionError(
|
|
2775
|
+
"unsupported-value",
|
|
2776
|
+
`${where}: compound assignment requires numeric operands (got ${typeof before} ${operator} ${typeof operand})`
|
|
2777
|
+
);
|
|
2778
|
+
}
|
|
2779
|
+
switch (operator) {
|
|
2780
|
+
case "+=":
|
|
2781
|
+
return before + operand;
|
|
2782
|
+
case "-=":
|
|
2783
|
+
return before - operand;
|
|
2784
|
+
case "*=":
|
|
2785
|
+
return before * operand;
|
|
2786
|
+
case "/=": {
|
|
2787
|
+
if (operand === 0) {
|
|
2788
|
+
throw new HSIAdmissionError("unsupported-value", `${where}: division by zero`);
|
|
2789
|
+
}
|
|
2790
|
+
return before / operand;
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
function runEffects(effects, world, records, emitted) {
|
|
2795
|
+
for (const effect of effects) {
|
|
2796
|
+
switch (effect.kind) {
|
|
2797
|
+
case "assign": {
|
|
2798
|
+
const before = world.state[effect.target];
|
|
2799
|
+
const operand = chunkX5ZLSPU2_cjs.evaluateExpressionIR(effect.value, world.state);
|
|
2800
|
+
const after = applyOperator(effect.operator, before, operand, effect.id);
|
|
2801
|
+
world.state[effect.target] = after;
|
|
2802
|
+
records.push({ sourceId: effect.id, target: effect.target, before, after });
|
|
2803
|
+
break;
|
|
2804
|
+
}
|
|
2805
|
+
case "emit": {
|
|
2806
|
+
emitted.push(effect.event);
|
|
2807
|
+
break;
|
|
2808
|
+
}
|
|
2809
|
+
case "branch": {
|
|
2810
|
+
const taken = evaluateGuard(effect.condition, world.state);
|
|
2811
|
+
runEffects(taken ? effect.then : effect.else, world, records, emitted);
|
|
2812
|
+
break;
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
function evaluateTransitions(world, ir) {
|
|
2818
|
+
const fired = [];
|
|
2819
|
+
for (const machineIR of ir.machines) {
|
|
2820
|
+
const runtime = world.machines.get(machineIR.name);
|
|
2821
|
+
const context = { ...runtime.inputs };
|
|
2822
|
+
for (const trigger of runtime.triggers) context[trigger] = true;
|
|
2823
|
+
const candidates = [...machineIR.transitions].sort((a, b) => a.priority - b.priority);
|
|
2824
|
+
for (const transition of candidates) {
|
|
2825
|
+
if (transition.from !== "any" && transition.from !== runtime.current) continue;
|
|
2826
|
+
if (!transition.guard) continue;
|
|
2827
|
+
if (evaluateGuard(transition.guard, context)) {
|
|
2828
|
+
fired.push({
|
|
2829
|
+
machine: machineIR.name,
|
|
2830
|
+
transitionId: transition.id,
|
|
2831
|
+
from: runtime.current,
|
|
2832
|
+
to: transition.target
|
|
2833
|
+
});
|
|
2834
|
+
runtime.current = transition.target;
|
|
2835
|
+
break;
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
runtime.triggers.clear();
|
|
2839
|
+
}
|
|
2840
|
+
return fired;
|
|
2841
|
+
}
|
|
2842
|
+
function checkInvariants(world, ir) {
|
|
2843
|
+
const violations = [];
|
|
2844
|
+
for (const predicate of ir.predicates) {
|
|
2845
|
+
if (predicate.kind !== "invariant") continue;
|
|
2846
|
+
if (!evaluateGuard(predicate.expression, world.state)) violations.push(predicate.id);
|
|
2847
|
+
}
|
|
2848
|
+
return violations;
|
|
2849
|
+
}
|
|
2850
|
+
function runExactTrace(ir, scenario) {
|
|
2851
|
+
const world = { state: {}, machines: /* @__PURE__ */ new Map() };
|
|
2852
|
+
for (const field of ir.state) world.state[field.key] = field.baseline;
|
|
2853
|
+
for (const machine of ir.machines) {
|
|
2854
|
+
const inputs = {};
|
|
2855
|
+
for (const input of machine.inputs) {
|
|
2856
|
+
inputs[input.name] = input.inputType === "trigger" ? false : input.baseline;
|
|
2857
|
+
}
|
|
2858
|
+
world.machines.set(machine.name, {
|
|
2859
|
+
name: machine.name,
|
|
2860
|
+
current: machine.initialState,
|
|
2861
|
+
inputs,
|
|
2862
|
+
triggers: /* @__PURE__ */ new Set()
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
2865
|
+
const preconditionResults = ir.predicates.filter((p) => p.kind === "precondition").map((p) => ({ id: p.id, holds: evaluateGuard(p.expression, world.state) }));
|
|
2866
|
+
const initial = snapshot(world);
|
|
2867
|
+
const steps = [];
|
|
2868
|
+
let valid = preconditionResults.every((r) => r.holds);
|
|
2869
|
+
scenario.forEach((step, ordinal) => {
|
|
2870
|
+
const effects = [];
|
|
2871
|
+
const emitted = [];
|
|
2872
|
+
let transitions = [];
|
|
2873
|
+
switch (step.kind) {
|
|
2874
|
+
case "set-input": {
|
|
2875
|
+
const machine = world.machines.get(step.machine);
|
|
2876
|
+
if (!machine || !(step.input in machine.inputs)) {
|
|
2877
|
+
throw new HSIAdmissionError(
|
|
2878
|
+
"unknown-slot",
|
|
2879
|
+
`scenario step ${ordinal}: unknown machine input ${step.machine}.${step.input}`
|
|
2880
|
+
);
|
|
2881
|
+
}
|
|
2882
|
+
machine.inputs[step.input] = step.value;
|
|
2883
|
+
transitions = evaluateTransitions(world, ir);
|
|
2884
|
+
break;
|
|
2885
|
+
}
|
|
2886
|
+
case "fire-trigger": {
|
|
2887
|
+
const machine = world.machines.get(step.machine);
|
|
2888
|
+
const declared = ir.machines.find((m) => m.name === step.machine)?.inputs.find((i) => i.name === step.input && i.inputType === "trigger");
|
|
2889
|
+
if (!machine || !declared) {
|
|
2890
|
+
throw new HSIAdmissionError(
|
|
2891
|
+
"unknown-slot",
|
|
2892
|
+
`scenario step ${ordinal}: unknown trigger ${step.machine}.${step.input}`
|
|
2893
|
+
);
|
|
2894
|
+
}
|
|
2895
|
+
machine.triggers.add(step.input);
|
|
2896
|
+
transitions = evaluateTransitions(world, ir);
|
|
2897
|
+
break;
|
|
2898
|
+
}
|
|
2899
|
+
case "fire-event": {
|
|
2900
|
+
const handler = ir.eventHandlers.find((h) => h.event === step.event);
|
|
2901
|
+
if (!handler) {
|
|
2902
|
+
throw new HSIAdmissionError(
|
|
2903
|
+
"unknown-slot",
|
|
2904
|
+
`scenario step ${ordinal}: no handler for event "${step.event}"`
|
|
2905
|
+
);
|
|
2906
|
+
}
|
|
2907
|
+
runEffects(handler.effects, world, effects, emitted);
|
|
2908
|
+
break;
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
const invariantViolations = checkInvariants(world, ir);
|
|
2912
|
+
if (invariantViolations.length > 0) valid = false;
|
|
2913
|
+
steps.push({
|
|
2914
|
+
ordinal,
|
|
2915
|
+
step,
|
|
2916
|
+
transitions,
|
|
2917
|
+
effects,
|
|
2918
|
+
emitted,
|
|
2919
|
+
invariantViolations,
|
|
2920
|
+
stateDigest: snapshot(world).stateDigest
|
|
2921
|
+
});
|
|
2922
|
+
});
|
|
2923
|
+
const final = snapshot(world);
|
|
2924
|
+
const traceWithoutDigest = {
|
|
2925
|
+
schemaVersion: HSI_TRACE_SCHEMA_VERSION,
|
|
2926
|
+
kind: "HSITrace",
|
|
2927
|
+
worldDigest: ir.provenance.deterministicDigest,
|
|
2928
|
+
preconditionResults,
|
|
2929
|
+
initial,
|
|
2930
|
+
steps,
|
|
2931
|
+
final,
|
|
2932
|
+
valid
|
|
2933
|
+
};
|
|
2934
|
+
return { ...traceWithoutDigest, deterministicDigest: hsiSha256(traceWithoutDigest) };
|
|
2935
|
+
}
|
|
2936
|
+
function splitFor(nodeId, worldDigest) {
|
|
2937
|
+
const digest = crypto.createHash("sha256").update(`${nodeId}|${worldDigest}`).digest();
|
|
2938
|
+
return digest[0] % 4 === 0 ? "eval" : "train";
|
|
2939
|
+
}
|
|
2940
|
+
function collectAssignTargets(effects, into, reads) {
|
|
2941
|
+
for (const effect of effects) {
|
|
2942
|
+
if (effect.kind === "assign") {
|
|
2943
|
+
into.add(effect.target);
|
|
2944
|
+
const stack = [effect.value];
|
|
2945
|
+
while (stack.length > 0) {
|
|
2946
|
+
const node = stack.pop();
|
|
2947
|
+
if (node.kind === "Identifier") reads.add(node.name);
|
|
2948
|
+
else if (node.kind === "BinaryExpression") stack.push(node.left, node.right);
|
|
2949
|
+
else if (node.kind === "UnaryExpression") stack.push(node.argument);
|
|
2950
|
+
else if (node.kind === "MemberExpression") stack.push(node.object);
|
|
2951
|
+
else if (node.kind === "CallExpression") stack.push(...node.arguments);
|
|
2952
|
+
}
|
|
2953
|
+
} else if (effect.kind === "branch") {
|
|
2954
|
+
collectAssignTargets(effect.then, into, reads);
|
|
2955
|
+
collectAssignTargets(effect.else, into, reads);
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
function projectLearningGraph(ir) {
|
|
2960
|
+
const worldDigest = ir.provenance.deterministicDigest;
|
|
2961
|
+
const nodes = [];
|
|
2962
|
+
const edges = [];
|
|
2963
|
+
const addNode = (node) => {
|
|
2964
|
+
nodes.push({ ...node, split: splitFor(node.id, worldDigest) });
|
|
2965
|
+
};
|
|
2966
|
+
const addEdge = (edgeType, from, to, label) => {
|
|
2967
|
+
const edge = { id: `edge:${edgeType}:${from}->${to}`, edgeType, from, to };
|
|
2968
|
+
if (label !== void 0) edge.label = label;
|
|
2969
|
+
edges.push(edge);
|
|
2970
|
+
};
|
|
2971
|
+
const worldId = `entity:${ir.world.name}`;
|
|
2972
|
+
addNode({ id: worldId, nodeType: "entity", baseline: null, unknowns: [] });
|
|
2973
|
+
for (const entity of ir.entities) {
|
|
2974
|
+
addNode({
|
|
2975
|
+
id: entity.id,
|
|
2976
|
+
nodeType: "entity",
|
|
2977
|
+
baseline: null,
|
|
2978
|
+
unknowns: entity.opacity === "unknown" ? ["opacity"] : [],
|
|
2979
|
+
sourceSpan: entity.sourceSpan
|
|
2980
|
+
});
|
|
2981
|
+
addEdge("contains", worldId, entity.id);
|
|
2982
|
+
}
|
|
2983
|
+
for (const field of ir.state) {
|
|
2984
|
+
addNode({
|
|
2985
|
+
id: field.id,
|
|
2986
|
+
nodeType: "state",
|
|
2987
|
+
baseline: field.baseline,
|
|
2988
|
+
unknowns: [],
|
|
2989
|
+
sourceSpan: field.sourceSpan
|
|
2990
|
+
});
|
|
2991
|
+
addEdge("contains", worldId, field.id);
|
|
2992
|
+
}
|
|
2993
|
+
for (const rule of ir.observationPolicy) {
|
|
2994
|
+
addNode({
|
|
2995
|
+
id: rule.id,
|
|
2996
|
+
nodeType: "observation",
|
|
2997
|
+
baseline: null,
|
|
2998
|
+
unknowns: rule.access === "unknown" ? ["access"] : []
|
|
2999
|
+
});
|
|
3000
|
+
addEdge("observes", `entity:${rule.observer}`, rule.id, rule.access);
|
|
3001
|
+
addEdge("refers-to", rule.id, `entity:${rule.observed}`);
|
|
3002
|
+
for (const mediator of rule.mediators) {
|
|
3003
|
+
addEdge("refers-to", rule.id, `entity:${mediator}`, "mediator");
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
for (const handler of ir.eventHandlers) {
|
|
3007
|
+
addNode({ id: handler.id, nodeType: "event", baseline: null, unknowns: [], sourceSpan: handler.sourceSpan });
|
|
3008
|
+
const targets = /* @__PURE__ */ new Set();
|
|
3009
|
+
const reads = /* @__PURE__ */ new Set();
|
|
3010
|
+
collectAssignTargets(handler.effects, targets, reads);
|
|
3011
|
+
for (const target of [...targets].sort()) {
|
|
3012
|
+
addEdge("affects", handler.id, `state:world.${target}`);
|
|
3013
|
+
}
|
|
3014
|
+
for (const read of [...reads].sort()) {
|
|
3015
|
+
if (!targets.has(read)) addEdge("requires", handler.id, `state:world.${read}`);
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
for (const machine of ir.machines) {
|
|
3019
|
+
for (const transition of machine.transitions) {
|
|
3020
|
+
addNode({
|
|
3021
|
+
id: transition.id,
|
|
3022
|
+
nodeType: "action",
|
|
3023
|
+
baseline: null,
|
|
3024
|
+
unknowns: [],
|
|
3025
|
+
sourceSpan: transition.sourceSpan
|
|
3026
|
+
});
|
|
3027
|
+
for (const read of transition.reads) {
|
|
3028
|
+
addEdge("requires", transition.id, `input:${machine.name}.${read}`);
|
|
3029
|
+
}
|
|
3030
|
+
addEdge("causes", transition.id, `machineState:${machine.name}.${transition.target}`);
|
|
3031
|
+
if (transition.from !== "any") {
|
|
3032
|
+
addEdge("precedes", `machineState:${machine.name}.${transition.from}`, transition.id);
|
|
3033
|
+
}
|
|
3034
|
+
}
|
|
3035
|
+
for (const stateName of machine.states) {
|
|
3036
|
+
addNode({ id: `machineState:${machine.name}.${stateName}`, nodeType: "state", baseline: null, unknowns: [] });
|
|
3037
|
+
addEdge("contains", worldId, `machineState:${machine.name}.${stateName}`);
|
|
3038
|
+
}
|
|
3039
|
+
for (const input of machine.inputs) {
|
|
3040
|
+
addNode({ id: input.id, nodeType: "state", baseline: input.baseline, unknowns: [] });
|
|
3041
|
+
addEdge("contains", worldId, input.id);
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
for (const predicate of ir.predicates) {
|
|
3045
|
+
addNode({
|
|
3046
|
+
id: predicate.id,
|
|
3047
|
+
nodeType: "objective",
|
|
3048
|
+
baseline: null,
|
|
3049
|
+
unknowns: [],
|
|
3050
|
+
sourceSpan: predicate.sourceSpan
|
|
3051
|
+
});
|
|
3052
|
+
for (const read of predicate.reads) {
|
|
3053
|
+
addEdge("refers-to", predicate.id, `state:world.${read}`);
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
nodes.sort((a, b) => a.id.localeCompare(b.id));
|
|
3057
|
+
edges.sort((a, b) => a.id.localeCompare(b.id));
|
|
3058
|
+
const graphWithoutDigest = {
|
|
3059
|
+
schemaVersion: HSI_LEARNING_GRAPH_SCHEMA_VERSION,
|
|
3060
|
+
kind: "HSILearningGraph",
|
|
3061
|
+
worldDigest,
|
|
3062
|
+
emittedFrom: worldDigest,
|
|
3063
|
+
nodes,
|
|
3064
|
+
edges,
|
|
3065
|
+
interventions: [
|
|
3066
|
+
"intervention:flip-opacity",
|
|
3067
|
+
"intervention:raise-guard-threshold"
|
|
3068
|
+
]
|
|
3069
|
+
};
|
|
3070
|
+
return { ...graphWithoutDigest, deterministicDigest: hsiSha256(graphWithoutDigest) };
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
// src/compiler/HSIAuditVerifier.ts
|
|
3074
|
+
function renamed(name, map) {
|
|
3075
|
+
return map[name] ?? name;
|
|
3076
|
+
}
|
|
3077
|
+
function renameExpression(expr, map) {
|
|
3078
|
+
switch (expr.type) {
|
|
3079
|
+
case "Identifier":
|
|
3080
|
+
expr.name = renamed(expr.name, map);
|
|
3081
|
+
return;
|
|
3082
|
+
case "BinaryExpression":
|
|
3083
|
+
renameExpression(expr.left, map);
|
|
3084
|
+
renameExpression(expr.right, map);
|
|
3085
|
+
return;
|
|
3086
|
+
case "UnaryExpression":
|
|
3087
|
+
renameExpression(expr.argument, map);
|
|
3088
|
+
return;
|
|
3089
|
+
case "MemberExpression":
|
|
3090
|
+
renameExpression(expr.object, map);
|
|
3091
|
+
return;
|
|
3092
|
+
case "CallExpression":
|
|
3093
|
+
renameExpression(expr.callee, map);
|
|
3094
|
+
for (const arg of expr.arguments) renameExpression(arg, map);
|
|
3095
|
+
return;
|
|
3096
|
+
default:
|
|
3097
|
+
return;
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
function renameStatements(statements, map) {
|
|
3101
|
+
for (const stmt of statements) {
|
|
3102
|
+
switch (stmt.type) {
|
|
3103
|
+
case "Assignment": {
|
|
3104
|
+
const target = stmt.target.startsWith("state.") ? stmt.target.slice("state.".length) : stmt.target;
|
|
3105
|
+
const prefix = stmt.target.startsWith("state.") ? "state." : "";
|
|
3106
|
+
stmt.target = `${prefix}${renamed(target, map)}`;
|
|
3107
|
+
renameExpression(stmt.value, map);
|
|
3108
|
+
break;
|
|
3109
|
+
}
|
|
3110
|
+
case "IfStatement":
|
|
3111
|
+
renameExpression(stmt.condition, map);
|
|
3112
|
+
renameStatements(stmt.consequent, map);
|
|
3113
|
+
renameStatements(stmt.alternate ?? [], map);
|
|
3114
|
+
break;
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
function renameRawExpr(expr, map) {
|
|
3119
|
+
return expr.replace(/[A-Za-z_][A-Za-z0-9_]*/g, (token) => renamed(token, map));
|
|
3120
|
+
}
|
|
3121
|
+
function renameComposition(composition, map) {
|
|
3122
|
+
for (const template of composition.templates ?? []) {
|
|
3123
|
+
template.name = renamed(template.name, map);
|
|
3124
|
+
}
|
|
3125
|
+
for (const obj of composition.objects ?? []) {
|
|
3126
|
+
obj.name = renamed(obj.name, map);
|
|
3127
|
+
if (obj.template !== void 0) obj.template = renamed(obj.template, map);
|
|
3128
|
+
}
|
|
3129
|
+
const connections = composition.connections;
|
|
3130
|
+
for (const conn of connections ?? []) {
|
|
3131
|
+
conn.from = renamed(conn.from, map);
|
|
3132
|
+
conn.to = renamed(conn.to, map);
|
|
3133
|
+
}
|
|
3134
|
+
for (const prop of composition.state?.properties ?? []) {
|
|
3135
|
+
prop.key = renamed(prop.key, map);
|
|
3136
|
+
}
|
|
3137
|
+
const logic = composition.logic;
|
|
3138
|
+
for (const handler of logic?.handlers ?? []) {
|
|
3139
|
+
renameStatements(handler.body, map);
|
|
3140
|
+
}
|
|
3141
|
+
for (const machine of composition.stateMachines ?? []) {
|
|
3142
|
+
machine.name = renamed(machine.name, map);
|
|
3143
|
+
machine.initialState = renamed(machine.initialState, map);
|
|
3144
|
+
const renamedStates = {};
|
|
3145
|
+
for (const [stateName, stateNode] of Object.entries(machine.states ?? {})) {
|
|
3146
|
+
stateNode.name = renamed(stateName, map);
|
|
3147
|
+
renamedStates[renamed(stateName, map)] = stateNode;
|
|
3148
|
+
for (const t of stateNode.transitions ?? []) {
|
|
3149
|
+
if (t.from && t.from !== "any") t.from = renamed(t.from, map);
|
|
3150
|
+
t.target = renamed(t.target, map);
|
|
3151
|
+
if (t.condition) renameExpression(t.condition, map);
|
|
3152
|
+
for (const cond of t.conditions ?? []) cond.parameter = renamed(cond.parameter, map);
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
machine.states = renamedStates;
|
|
3156
|
+
for (const input of machine.inputs ?? []) {
|
|
3157
|
+
input.name = renamed(input.name, map);
|
|
3158
|
+
}
|
|
3159
|
+
for (const t of machine.transitions ?? []) {
|
|
3160
|
+
if (t.from && t.from !== "any") t.from = renamed(t.from, map);
|
|
3161
|
+
t.target = renamed(t.target, map);
|
|
3162
|
+
if (t.condition) renameExpression(t.condition, map);
|
|
3163
|
+
for (const cond of t.conditions ?? []) cond.parameter = renamed(cond.parameter, map);
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
if (composition.contract) {
|
|
3167
|
+
for (const clause of [...composition.contract.preconditions, ...composition.contract.invariants]) {
|
|
3168
|
+
clause.expr = renameRawExpr(clause.expr, map);
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
for (const achievement of composition.achievements ?? []) {
|
|
3172
|
+
renameExpression(achievement.condition, map);
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3175
|
+
var ID_TOKEN_PATTERN = /[A-Za-z_][A-Za-z0-9_]*/g;
|
|
3176
|
+
function renameIdString(id, map) {
|
|
3177
|
+
return id.replace(ID_TOKEN_PATTERN, (token) => renamed(token, map));
|
|
3178
|
+
}
|
|
3179
|
+
function renameTrace(trace, map) {
|
|
3180
|
+
const renameSnapshot = (snap) => {
|
|
3181
|
+
const state = {};
|
|
3182
|
+
for (const [key, value] of Object.entries(snap.state)) state[renamed(key, map)] = value;
|
|
3183
|
+
const machineStates = {};
|
|
3184
|
+
for (const [machine, current] of Object.entries(snap.machineStates)) {
|
|
3185
|
+
machineStates[renamed(machine, map)] = renamed(current, map);
|
|
3186
|
+
}
|
|
3187
|
+
return { state, machineStates, stateDigest: hsiSha256({ state: sortRecord(state), machineStates: sortRecord(machineStates) }) };
|
|
3188
|
+
};
|
|
3189
|
+
const sortRecord = (record) => {
|
|
3190
|
+
const out = {};
|
|
3191
|
+
for (const key of Object.keys(record).sort()) out[key] = record[key];
|
|
3192
|
+
return out;
|
|
3193
|
+
};
|
|
3194
|
+
const stepsRenamed = trace.steps.map((step) => {
|
|
3195
|
+
const scenario = step.step.kind === "fire-event" ? step.step : step.step.kind === "set-input" ? { kind: "set-input", machine: renamed(step.step.machine, map), input: renamed(step.step.input, map), value: step.step.value } : { kind: "fire-trigger", machine: renamed(step.step.machine, map), input: renamed(step.step.input, map) };
|
|
3196
|
+
return {
|
|
3197
|
+
...step,
|
|
3198
|
+
step: scenario,
|
|
3199
|
+
transitions: step.transitions.map((t) => ({
|
|
3200
|
+
machine: renamed(t.machine, map),
|
|
3201
|
+
transitionId: renameIdString(t.transitionId, map),
|
|
3202
|
+
from: renamed(t.from, map),
|
|
3203
|
+
to: renamed(t.to, map)
|
|
3204
|
+
})),
|
|
3205
|
+
effects: step.effects.map((e) => ({ ...e, target: renamed(e.target, map), sourceId: renameIdString(e.sourceId, map) })),
|
|
3206
|
+
invariantViolations: step.invariantViolations.map((id) => renameIdString(id, map)),
|
|
3207
|
+
stateDigest: ""
|
|
3208
|
+
};
|
|
3209
|
+
});
|
|
3210
|
+
const initial = renameSnapshot(trace.initial);
|
|
3211
|
+
const final = renameSnapshot(trace.final);
|
|
3212
|
+
const traceWithoutDigest = {
|
|
3213
|
+
schemaVersion: trace.schemaVersion,
|
|
3214
|
+
kind: trace.kind,
|
|
3215
|
+
worldDigest: "",
|
|
3216
|
+
preconditionResults: trace.preconditionResults.map((r) => ({ id: renameIdString(r.id, map), holds: r.holds })),
|
|
3217
|
+
initial,
|
|
3218
|
+
steps: stepsRenamed,
|
|
3219
|
+
final,
|
|
3220
|
+
valid: trace.valid
|
|
3221
|
+
};
|
|
3222
|
+
return { ...traceWithoutDigest, deterministicDigest: "" };
|
|
3223
|
+
}
|
|
3224
|
+
function behavioralProjection(trace) {
|
|
3225
|
+
return {
|
|
3226
|
+
preconditionResults: trace.preconditionResults,
|
|
3227
|
+
initial: { state: trace.initial.state, machineStates: trace.initial.machineStates },
|
|
3228
|
+
steps: trace.steps.map((s) => ({
|
|
3229
|
+
ordinal: s.ordinal,
|
|
3230
|
+
step: s.step,
|
|
3231
|
+
transitions: s.transitions,
|
|
3232
|
+
effects: s.effects,
|
|
3233
|
+
emitted: s.emitted,
|
|
3234
|
+
invariantViolations: s.invariantViolations
|
|
3235
|
+
})),
|
|
3236
|
+
final: { state: trace.final.state, machineStates: trace.final.machineStates },
|
|
3237
|
+
valid: trace.valid
|
|
3238
|
+
};
|
|
3239
|
+
}
|
|
3240
|
+
function reorderComposition(composition) {
|
|
3241
|
+
composition.templates = [...composition.templates ?? []].reverse();
|
|
3242
|
+
composition.objects = [...composition.objects ?? []].reverse();
|
|
3243
|
+
const holder = composition;
|
|
3244
|
+
if (holder.connections) holder.connections = [...holder.connections].reverse();
|
|
3245
|
+
if (composition.state?.properties) {
|
|
3246
|
+
composition.state.properties = [...composition.state.properties].reverse();
|
|
3247
|
+
}
|
|
3248
|
+
if (composition.contract) {
|
|
3249
|
+
composition.contract.invariants = [...composition.contract.invariants].reverse();
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
function applyIntervention(composition, intervention) {
|
|
3253
|
+
if (intervention.kind === "set-opacity") {
|
|
3254
|
+
const obj = (composition.objects ?? []).find((o) => o.name === intervention.entity);
|
|
3255
|
+
if (!obj) {
|
|
3256
|
+
throw new HSIAdmissionError("admission-skewed", `intervention targets unknown entity "${intervention.entity}"`);
|
|
3257
|
+
}
|
|
3258
|
+
const existing = obj.properties.findIndex((p) => p.key === "opaque");
|
|
3259
|
+
if (existing >= 0) obj.properties.splice(existing, 1);
|
|
3260
|
+
if (intervention.opaque !== void 0) {
|
|
3261
|
+
obj.properties.push({ type: "ObjectProperty", key: "opaque", value: intervention.opaque });
|
|
3262
|
+
} else {
|
|
3263
|
+
const template = (composition.templates ?? []).find((t) => t.name === obj.template);
|
|
3264
|
+
if (template) {
|
|
3265
|
+
template.properties = (template.properties ?? []).filter((p) => p.key !== "opaque");
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
return;
|
|
3269
|
+
}
|
|
3270
|
+
const machine = (composition.stateMachines ?? []).find((m) => m.name === intervention.machine);
|
|
3271
|
+
if (!machine) {
|
|
3272
|
+
throw new HSIAdmissionError("admission-skewed", `intervention targets unknown machine "${intervention.machine}"`);
|
|
3273
|
+
}
|
|
3274
|
+
const transitions = [
|
|
3275
|
+
...machine.transitions ?? [],
|
|
3276
|
+
...Object.values(machine.states ?? {}).flatMap((s) => s.transitions ?? [])
|
|
3277
|
+
];
|
|
3278
|
+
const transition = transitions.find(
|
|
3279
|
+
(t) => (t.from ?? "") === intervention.fromState && t.target === intervention.toState
|
|
3280
|
+
);
|
|
3281
|
+
if (!transition) {
|
|
3282
|
+
throw new HSIAdmissionError(
|
|
3283
|
+
"admission-skewed",
|
|
3284
|
+
`intervention targets unknown transition ${intervention.fromState} -> ${intervention.toState}`
|
|
3285
|
+
);
|
|
3286
|
+
}
|
|
3287
|
+
if (transition.condition?.type === "BinaryExpression" && transition.condition.right.type === "Literal") {
|
|
3288
|
+
transition.condition.right.value = intervention.value;
|
|
3289
|
+
}
|
|
3290
|
+
for (const cond of transition.conditions ?? []) {
|
|
3291
|
+
if (typeof cond.value === "number") cond.value = intervention.value;
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
function generateAuditCases(ir) {
|
|
3295
|
+
const cases = [
|
|
3296
|
+
{
|
|
3297
|
+
id: "audit:admission-empty",
|
|
3298
|
+
kind: "admission-empty",
|
|
3299
|
+
description: "An empty composition (no entities, no state) must fail admission.",
|
|
3300
|
+
expectation: "HSIAdmissionError(empty-world)"
|
|
3301
|
+
},
|
|
3302
|
+
{
|
|
3303
|
+
id: "audit:admission-missing-archetype",
|
|
3304
|
+
kind: "admission-skewed",
|
|
3305
|
+
description: "An object using an undeclared template must fail admission.",
|
|
3306
|
+
expectation: "HSIAdmissionError(unknown-archetype)"
|
|
3307
|
+
},
|
|
3308
|
+
{
|
|
3309
|
+
id: "audit:admission-dangling-relation",
|
|
3310
|
+
kind: "admission-skewed",
|
|
3311
|
+
description: "A connection to an undeclared entity must fail admission.",
|
|
3312
|
+
expectation: "HSIAdmissionError(unknown-relation-endpoint)"
|
|
3313
|
+
},
|
|
3314
|
+
{
|
|
3315
|
+
id: "audit:alpha-rename",
|
|
3316
|
+
kind: "alpha-rename",
|
|
3317
|
+
description: "Consistent renaming of declared names preserves behavior (trace modulo names).",
|
|
3318
|
+
expectation: "behavioralProjection(renameTrace(base)) === behavioralProjection(trace(renamed))"
|
|
3319
|
+
},
|
|
3320
|
+
{
|
|
3321
|
+
id: "audit:declaration-reorder",
|
|
3322
|
+
kind: "declaration-reorder",
|
|
3323
|
+
description: "Reordering independent declarations yields a byte-identical IR.",
|
|
3324
|
+
expectation: "deterministicDigest(base) === deterministicDigest(reordered)"
|
|
3325
|
+
},
|
|
3326
|
+
{
|
|
3327
|
+
id: "audit:regenerate-determinism",
|
|
3328
|
+
kind: "regenerate-determinism",
|
|
3329
|
+
description: "Re-lowering and re-tracing from the same source is byte-identical.",
|
|
3330
|
+
expectation: "all artifact digests equal across two independent regenerations"
|
|
3331
|
+
}
|
|
3332
|
+
];
|
|
3333
|
+
const opaqueMediator = ir.entities.find(
|
|
3334
|
+
(e) => e.opacity === "opaque" && ir.observationPolicy.some((r) => r.mediators.includes(e.name) && r.access === "blocked")
|
|
3335
|
+
);
|
|
3336
|
+
if (opaqueMediator) {
|
|
3337
|
+
cases.push({
|
|
3338
|
+
id: "audit:counterfactual-opacity",
|
|
3339
|
+
kind: "counterfactual-intervention",
|
|
3340
|
+
description: `Making "${opaqueMediator.name}" transparent must change at least one observation access verdict.`,
|
|
3341
|
+
intervention: { kind: "set-opacity", id: "intervention:flip-opacity", entity: opaqueMediator.name, opacity: "transparent" },
|
|
3342
|
+
expectation: "observationPolicy access verdicts differ from base IR"
|
|
3343
|
+
});
|
|
3344
|
+
}
|
|
3345
|
+
const guardedTransition = ir.machines.flatMap((m) => m.transitions.map((t) => ({ machine: m.name, t }))).find(({ t }) => t.guard?.kind === "BinaryExpression" && t.guard.right.kind === "Literal" && typeof t.guard.right.value === "number");
|
|
3346
|
+
if (guardedTransition) {
|
|
3347
|
+
cases.push({
|
|
3348
|
+
id: "audit:counterfactual-guard",
|
|
3349
|
+
kind: "counterfactual-intervention",
|
|
3350
|
+
description: `Raising the numeric guard of ${guardedTransition.t.id} beyond scenario inputs must change the exact trace.`,
|
|
3351
|
+
intervention: {
|
|
3352
|
+
kind: "set-transition-guard-literal",
|
|
3353
|
+
id: "intervention:raise-guard-threshold",
|
|
3354
|
+
machine: guardedTransition.machine,
|
|
3355
|
+
transitionId: guardedTransition.t.id,
|
|
3356
|
+
value: 1e6
|
|
3357
|
+
},
|
|
3358
|
+
expectation: "trace deterministicDigest differs and at least one step fires different transitions"
|
|
3359
|
+
});
|
|
3360
|
+
}
|
|
3361
|
+
return cases;
|
|
3362
|
+
}
|
|
3363
|
+
function clone(value) {
|
|
3364
|
+
return structuredClone(value);
|
|
3365
|
+
}
|
|
3366
|
+
function expectAdmissionFailure(fn, expectedCode) {
|
|
3367
|
+
try {
|
|
3368
|
+
fn();
|
|
3369
|
+
return "fail";
|
|
3370
|
+
} catch (error) {
|
|
3371
|
+
return error instanceof HSIAdmissionError && error.code === expectedCode ? "pass" : "fail";
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
function runHSIAudit(input) {
|
|
3375
|
+
const { composition, sourceText, scenario, renameMap } = input;
|
|
3376
|
+
const baseIR = lowerCompositionToHSIIR(clone(composition), { sourceText });
|
|
3377
|
+
const baseTrace = runExactTrace(baseIR, scenario);
|
|
3378
|
+
const cases = generateAuditCases(baseIR);
|
|
3379
|
+
const checks = [];
|
|
3380
|
+
for (const auditCase of cases) {
|
|
3381
|
+
let status = "fail";
|
|
3382
|
+
let detail = auditCase.expectation;
|
|
3383
|
+
try {
|
|
3384
|
+
switch (auditCase.id) {
|
|
3385
|
+
case "audit:admission-empty": {
|
|
3386
|
+
const empty = {
|
|
3387
|
+
...clone(composition),
|
|
3388
|
+
name: "EmptyWorld",
|
|
3389
|
+
templates: [],
|
|
3390
|
+
objects: [],
|
|
3391
|
+
state: void 0,
|
|
3392
|
+
stateMachines: [],
|
|
3393
|
+
contract: void 0,
|
|
3394
|
+
achievements: []
|
|
3395
|
+
};
|
|
3396
|
+
empty.connections = [];
|
|
3397
|
+
empty.logic = void 0;
|
|
3398
|
+
status = expectAdmissionFailure(() => lowerCompositionToHSIIR(empty), "empty-world");
|
|
3399
|
+
break;
|
|
3400
|
+
}
|
|
3401
|
+
case "audit:admission-missing-archetype": {
|
|
3402
|
+
const skewed = clone(composition);
|
|
3403
|
+
if (skewed.objects.length === 0) throw new Error("fixture has no objects");
|
|
3404
|
+
skewed.objects[0].template = "GhostTemplate";
|
|
3405
|
+
status = expectAdmissionFailure(() => lowerCompositionToHSIIR(skewed), "unknown-archetype");
|
|
3406
|
+
break;
|
|
3407
|
+
}
|
|
3408
|
+
case "audit:admission-dangling-relation": {
|
|
3409
|
+
const skewed = clone(composition);
|
|
3410
|
+
const holder = skewed;
|
|
3411
|
+
holder.connections = [...holder.connections ?? [], { from: "NoSuchEntity", to: "AlsoMissing" }];
|
|
3412
|
+
status = expectAdmissionFailure(() => lowerCompositionToHSIIR(skewed), "unknown-relation-endpoint");
|
|
3413
|
+
break;
|
|
3414
|
+
}
|
|
3415
|
+
case "audit:alpha-rename": {
|
|
3416
|
+
const renamedComposition = clone(composition);
|
|
3417
|
+
renameComposition(renamedComposition, renameMap);
|
|
3418
|
+
const renamedIR = lowerCompositionToHSIIR(renamedComposition);
|
|
3419
|
+
const renamedScenario = scenario.map(
|
|
3420
|
+
(step) => step.kind === "fire-event" ? step : step.kind === "set-input" ? { ...step, machine: renameMap[step.machine] ?? step.machine, input: renameMap[step.input] ?? step.input } : { ...step, machine: renameMap[step.machine] ?? step.machine, input: renameMap[step.input] ?? step.input }
|
|
3421
|
+
);
|
|
3422
|
+
const renamedTrace = runExactTrace(renamedIR, renamedScenario);
|
|
3423
|
+
const expected = hsiStableStringify(behavioralProjection(renameTrace(baseTrace, renameMap)));
|
|
3424
|
+
const actual = hsiStableStringify(behavioralProjection(renamedTrace));
|
|
3425
|
+
status = expected === actual ? "pass" : "fail";
|
|
3426
|
+
if (status === "fail") detail = "renamed trace diverged from rename-projected base trace";
|
|
3427
|
+
break;
|
|
3428
|
+
}
|
|
3429
|
+
case "audit:declaration-reorder": {
|
|
3430
|
+
const reordered = clone(composition);
|
|
3431
|
+
reorderComposition(reordered);
|
|
3432
|
+
const reorderedIR = lowerCompositionToHSIIR(reordered, { sourceText });
|
|
3433
|
+
status = reorderedIR.provenance.deterministicDigest === baseIR.provenance.deterministicDigest ? "pass" : "fail";
|
|
3434
|
+
if (status === "fail") detail = "reordered IR digest differs from base IR digest";
|
|
3435
|
+
break;
|
|
3436
|
+
}
|
|
3437
|
+
case "audit:regenerate-determinism": {
|
|
3438
|
+
const secondIR = lowerCompositionToHSIIR(clone(composition), { sourceText });
|
|
3439
|
+
const secondTrace = runExactTrace(secondIR, scenario);
|
|
3440
|
+
status = secondIR.provenance.deterministicDigest === baseIR.provenance.deterministicDigest && secondTrace.deterministicDigest === baseTrace.deterministicDigest ? "pass" : "fail";
|
|
3441
|
+
if (status === "fail") detail = "regeneration produced different digests";
|
|
3442
|
+
break;
|
|
3443
|
+
}
|
|
3444
|
+
case "audit:counterfactual-opacity": {
|
|
3445
|
+
const intervention = auditCase.intervention;
|
|
3446
|
+
if (intervention.kind !== "set-opacity") throw new Error("case/intervention mismatch");
|
|
3447
|
+
const intervened = clone(composition);
|
|
3448
|
+
applyIntervention(intervened, {
|
|
3449
|
+
id: intervention.id,
|
|
3450
|
+
kind: "set-opacity",
|
|
3451
|
+
entity: intervention.entity,
|
|
3452
|
+
opaque: intervention.opacity === "opaque" ? true : intervention.opacity === "transparent" ? false : void 0
|
|
3453
|
+
});
|
|
3454
|
+
const intervenedIR = lowerCompositionToHSIIR(intervened);
|
|
3455
|
+
const baseAccess = hsiStableStringify(baseIR.observationPolicy);
|
|
3456
|
+
const newAccess = hsiStableStringify(intervenedIR.observationPolicy);
|
|
3457
|
+
status = baseAccess !== newAccess ? "pass" : "fail";
|
|
3458
|
+
if (status === "fail") detail = "opacity intervention did not change any observation verdict";
|
|
3459
|
+
break;
|
|
3460
|
+
}
|
|
3461
|
+
case "audit:counterfactual-guard": {
|
|
3462
|
+
const intervention = auditCase.intervention;
|
|
3463
|
+
if (intervention.kind !== "set-transition-guard-literal") throw new Error("case/intervention mismatch");
|
|
3464
|
+
const parsed = /transition:([^.]+)\.([^-]+)->([^#]+)#/.exec(intervention.transitionId);
|
|
3465
|
+
if (!parsed) throw new Error(`unparseable transition id ${intervention.transitionId}`);
|
|
3466
|
+
const intervened = clone(composition);
|
|
3467
|
+
applyIntervention(intervened, {
|
|
3468
|
+
id: intervention.id,
|
|
3469
|
+
kind: "set-guard-literal",
|
|
3470
|
+
machine: parsed[1],
|
|
3471
|
+
fromState: parsed[2],
|
|
3472
|
+
toState: parsed[3],
|
|
3473
|
+
value: intervention.value
|
|
3474
|
+
});
|
|
3475
|
+
const intervenedIR = lowerCompositionToHSIIR(intervened);
|
|
3476
|
+
const intervenedTrace = runExactTrace(intervenedIR, scenario);
|
|
3477
|
+
const digestDiffers = intervenedTrace.deterministicDigest !== baseTrace.deterministicDigest;
|
|
3478
|
+
const stepDiffers = baseTrace.steps.some(
|
|
3479
|
+
(step, i) => hsiStableStringify(step.transitions) !== hsiStableStringify(intervenedTrace.steps[i]?.transitions)
|
|
3480
|
+
);
|
|
3481
|
+
status = digestDiffers && stepDiffers ? "pass" : "fail";
|
|
3482
|
+
if (status === "fail") detail = "guard intervention did not change the exact trace";
|
|
3483
|
+
break;
|
|
3484
|
+
}
|
|
3485
|
+
default:
|
|
3486
|
+
detail = `unrecognized audit case ${auditCase.id}`;
|
|
3487
|
+
}
|
|
3488
|
+
} catch (error) {
|
|
3489
|
+
status = "fail";
|
|
3490
|
+
detail = `${detail} \u2014 threw: ${error.message}`;
|
|
3491
|
+
}
|
|
3492
|
+
checks.push({ caseId: auditCase.id, status, detail });
|
|
3493
|
+
}
|
|
3494
|
+
const overall = checks.every((c) => c.status === "pass") ? "pass" : "fail";
|
|
3495
|
+
const manifestWithoutDigest = {
|
|
3496
|
+
schemaVersion: HSI_AUDIT_SCHEMA_VERSION,
|
|
3497
|
+
kind: "HSIAuditManifest",
|
|
3498
|
+
worldDigest: baseIR.provenance.deterministicDigest,
|
|
3499
|
+
verifier: "HSIAuditVerifier",
|
|
3500
|
+
checks,
|
|
3501
|
+
overall
|
|
3502
|
+
};
|
|
3503
|
+
return { ...manifestWithoutDigest, deterministicDigest: hsiSha256(manifestWithoutDigest) };
|
|
3504
|
+
}
|
|
3505
|
+
|
|
3506
|
+
// src/compiler/index.ts
|
|
1569
3507
|
chunkTZCFKZ6Z_cjs.init_PlatformConditionalCompilerMixin();
|
|
1570
3508
|
|
|
1571
3509
|
// src/compiler/authority/AuthoritySymbolGraph.ts
|
|
@@ -2782,13 +4720,13 @@ function byzantineResilientMerge(agentDags, ledger, options = {}) {
|
|
|
2782
4720
|
}
|
|
2783
4721
|
|
|
2784
4722
|
// src/compiler/index.ts
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
4723
|
+
chunkPHLNABJD_cjs.init_NodeServiceCompiler();
|
|
4724
|
+
chunkPHLNABJD_cjs.init_SDKCompiler();
|
|
4725
|
+
chunkPHLNABJD_cjs.init_LlamaServerCompiler();
|
|
4726
|
+
chunkPHLNABJD_cjs.init_holoscript_gbnf();
|
|
4727
|
+
chunkPHLNABJD_cjs.init_DialectRegistry();
|
|
4728
|
+
chunkPHLNABJD_cjs.init_registerBuiltinDialects();
|
|
4729
|
+
chunkPHLNABJD_cjs.init_PCGGraphCompiler();
|
|
2792
4730
|
|
|
2793
4731
|
// src/compiler/dispatch/DispatchPolicy.ts
|
|
2794
4732
|
var DispatchTier = /* @__PURE__ */ ((DispatchTier2) => {
|
|
@@ -3162,7 +5100,7 @@ async function runTier3CpuDirectExecutor(op) {
|
|
|
3162
5100
|
}
|
|
3163
5101
|
async function runTier1BrowserSnn(op) {
|
|
3164
5102
|
try {
|
|
3165
|
-
const snnWebgpu = await import('../dist-
|
|
5103
|
+
const snnWebgpu = await import('../dist-YGATNURH.cjs');
|
|
3166
5104
|
const { GPUContext, LIFSimulator, DEFAULT_LIF_PARAMS } = snnWebgpu;
|
|
3167
5105
|
const ctx = new GPUContext();
|
|
3168
5106
|
await ctx.initialize();
|
|
@@ -3267,8 +5205,8 @@ async function sha256Hex(input) {
|
|
|
3267
5205
|
const digest = await subtle.digest("SHA-256", new TextEncoder().encode(input));
|
|
3268
5206
|
return bytesToHex(new Uint8Array(digest));
|
|
3269
5207
|
}
|
|
3270
|
-
const { createHash } = await import('crypto');
|
|
3271
|
-
return
|
|
5208
|
+
const { createHash: createHash4 } = await import('crypto');
|
|
5209
|
+
return createHash4("sha256").update(input).digest("hex");
|
|
3272
5210
|
}
|
|
3273
5211
|
function bytesToHex(bytes) {
|
|
3274
5212
|
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
@@ -3615,16 +5553,16 @@ function formatTierCounts(counts) {
|
|
|
3615
5553
|
}
|
|
3616
5554
|
|
|
3617
5555
|
// src/compiler/TraitRegistryBridge.ts
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
5556
|
+
chunkQKLEDRHN_cjs.init_AndroidXRTraitMap();
|
|
5557
|
+
chunkJ74S4ZMF_cjs.init_VisionOSTraitMap();
|
|
5558
|
+
chunk7FYSSI3C_cjs.init_traitDocs();
|
|
3621
5559
|
function normaliseTraitName(name) {
|
|
3622
5560
|
return name.toLowerCase().replace(/^@/, "").replace(/trait$/i, "").replace(/_/g, "-").trim();
|
|
3623
5561
|
}
|
|
3624
5562
|
function queryTrait(name, opts = {}) {
|
|
3625
5563
|
const target = opts.target || "core";
|
|
3626
5564
|
if (target === "android-xr") {
|
|
3627
|
-
const map =
|
|
5565
|
+
const map = chunkQKLEDRHN_cjs.getTraitMapping(name);
|
|
3628
5566
|
if (map) {
|
|
3629
5567
|
return {
|
|
3630
5568
|
name,
|
|
@@ -3636,7 +5574,7 @@ function queryTrait(name, opts = {}) {
|
|
|
3636
5574
|
}
|
|
3637
5575
|
}
|
|
3638
5576
|
if (target === "visionos") {
|
|
3639
|
-
const map =
|
|
5577
|
+
const map = chunkJ74S4ZMF_cjs.getTraitMapping(name);
|
|
3640
5578
|
if (map) {
|
|
3641
5579
|
return {
|
|
3642
5580
|
name,
|
|
@@ -3649,9 +5587,9 @@ function queryTrait(name, opts = {}) {
|
|
|
3649
5587
|
return { name, exists: false, sourceMap: "VisionOSTraitMap" };
|
|
3650
5588
|
}
|
|
3651
5589
|
const normalised = normaliseTraitName(name);
|
|
3652
|
-
if (
|
|
3653
|
-
const handler =
|
|
3654
|
-
const doc2 =
|
|
5590
|
+
if (chunkX5ZLSPU2_cjs.vrTraitRegistry.has(normalised)) {
|
|
5591
|
+
const handler = chunkX5ZLSPU2_cjs.vrTraitRegistry.getHandler(normalised);
|
|
5592
|
+
const doc2 = chunk7FYSSI3C_cjs.getTraitDoc(name);
|
|
3655
5593
|
return {
|
|
3656
5594
|
name,
|
|
3657
5595
|
exists: true,
|
|
@@ -3662,7 +5600,7 @@ function queryTrait(name, opts = {}) {
|
|
|
3662
5600
|
annotation: doc2?.annotation
|
|
3663
5601
|
};
|
|
3664
5602
|
}
|
|
3665
|
-
const doc =
|
|
5603
|
+
const doc = chunk7FYSSI3C_cjs.getTraitDoc(name);
|
|
3666
5604
|
if (doc) {
|
|
3667
5605
|
return {
|
|
3668
5606
|
name,
|
|
@@ -3681,12 +5619,12 @@ function queryTrait(name, opts = {}) {
|
|
|
3681
5619
|
}
|
|
3682
5620
|
function generateTraitForTarget(name, target, config = {}) {
|
|
3683
5621
|
if (target === "android-xr" || target === "android") {
|
|
3684
|
-
return
|
|
5622
|
+
return chunkQKLEDRHN_cjs.getTraitMapping(name)?.generate?.(name, config) ?? [
|
|
3685
5623
|
`// @${name} not yet mapped for android-xr (see AndroidXRTraitMap)`
|
|
3686
5624
|
];
|
|
3687
5625
|
}
|
|
3688
5626
|
if (target === "visionos") {
|
|
3689
|
-
return
|
|
5627
|
+
return chunkJ74S4ZMF_cjs.generateTraitCode(name, name, config) ?? [
|
|
3690
5628
|
`// @${name} not yet mapped for visionos (see VisionOSTraitMap)`
|
|
3691
5629
|
];
|
|
3692
5630
|
}
|
|
@@ -3701,22 +5639,22 @@ function generateTraitForTarget(name, target, config = {}) {
|
|
|
3701
5639
|
}
|
|
3702
5640
|
function listTraitsForTarget(target) {
|
|
3703
5641
|
if (target === "android-xr") {
|
|
3704
|
-
return Object.keys(
|
|
5642
|
+
return Object.keys(chunkQKLEDRHN_cjs.ANDROIDXR_TRAIT_MAP);
|
|
3705
5643
|
}
|
|
3706
5644
|
if (target === "visionos") {
|
|
3707
|
-
return
|
|
5645
|
+
return chunkJ74S4ZMF_cjs.listAllTraits ? chunkJ74S4ZMF_cjs.listAllTraits() : [];
|
|
3708
5646
|
}
|
|
3709
5647
|
if (target === "core") {
|
|
3710
5648
|
const seen = /* @__PURE__ */ new Set();
|
|
3711
5649
|
const result = [];
|
|
3712
|
-
for (const name of
|
|
5650
|
+
for (const name of chunkX5ZLSPU2_cjs.vrTraitRegistry.getRegisteredTraits()) {
|
|
3713
5651
|
const norm = normaliseTraitName(name);
|
|
3714
5652
|
if (!seen.has(norm)) {
|
|
3715
5653
|
seen.add(norm);
|
|
3716
5654
|
result.push(name);
|
|
3717
5655
|
}
|
|
3718
5656
|
}
|
|
3719
|
-
for (const annotation of
|
|
5657
|
+
for (const annotation of chunk7FYSSI3C_cjs.getAllTraitNames()) {
|
|
3720
5658
|
const norm = normaliseTraitName(annotation);
|
|
3721
5659
|
if (!seen.has(norm)) {
|
|
3722
5660
|
seen.add(norm);
|
|
@@ -3729,17 +5667,17 @@ function listTraitsForTarget(target) {
|
|
|
3729
5667
|
}
|
|
3730
5668
|
function traitExists(name) {
|
|
3731
5669
|
const normalised = normaliseTraitName(name);
|
|
3732
|
-
if (
|
|
5670
|
+
if (chunkX5ZLSPU2_cjs.vrTraitRegistry.has(normalised)) {
|
|
3733
5671
|
return true;
|
|
3734
5672
|
}
|
|
3735
|
-
const doc =
|
|
5673
|
+
const doc = chunk7FYSSI3C_cjs.getTraitDoc(name);
|
|
3736
5674
|
if (doc) {
|
|
3737
5675
|
return true;
|
|
3738
5676
|
}
|
|
3739
|
-
if (
|
|
5677
|
+
if (chunkQKLEDRHN_cjs.getTraitMapping(name)) {
|
|
3740
5678
|
return true;
|
|
3741
5679
|
}
|
|
3742
|
-
if (
|
|
5680
|
+
if (chunkJ74S4ZMF_cjs.getTraitMapping(name)) {
|
|
3743
5681
|
return true;
|
|
3744
5682
|
}
|
|
3745
5683
|
return false;
|
|
@@ -3827,7 +5765,7 @@ function getAllManifests() {
|
|
|
3827
5765
|
}
|
|
3828
5766
|
|
|
3829
5767
|
// src/compiler/platform/plugins/WebGPUWGSLPlugin.ts
|
|
3830
|
-
|
|
5768
|
+
chunkU6CQOM5Q_cjs.init_WebGPUCompiler();
|
|
3831
5769
|
var WEBGPU_WGSL_METADATA = {
|
|
3832
5770
|
name: "holoscript-plugin-webgpu-wgsl",
|
|
3833
5771
|
version: "1.0.0",
|
|
@@ -3856,7 +5794,7 @@ var WebGPUWGSLPlugin = class {
|
|
|
3856
5794
|
switch (target) {
|
|
3857
5795
|
case "web": {
|
|
3858
5796
|
try {
|
|
3859
|
-
const compiler = new
|
|
5797
|
+
const compiler = new chunkU6CQOM5Q_cjs.WebGPUCompiler({ enableCompute: true });
|
|
3860
5798
|
const result = compiler.compile(ast, "");
|
|
3861
5799
|
return { type: "text", data: result };
|
|
3862
5800
|
} catch (err) {
|
|
@@ -3950,7 +5888,7 @@ var WebGPUWGSLPlugin = class {
|
|
|
3950
5888
|
platformPluginRegistry.register(new WebGPUWGSLPlugin());
|
|
3951
5889
|
|
|
3952
5890
|
// src/compiler/platform/plugins/AndroidARCorePlugin.ts
|
|
3953
|
-
|
|
5891
|
+
chunkQKLEDRHN_cjs.init_AndroidXRCompiler();
|
|
3954
5892
|
var ANDROID_ARCORE_METADATA = {
|
|
3955
5893
|
name: "holoscript-plugin-android-arcore",
|
|
3956
5894
|
version: "1.0.0",
|
|
@@ -3981,7 +5919,7 @@ var AndroidARCorePlugin = class {
|
|
|
3981
5919
|
case "android-xr":
|
|
3982
5920
|
case "android-xr-ar": {
|
|
3983
5921
|
try {
|
|
3984
|
-
const compiler = new
|
|
5922
|
+
const compiler = new chunkQKLEDRHN_cjs.AndroidXRCompiler({
|
|
3985
5923
|
formFactor: target === "android-xr-ar" ? "glasses" : "headset"
|
|
3986
5924
|
});
|
|
3987
5925
|
const result = compiler.compile(ast, "apl-plugin-token");
|
|
@@ -4081,6 +6019,18 @@ platformPluginRegistry.register(new AndroidARCorePlugin());
|
|
|
4081
6019
|
var SOVEREIGN_TARGETS = [
|
|
4082
6020
|
"webgpu",
|
|
4083
6021
|
// WebGPUCompiler → WGSL compute+render shaders on our own WebGPU device (WebGPURenderer)
|
|
6022
|
+
"audio",
|
|
6023
|
+
// SpatialAudioCompiler → our own Web Audio graph (HRTF PannerNode + Convolver reverb + filters); no third-party audio engine
|
|
6024
|
+
"desktop-gpu",
|
|
6025
|
+
// DesktopGPUCompiler → standalone Rust wgpu project (Vulkan/Metal/DX12), renders the scene offscreen on the machine's own GPU; no browser, no third-party engine. Verified on Jetson Orin/Vulkan.
|
|
6026
|
+
"pathtrace",
|
|
6027
|
+
// PathTracerCompiler → standalone Rust wgpu COMPUTE path tracer (cosine-weighted GI, emissive area lights, multi-sample) → tonemapped PNG; our own tracer, no Cycles/OptiX. Verified on Jetson Orin/Vulkan.
|
|
6028
|
+
"pathtrace-cpu",
|
|
6029
|
+
// CpuPathTracer → the no-GPU fallback: pure-TS CPU path tracer (same algorithm + shared scene extraction) → PNG. Runs offline GI anywhere Node/JS runs (server/CI/old device). The "runs anywhere / no-WebGPU compute fallback" gap.
|
|
6030
|
+
"media",
|
|
6031
|
+
// MediaPipelineCompiler → renders an animated turntable of the scene (CPU) and encodes it to an APNG with our OWN encoder (node:zlib only, no ffmpeg/codec/muxer). The video/media-pipeline gap; a moving picture from a .holo.
|
|
6032
|
+
"physics-sim",
|
|
6033
|
+
// ComputePhysicsCompiler → WGSL COMPUTE rigid-body solver (gravity + sphere/sphere + sphere/AABB collisions, restitution, double-buffered) that steps on the GPU + renders the settled state. Our own solver, no third-party physics engine. Consumes the collider vocabulary; the DYNAMICS layer on top of PhysicsColliderCompiler. Verified on Jetson Orin/Vulkan.
|
|
4084
6034
|
"character-webgpu",
|
|
4085
6035
|
// CharacterWebGPUCompiler → authored .holo character → CharacterDrawSpec run by our renderCharacter (sovereign skinned-character path)
|
|
4086
6036
|
"nir",
|
|
@@ -4122,6 +6072,8 @@ var BRIDGE_TARGETS = [
|
|
|
4122
6072
|
// Meta Quest (Horizon OS / Meta Spatial SDK) — emits a native Kotlin app to Meta's runtime
|
|
4123
6073
|
"ios",
|
|
4124
6074
|
"visionos",
|
|
6075
|
+
"r3f",
|
|
6076
|
+
// SceneIR -> generated TSX shell consumed by React Three Fiber; HoloScript owns SceneIR, R3F is the host runtime bridge
|
|
4125
6077
|
"usd",
|
|
4126
6078
|
"usdz",
|
|
4127
6079
|
"fmu",
|
|
@@ -4302,40 +6254,100 @@ var SOVEREIGN_ENGINES = [
|
|
|
4302
6254
|
tests: true,
|
|
4303
6255
|
promoted: false,
|
|
4304
6256
|
note: "Signed-distance-field \u2192 raymarch WGSL/GLSL. Native GPU renderer codegen."
|
|
6257
|
+
},
|
|
6258
|
+
{
|
|
6259
|
+
id: "spatial-audio",
|
|
6260
|
+
name: "SpatialAudioCompiler",
|
|
6261
|
+
file: "packages/core/src/compiler/SpatialAudioCompiler.ts",
|
|
6262
|
+
kind: "compiler",
|
|
6263
|
+
maturity: "real",
|
|
6264
|
+
tests: true,
|
|
6265
|
+
promoted: false,
|
|
6266
|
+
note: "The audio peer of WebGPU: emits our OWN Web Audio graph (HRTF PannerNode + Convolver reverb from synthesized rt60 impulses + directivity/occlusion/portal filters) from @audio_source/@audio_listener/@reverb_zone/@audio_material/@audio_occlusion/@audio_portal traits. Sovereign \u2014 no FMOD/Wwise/Resonance. Fills the #1 spatial-computing gap (no audio compiler existed)."
|
|
6267
|
+
},
|
|
6268
|
+
{
|
|
6269
|
+
id: "desktop-gpu",
|
|
6270
|
+
name: "DesktopGPUCompiler",
|
|
6271
|
+
file: "packages/core/src/compiler/DesktopGPUCompiler.ts",
|
|
6272
|
+
kind: "compiler",
|
|
6273
|
+
maturity: "real",
|
|
6274
|
+
tests: true,
|
|
6275
|
+
promoted: false,
|
|
6276
|
+
note: `Sovereign native-desktop GPU: emits a self-contained Rust wgpu project (Vulkan/Metal/DX12) that renders the scene offscreen to a PNG on the machine's OWN GPU \u2014 standalone, no browser, no third-party engine. WebGPU is browser/runtime-bound; this is the "runs standalone at native perf" gap. Matrices computed in the compiler; geometry generators + wgpu host emitted. VERIFIED on real hardware: Jetson Orin (Tegra) via Vulkan rendered a 6-object scene offscreen to PNG (adapter=NVIDIA Tegra Orin, backend=Vulkan). Consumes the same geometry-registry + geometry-purpose vocabulary as render/physics/audio.`
|
|
6277
|
+
},
|
|
6278
|
+
{
|
|
6279
|
+
id: "path-tracer",
|
|
6280
|
+
name: "PathTracerCompiler",
|
|
6281
|
+
file: "packages/core/src/compiler/PathTracerCompiler.ts",
|
|
6282
|
+
kind: "compiler",
|
|
6283
|
+
maturity: "real",
|
|
6284
|
+
tests: true,
|
|
6285
|
+
promoted: false,
|
|
6286
|
+
note: "Sovereign OFFLINE path-traced render \u2014 the film-grade-still gap the rasterizers (WebGPU/desktop-gpu) do not fill. Emits a self-contained Rust wgpu COMPUTE program: our OWN GPU path tracer (no Cycles/OptiX) that traces cosine-weighted diffuse bounces against analytic sphere/box primitives, accumulates many samples, and tonemaps to PNG. Global illumination \u2014 soft shadows, colour bleeding, emissive area lights. VERIFIED on Jetson Orin (Tegra/Vulkan): a Cornell-box scene rendered with visible GI colour-bleed + soft shadows. Fifth consumer of the shared geometry-registry + geometry-purpose vocabulary."
|
|
6287
|
+
},
|
|
6288
|
+
{
|
|
6289
|
+
id: "cpu-path-tracer",
|
|
6290
|
+
name: "CpuPathTracer",
|
|
6291
|
+
file: "packages/core/src/compiler/CpuPathTracer.ts",
|
|
6292
|
+
kind: "runtime",
|
|
6293
|
+
maturity: "real",
|
|
6294
|
+
tests: true,
|
|
6295
|
+
promoted: false,
|
|
6296
|
+
note: 'The sovereign no-GPU FALLBACK: a pure-TypeScript CPU path tracer that RUNS (not emits) the same GI algorithm as PathTracerCompiler, sharing extractRaytraceScene so the two render the same scene. Renders offline global-illumination stills anywhere Node/JS runs \u2014 server, CI, old device, no WebGPU/GPU needed. Ships its own PNG encoder (node:zlib), zero deps. Fills the "runs anywhere / no-WebGPU compute fallback" gap the audit named (compiler-wasm is a parser, not a compute backend).'
|
|
6297
|
+
},
|
|
6298
|
+
{
|
|
6299
|
+
id: "media-pipeline",
|
|
6300
|
+
name: "MediaPipelineCompiler",
|
|
6301
|
+
file: "packages/core/src/compiler/MediaPipelineCompiler.ts",
|
|
6302
|
+
kind: "runtime",
|
|
6303
|
+
maturity: "real",
|
|
6304
|
+
tests: true,
|
|
6305
|
+
promoted: false,
|
|
6306
|
+
note: "The sovereign VIDEO / media-pipeline: renders an animated turntable of the scene (orbiting camera, fast CPU flat projector over the shared raytrace-scene extraction) and encodes the frame sequence to an APNG with our OWN encoder (acTL/fcTL/fdAT via node:zlib) \u2014 no ffmpeg / codec / muxer dependency. A moving picture from a .holo, runs anywhere Node runs. Fills the media-pipeline gap the audit named; browser-native WebCodecs H.264/WebM is the follow-on encode path."
|
|
6307
|
+
},
|
|
6308
|
+
{
|
|
6309
|
+
id: "compute-physics",
|
|
6310
|
+
name: "ComputePhysicsCompiler",
|
|
6311
|
+
file: "packages/core/src/compiler/ComputePhysicsCompiler.ts",
|
|
6312
|
+
kind: "compiler",
|
|
6313
|
+
maturity: "real",
|
|
6314
|
+
tests: true,
|
|
6315
|
+
promoted: false,
|
|
6316
|
+
note: "The sovereign GPU rigid-body SIMULATION \u2014 the dynamics layer PhysicsColliderCompiler was missing. Emits a Rust wgpu program with a WGSL COMPUTE solver: gravity + sphere/sphere + sphere/static-AABB collisions with restitution + friction, double-buffered (gather, race-free), stepped N times on the GPU; then renders the settled state to PNG. Our own solver, no third-party physics engine. One .holo drives BOTH render and sim (Grok + Claude converged design). Dynamic bodies = @rigid_body spheres; statics = scene boxes. VERIFIED on Jetson Orin (Tegra/Vulkan): spheres dropped above a floor fall, collide and settle. Hooks the physics-discovery / provenance goals."
|
|
4305
6317
|
}
|
|
4306
6318
|
];
|
|
4307
6319
|
|
|
4308
6320
|
Object.defineProperty(exports, "ContextCompileError", {
|
|
4309
6321
|
enumerable: true,
|
|
4310
|
-
get: function () { return
|
|
6322
|
+
get: function () { return chunkXHZYS4QO_cjs.ContextCompileError; }
|
|
4311
6323
|
});
|
|
4312
6324
|
Object.defineProperty(exports, "ContextCompiler", {
|
|
4313
6325
|
enumerable: true,
|
|
4314
|
-
get: function () { return
|
|
6326
|
+
get: function () { return chunkXHZYS4QO_cjs.ContextCompiler; }
|
|
4315
6327
|
});
|
|
4316
6328
|
Object.defineProperty(exports, "createContextCompiler", {
|
|
4317
6329
|
enumerable: true,
|
|
4318
|
-
get: function () { return
|
|
6330
|
+
get: function () { return chunkXHZYS4QO_cjs.createContextCompiler; }
|
|
4319
6331
|
});
|
|
4320
6332
|
Object.defineProperty(exports, "LLMCapabilityCompileError", {
|
|
4321
6333
|
enumerable: true,
|
|
4322
|
-
get: function () { return
|
|
6334
|
+
get: function () { return chunk2DJIS7TH_cjs.LLMCapabilityCompileError; }
|
|
4323
6335
|
});
|
|
4324
6336
|
Object.defineProperty(exports, "LLMProviderCapabilitiesCompiler", {
|
|
4325
6337
|
enumerable: true,
|
|
4326
|
-
get: function () { return
|
|
6338
|
+
get: function () { return chunk2DJIS7TH_cjs.LLMProviderCapabilitiesCompiler; }
|
|
4327
6339
|
});
|
|
4328
6340
|
Object.defineProperty(exports, "createLLMProviderCapabilitiesCompiler", {
|
|
4329
6341
|
enumerable: true,
|
|
4330
|
-
get: function () { return
|
|
6342
|
+
get: function () { return chunk2DJIS7TH_cjs.createLLMProviderCapabilitiesCompiler; }
|
|
4331
6343
|
});
|
|
4332
6344
|
Object.defineProperty(exports, "GLTF_PIPELINE_TOOLS", {
|
|
4333
6345
|
enumerable: true,
|
|
4334
|
-
get: function () { return
|
|
6346
|
+
get: function () { return chunk4CQ7ULXZ_cjs.GLTF_PIPELINE_TOOLS; }
|
|
4335
6347
|
});
|
|
4336
6348
|
Object.defineProperty(exports, "registerGLTFTools", {
|
|
4337
6349
|
enumerable: true,
|
|
4338
|
-
get: function () { return
|
|
6350
|
+
get: function () { return chunk4CQ7ULXZ_cjs.registerGLTFTools; }
|
|
4339
6351
|
});
|
|
4340
6352
|
Object.defineProperty(exports, "BUSINESS_QUEST_TOOLS", {
|
|
4341
6353
|
enumerable: true,
|
|
@@ -4383,259 +6395,287 @@ Object.defineProperty(exports, "parseReproducibilityFlags", {
|
|
|
4383
6395
|
});
|
|
4384
6396
|
Object.defineProperty(exports, "QuantumCircuitCompiler", {
|
|
4385
6397
|
enumerable: true,
|
|
4386
|
-
get: function () { return
|
|
6398
|
+
get: function () { return chunkIPBSNGAN_cjs.QuantumCircuitCompiler; }
|
|
4387
6399
|
});
|
|
4388
6400
|
Object.defineProperty(exports, "CodeEditorCompiler", {
|
|
4389
6401
|
enumerable: true,
|
|
4390
|
-
get: function () { return
|
|
6402
|
+
get: function () { return chunkPHLNABJD_cjs.CodeEditorCompiler; }
|
|
4391
6403
|
});
|
|
4392
6404
|
Object.defineProperty(exports, "CompileTimeAuthorityEffectError", {
|
|
4393
6405
|
enumerable: true,
|
|
4394
|
-
get: function () { return
|
|
6406
|
+
get: function () { return chunkPHLNABJD_cjs.CompileTimeAuthorityEffectError; }
|
|
4395
6407
|
});
|
|
4396
6408
|
Object.defineProperty(exports, "CompilerBridge", {
|
|
4397
6409
|
enumerable: true,
|
|
4398
|
-
get: function () { return
|
|
6410
|
+
get: function () { return chunkPHLNABJD_cjs.CompilerBridge; }
|
|
6411
|
+
});
|
|
6412
|
+
Object.defineProperty(exports, "ComputePhysicsCompiler", {
|
|
6413
|
+
enumerable: true,
|
|
6414
|
+
get: function () { return chunkPHLNABJD_cjs.ComputePhysicsCompiler; }
|
|
6415
|
+
});
|
|
6416
|
+
Object.defineProperty(exports, "CpuPathTracer", {
|
|
6417
|
+
enumerable: true,
|
|
6418
|
+
get: function () { return chunkPHLNABJD_cjs.CpuPathTracer; }
|
|
4399
6419
|
});
|
|
4400
6420
|
Object.defineProperty(exports, "DEFAULT_MATERIAL_KEYWORDS", {
|
|
4401
6421
|
enumerable: true,
|
|
4402
|
-
get: function () { return
|
|
6422
|
+
get: function () { return chunkPHLNABJD_cjs.DEFAULT_MATERIAL_KEYWORDS; }
|
|
4403
6423
|
});
|
|
4404
6424
|
Object.defineProperty(exports, "DEFAULT_OBJECT_KEYWORDS", {
|
|
4405
6425
|
enumerable: true,
|
|
4406
|
-
get: function () { return
|
|
6426
|
+
get: function () { return chunkPHLNABJD_cjs.DEFAULT_OBJECT_KEYWORDS; }
|
|
4407
6427
|
});
|
|
4408
6428
|
Object.defineProperty(exports, "DEFAULT_PRIMITIVE_SHAPES", {
|
|
4409
6429
|
enumerable: true,
|
|
4410
|
-
get: function () { return
|
|
6430
|
+
get: function () { return chunkPHLNABJD_cjs.DEFAULT_PRIMITIVE_SHAPES; }
|
|
6431
|
+
});
|
|
6432
|
+
Object.defineProperty(exports, "DesktopGPUCompiler", {
|
|
6433
|
+
enumerable: true,
|
|
6434
|
+
get: function () { return chunkPHLNABJD_cjs.DesktopGPUCompiler; }
|
|
4411
6435
|
});
|
|
4412
6436
|
Object.defineProperty(exports, "DialectRegistry", {
|
|
4413
6437
|
enumerable: true,
|
|
4414
|
-
get: function () { return
|
|
6438
|
+
get: function () { return chunkPHLNABJD_cjs.DialectRegistry; }
|
|
4415
6439
|
});
|
|
4416
6440
|
Object.defineProperty(exports, "EdgeCompiler", {
|
|
4417
6441
|
enumerable: true,
|
|
4418
|
-
get: function () { return
|
|
6442
|
+
get: function () { return chunkPHLNABJD_cjs.EdgeCompiler; }
|
|
4419
6443
|
});
|
|
4420
6444
|
Object.defineProperty(exports, "FMUCompiler", {
|
|
4421
6445
|
enumerable: true,
|
|
4422
|
-
get: function () { return
|
|
6446
|
+
get: function () { return chunkPHLNABJD_cjs.FMUCompiler; }
|
|
4423
6447
|
});
|
|
4424
6448
|
Object.defineProperty(exports, "GaussianSplattingCompiler", {
|
|
4425
6449
|
enumerable: true,
|
|
4426
|
-
get: function () { return
|
|
6450
|
+
get: function () { return chunkPHLNABJD_cjs.GaussianSplattingCompiler; }
|
|
4427
6451
|
});
|
|
4428
6452
|
Object.defineProperty(exports, "GaussianTrainCompiler", {
|
|
4429
6453
|
enumerable: true,
|
|
4430
|
-
get: function () { return
|
|
6454
|
+
get: function () { return chunkPHLNABJD_cjs.GaussianTrainCompiler; }
|
|
4431
6455
|
});
|
|
4432
6456
|
Object.defineProperty(exports, "GaussianTrainConfigError", {
|
|
4433
6457
|
enumerable: true,
|
|
4434
|
-
get: function () { return
|
|
6458
|
+
get: function () { return chunkPHLNABJD_cjs.GaussianTrainConfigError; }
|
|
4435
6459
|
});
|
|
4436
6460
|
Object.defineProperty(exports, "HOLOSCRIPT_GRAMMAR_PRESETS", {
|
|
4437
6461
|
enumerable: true,
|
|
4438
|
-
get: function () { return
|
|
6462
|
+
get: function () { return chunkPHLNABJD_cjs.HOLOSCRIPT_GRAMMAR_PRESETS; }
|
|
4439
6463
|
});
|
|
4440
6464
|
Object.defineProperty(exports, "HoloMCPCompiler", {
|
|
4441
6465
|
enumerable: true,
|
|
4442
|
-
get: function () { return
|
|
6466
|
+
get: function () { return chunkPHLNABJD_cjs.HoloMCPCompiler; }
|
|
4443
6467
|
});
|
|
4444
6468
|
Object.defineProperty(exports, "LlamaServerCompiler", {
|
|
4445
6469
|
enumerable: true,
|
|
4446
|
-
get: function () { return
|
|
6470
|
+
get: function () { return chunkPHLNABJD_cjs.LlamaServerCompiler; }
|
|
6471
|
+
});
|
|
6472
|
+
Object.defineProperty(exports, "MediaPipelineCompiler", {
|
|
6473
|
+
enumerable: true,
|
|
6474
|
+
get: function () { return chunkPHLNABJD_cjs.MediaPipelineCompiler; }
|
|
4447
6475
|
});
|
|
4448
6476
|
Object.defineProperty(exports, "NextJSAPICompiler", {
|
|
4449
6477
|
enumerable: true,
|
|
4450
|
-
get: function () { return
|
|
6478
|
+
get: function () { return chunkPHLNABJD_cjs.NextJSAPICompiler; }
|
|
4451
6479
|
});
|
|
4452
6480
|
Object.defineProperty(exports, "NodeServiceCompiler", {
|
|
4453
6481
|
enumerable: true,
|
|
4454
|
-
get: function () { return
|
|
6482
|
+
get: function () { return chunkPHLNABJD_cjs.NodeServiceCompiler; }
|
|
4455
6483
|
});
|
|
4456
6484
|
Object.defineProperty(exports, "OmnigentAgentYamlCompiler", {
|
|
4457
6485
|
enumerable: true,
|
|
4458
|
-
get: function () { return
|
|
6486
|
+
get: function () { return chunkPHLNABJD_cjs.OmnigentAgentYamlCompiler; }
|
|
4459
6487
|
});
|
|
4460
6488
|
Object.defineProperty(exports, "PCGGraphCompiler", {
|
|
4461
6489
|
enumerable: true,
|
|
4462
|
-
get: function () { return
|
|
6490
|
+
get: function () { return chunkPHLNABJD_cjs.PCGGraphCompiler; }
|
|
4463
6491
|
});
|
|
4464
6492
|
Object.defineProperty(exports, "PCG_GRAPH_SCHEMA", {
|
|
4465
6493
|
enumerable: true,
|
|
4466
|
-
get: function () { return
|
|
6494
|
+
get: function () { return chunkPHLNABJD_cjs.PCG_GRAPH_SCHEMA; }
|
|
6495
|
+
});
|
|
6496
|
+
Object.defineProperty(exports, "PathTracerCompiler", {
|
|
6497
|
+
enumerable: true,
|
|
6498
|
+
get: function () { return chunkPHLNABJD_cjs.PathTracerCompiler; }
|
|
6499
|
+
});
|
|
6500
|
+
Object.defineProperty(exports, "PhysicsColliderCompiler", {
|
|
6501
|
+
enumerable: true,
|
|
6502
|
+
get: function () { return chunkPHLNABJD_cjs.PhysicsColliderCompiler; }
|
|
4467
6503
|
});
|
|
4468
6504
|
Object.defineProperty(exports, "REMOTE_TRAIN_EXECUTOR", {
|
|
4469
6505
|
enumerable: true,
|
|
4470
|
-
get: function () { return
|
|
6506
|
+
get: function () { return chunkPHLNABJD_cjs.REMOTE_TRAIN_EXECUTOR; }
|
|
4471
6507
|
});
|
|
4472
6508
|
Object.defineProperty(exports, "REQUIRED_SANDBOX_AUTHORITY_EFFECT", {
|
|
4473
6509
|
enumerable: true,
|
|
4474
|
-
get: function () { return
|
|
6510
|
+
get: function () { return chunkPHLNABJD_cjs.REQUIRED_SANDBOX_AUTHORITY_EFFECT; }
|
|
4475
6511
|
});
|
|
4476
6512
|
Object.defineProperty(exports, "SANDBOX_AUTHORITY_TRAIT", {
|
|
4477
6513
|
enumerable: true,
|
|
4478
|
-
get: function () { return
|
|
6514
|
+
get: function () { return chunkPHLNABJD_cjs.SANDBOX_AUTHORITY_TRAIT; }
|
|
4479
6515
|
});
|
|
4480
6516
|
Object.defineProperty(exports, "SCMCompiler", {
|
|
4481
6517
|
enumerable: true,
|
|
4482
|
-
get: function () { return
|
|
6518
|
+
get: function () { return chunkPHLNABJD_cjs.SCMCompiler; }
|
|
4483
6519
|
});
|
|
4484
6520
|
Object.defineProperty(exports, "SDKCompiler", {
|
|
4485
6521
|
enumerable: true,
|
|
4486
|
-
get: function () { return
|
|
6522
|
+
get: function () { return chunkPHLNABJD_cjs.SDKCompiler; }
|
|
4487
6523
|
});
|
|
4488
6524
|
Object.defineProperty(exports, "SHARED_SORT_SHADER_PATH", {
|
|
4489
6525
|
enumerable: true,
|
|
4490
|
-
get: function () { return
|
|
6526
|
+
get: function () { return chunkPHLNABJD_cjs.SHARED_SORT_SHADER_PATH; }
|
|
4491
6527
|
});
|
|
4492
6528
|
Object.defineProperty(exports, "SOVEREIGN_TRAIN_EXECUTOR", {
|
|
4493
6529
|
enumerable: true,
|
|
4494
|
-
get: function () { return
|
|
6530
|
+
get: function () { return chunkPHLNABJD_cjs.SOVEREIGN_TRAIN_EXECUTOR; }
|
|
4495
6531
|
});
|
|
4496
6532
|
Object.defineProperty(exports, "SVGCompiler", {
|
|
4497
6533
|
enumerable: true,
|
|
4498
|
-
get: function () { return
|
|
6534
|
+
get: function () { return chunkPHLNABJD_cjs.SVGCompiler; }
|
|
6535
|
+
});
|
|
6536
|
+
Object.defineProperty(exports, "SpatialAudioCompiler", {
|
|
6537
|
+
enumerable: true,
|
|
6538
|
+
get: function () { return chunkPHLNABJD_cjs.SpatialAudioCompiler; }
|
|
4499
6539
|
});
|
|
4500
6540
|
Object.defineProperty(exports, "SpatialPartitionPass", {
|
|
4501
6541
|
enumerable: true,
|
|
4502
|
-
get: function () { return
|
|
6542
|
+
get: function () { return chunkPHLNABJD_cjs.SpatialPartitionPass; }
|
|
4503
6543
|
});
|
|
4504
6544
|
Object.defineProperty(exports, "ThreeDTilesCompiler", {
|
|
4505
6545
|
enumerable: true,
|
|
4506
|
-
get: function () { return
|
|
6546
|
+
get: function () { return chunkPHLNABJD_cjs.ThreeDTilesCompiler; }
|
|
4507
6547
|
});
|
|
4508
6548
|
Object.defineProperty(exports, "USDZPipeline", {
|
|
4509
6549
|
enumerable: true,
|
|
4510
|
-
get: function () { return
|
|
6550
|
+
get: function () { return chunkPHLNABJD_cjs.USDZPipeline; }
|
|
4511
6551
|
});
|
|
4512
6552
|
Object.defineProperty(exports, "absorbFMU", {
|
|
4513
6553
|
enumerable: true,
|
|
4514
|
-
get: function () { return
|
|
6554
|
+
get: function () { return chunkPHLNABJD_cjs.absorbFMU; }
|
|
4515
6555
|
});
|
|
4516
6556
|
Object.defineProperty(exports, "assertAuthorityEffects", {
|
|
4517
6557
|
enumerable: true,
|
|
4518
|
-
get: function () { return
|
|
6558
|
+
get: function () { return chunkPHLNABJD_cjs.assertAuthorityEffects; }
|
|
4519
6559
|
});
|
|
4520
6560
|
Object.defineProperty(exports, "bestCategoryForTraits", {
|
|
4521
6561
|
enumerable: true,
|
|
4522
|
-
get: function () { return
|
|
6562
|
+
get: function () { return chunkPHLNABJD_cjs.bestCategoryForTraits; }
|
|
4523
6563
|
});
|
|
4524
6564
|
Object.defineProperty(exports, "checkAuthorityEffects", {
|
|
4525
6565
|
enumerable: true,
|
|
4526
|
-
get: function () { return
|
|
6566
|
+
get: function () { return chunkPHLNABJD_cjs.checkAuthorityEffects; }
|
|
4527
6567
|
});
|
|
4528
6568
|
Object.defineProperty(exports, "collectAuthorityEffectNodes", {
|
|
4529
6569
|
enumerable: true,
|
|
4530
|
-
get: function () { return
|
|
6570
|
+
get: function () { return chunkPHLNABJD_cjs.collectAuthorityEffectNodes; }
|
|
4531
6571
|
});
|
|
4532
6572
|
Object.defineProperty(exports, "compileAllToNextJSAPI", {
|
|
4533
6573
|
enumerable: true,
|
|
4534
|
-
get: function () { return
|
|
6574
|
+
get: function () { return chunkPHLNABJD_cjs.compileAllToNextJSAPI; }
|
|
4535
6575
|
});
|
|
4536
6576
|
Object.defineProperty(exports, "compilePCGGraphFromBlocks", {
|
|
4537
6577
|
enumerable: true,
|
|
4538
|
-
get: function () { return
|
|
6578
|
+
get: function () { return chunkPHLNABJD_cjs.compilePCGGraphFromBlocks; }
|
|
4539
6579
|
});
|
|
4540
6580
|
Object.defineProperty(exports, "compilePipelineSource", {
|
|
4541
6581
|
enumerable: true,
|
|
4542
|
-
get: function () { return
|
|
6582
|
+
get: function () { return chunkPHLNABJD_cjs.compilePipelineSource; }
|
|
4543
6583
|
});
|
|
4544
6584
|
Object.defineProperty(exports, "compilePipelineSourceToNode", {
|
|
4545
6585
|
enumerable: true,
|
|
4546
|
-
get: function () { return
|
|
6586
|
+
get: function () { return chunkPHLNABJD_cjs.compilePipelineSourceToNode; }
|
|
4547
6587
|
});
|
|
4548
6588
|
Object.defineProperty(exports, "compilePipelineSourceToPython", {
|
|
4549
6589
|
enumerable: true,
|
|
4550
|
-
get: function () { return
|
|
6590
|
+
get: function () { return chunkPHLNABJD_cjs.compilePipelineSourceToPython; }
|
|
4551
6591
|
});
|
|
4552
6592
|
Object.defineProperty(exports, "compilePipelineToNode", {
|
|
4553
6593
|
enumerable: true,
|
|
4554
|
-
get: function () { return
|
|
6594
|
+
get: function () { return chunkPHLNABJD_cjs.compilePipelineToNode; }
|
|
4555
6595
|
});
|
|
4556
6596
|
Object.defineProperty(exports, "compilePipelineToPython", {
|
|
4557
6597
|
enumerable: true,
|
|
4558
|
-
get: function () { return
|
|
6598
|
+
get: function () { return chunkPHLNABJD_cjs.compilePipelineToPython; }
|
|
4559
6599
|
});
|
|
4560
6600
|
Object.defineProperty(exports, "compileTo3DTiles", {
|
|
4561
6601
|
enumerable: true,
|
|
4562
|
-
get: function () { return
|
|
6602
|
+
get: function () { return chunkPHLNABJD_cjs.compileTo3DTiles; }
|
|
4563
6603
|
});
|
|
4564
6604
|
Object.defineProperty(exports, "compileToFMU", {
|
|
4565
6605
|
enumerable: true,
|
|
4566
|
-
get: function () { return
|
|
6606
|
+
get: function () { return chunkPHLNABJD_cjs.compileToFMU; }
|
|
4567
6607
|
});
|
|
4568
6608
|
Object.defineProperty(exports, "compileToNextJSAPI", {
|
|
4569
6609
|
enumerable: true,
|
|
4570
|
-
get: function () { return
|
|
6610
|
+
get: function () { return chunkPHLNABJD_cjs.compileToNextJSAPI; }
|
|
4571
6611
|
});
|
|
4572
6612
|
Object.defineProperty(exports, "compileToPCGGraph", {
|
|
4573
6613
|
enumerable: true,
|
|
4574
|
-
get: function () { return
|
|
6614
|
+
get: function () { return chunkPHLNABJD_cjs.compileToPCGGraph; }
|
|
4575
6615
|
});
|
|
4576
6616
|
Object.defineProperty(exports, "createGaussianSplattingCompiler", {
|
|
4577
6617
|
enumerable: true,
|
|
4578
|
-
get: function () { return
|
|
6618
|
+
get: function () { return chunkPHLNABJD_cjs.createGaussianSplattingCompiler; }
|
|
4579
6619
|
});
|
|
4580
6620
|
Object.defineProperty(exports, "createGaussianTrainCompiler", {
|
|
4581
6621
|
enumerable: true,
|
|
4582
|
-
get: function () { return
|
|
6622
|
+
get: function () { return chunkPHLNABJD_cjs.createGaussianTrainCompiler; }
|
|
4583
6623
|
});
|
|
4584
6624
|
Object.defineProperty(exports, "createOmnigentAgentYamlCompiler", {
|
|
4585
6625
|
enumerable: true,
|
|
4586
|
-
get: function () { return
|
|
6626
|
+
get: function () { return chunkPHLNABJD_cjs.createOmnigentAgentYamlCompiler; }
|
|
4587
6627
|
});
|
|
4588
6628
|
Object.defineProperty(exports, "createThreeDTilesCompiler", {
|
|
4589
6629
|
enumerable: true,
|
|
4590
|
-
get: function () { return
|
|
6630
|
+
get: function () { return chunkPHLNABJD_cjs.createThreeDTilesCompiler; }
|
|
4591
6631
|
});
|
|
4592
6632
|
Object.defineProperty(exports, "detectMultiUserSharedSort", {
|
|
4593
6633
|
enumerable: true,
|
|
4594
|
-
get: function () { return
|
|
6634
|
+
get: function () { return chunkPHLNABJD_cjs.detectMultiUserSharedSort; }
|
|
4595
6635
|
});
|
|
4596
6636
|
Object.defineProperty(exports, "ensureDialectsBooted", {
|
|
4597
6637
|
enumerable: true,
|
|
4598
|
-
get: function () { return
|
|
6638
|
+
get: function () { return chunkPHLNABJD_cjs.ensureDialectsBooted; }
|
|
4599
6639
|
});
|
|
4600
6640
|
Object.defineProperty(exports, "generateHoloScriptGbnf", {
|
|
4601
6641
|
enumerable: true,
|
|
4602
|
-
get: function () { return
|
|
6642
|
+
get: function () { return chunkPHLNABJD_cjs.generateHoloScriptGbnf; }
|
|
4603
6643
|
});
|
|
4604
6644
|
Object.defineProperty(exports, "isHoloScriptGrammarPreset", {
|
|
4605
6645
|
enumerable: true,
|
|
4606
|
-
get: function () { return
|
|
6646
|
+
get: function () { return chunkPHLNABJD_cjs.isHoloScriptGrammarPreset; }
|
|
4607
6647
|
});
|
|
4608
6648
|
Object.defineProperty(exports, "pcgGraphToUnrealXml", {
|
|
4609
6649
|
enumerable: true,
|
|
4610
|
-
get: function () { return
|
|
6650
|
+
get: function () { return chunkPHLNABJD_cjs.pcgGraphToUnrealXml; }
|
|
4611
6651
|
});
|
|
4612
6652
|
Object.defineProperty(exports, "quickSafetyCheck", {
|
|
4613
6653
|
enumerable: true,
|
|
4614
|
-
get: function () { return
|
|
6654
|
+
get: function () { return chunkPHLNABJD_cjs.quickSafetyCheck; }
|
|
4615
6655
|
});
|
|
4616
6656
|
Object.defineProperty(exports, "registerBuiltinDialects", {
|
|
4617
6657
|
enumerable: true,
|
|
4618
|
-
get: function () { return
|
|
6658
|
+
get: function () { return chunkPHLNABJD_cjs.registerBuiltinDialects; }
|
|
4619
6659
|
});
|
|
4620
6660
|
Object.defineProperty(exports, "runSafetyPass", {
|
|
4621
6661
|
enumerable: true,
|
|
4622
|
-
get: function () { return
|
|
6662
|
+
get: function () { return chunkPHLNABJD_cjs.runSafetyPass; }
|
|
4623
6663
|
});
|
|
4624
6664
|
Object.defineProperty(exports, "selectModality", {
|
|
4625
6665
|
enumerable: true,
|
|
4626
|
-
get: function () { return
|
|
6666
|
+
get: function () { return chunkPHLNABJD_cjs.selectModality; }
|
|
4627
6667
|
});
|
|
4628
6668
|
Object.defineProperty(exports, "selectModalityForAll", {
|
|
4629
6669
|
enumerable: true,
|
|
4630
|
-
get: function () { return
|
|
6670
|
+
get: function () { return chunkPHLNABJD_cjs.selectModalityForAll; }
|
|
4631
6671
|
});
|
|
4632
6672
|
Object.defineProperty(exports, "spatialPartition", {
|
|
4633
6673
|
enumerable: true,
|
|
4634
|
-
get: function () { return
|
|
6674
|
+
get: function () { return chunkPHLNABJD_cjs.spatialPartition; }
|
|
4635
6675
|
});
|
|
4636
6676
|
Object.defineProperty(exports, "streamWorldTiles", {
|
|
4637
6677
|
enumerable: true,
|
|
4638
|
-
get: function () { return
|
|
6678
|
+
get: function () { return chunkPHLNABJD_cjs.streamWorldTiles; }
|
|
4639
6679
|
});
|
|
4640
6680
|
Object.defineProperty(exports, "generateHullGeometry", {
|
|
4641
6681
|
enumerable: true,
|
|
@@ -4651,23 +6691,23 @@ Object.defineProperty(exports, "generateSplineGeometry", {
|
|
|
4651
6691
|
});
|
|
4652
6692
|
Object.defineProperty(exports, "SceneIRCompiler", {
|
|
4653
6693
|
enumerable: true,
|
|
4654
|
-
get: function () { return
|
|
6694
|
+
get: function () { return chunkF47FEV4X_cjs.SceneIRCompiler; }
|
|
4655
6695
|
});
|
|
4656
6696
|
Object.defineProperty(exports, "DaimonSeedCompiler", {
|
|
4657
6697
|
enumerable: true,
|
|
4658
|
-
get: function () { return
|
|
6698
|
+
get: function () { return chunkOQVHCYY4_cjs.DaimonSeedCompiler; }
|
|
4659
6699
|
});
|
|
4660
6700
|
Object.defineProperty(exports, "computeExportFidelity", {
|
|
4661
6701
|
enumerable: true,
|
|
4662
|
-
get: function () { return
|
|
6702
|
+
get: function () { return chunkOQVHCYY4_cjs.computeExportFidelity; }
|
|
4663
6703
|
});
|
|
4664
6704
|
Object.defineProperty(exports, "createDaimonSeedCompiler", {
|
|
4665
6705
|
enumerable: true,
|
|
4666
|
-
get: function () { return
|
|
6706
|
+
get: function () { return chunkOQVHCYY4_cjs.createDaimonSeedCompiler; }
|
|
4667
6707
|
});
|
|
4668
6708
|
Object.defineProperty(exports, "runHysteresisExp2", {
|
|
4669
6709
|
enumerable: true,
|
|
4670
|
-
get: function () { return
|
|
6710
|
+
get: function () { return chunkOQVHCYY4_cjs.runHysteresisExp2; }
|
|
4671
6711
|
});
|
|
4672
6712
|
Object.defineProperty(exports, "COCOExporter", {
|
|
4673
6713
|
enumerable: true,
|
|
@@ -4683,91 +6723,91 @@ Object.defineProperty(exports, "SemanticSceneGraph", {
|
|
|
4683
6723
|
});
|
|
4684
6724
|
Object.defineProperty(exports, "AgentInferenceCompiler", {
|
|
4685
6725
|
enumerable: true,
|
|
4686
|
-
get: function () { return
|
|
6726
|
+
get: function () { return chunkCRUIGXF7_cjs.AgentInferenceCompiler; }
|
|
4687
6727
|
});
|
|
4688
6728
|
Object.defineProperty(exports, "AgentInferenceExportTarget", {
|
|
4689
6729
|
enumerable: true,
|
|
4690
|
-
get: function () { return
|
|
6730
|
+
get: function () { return chunkCRUIGXF7_cjs.AgentInferenceExportTarget_default; }
|
|
4691
6731
|
});
|
|
4692
6732
|
Object.defineProperty(exports, "createAgentInferenceCompiler", {
|
|
4693
6733
|
enumerable: true,
|
|
4694
|
-
get: function () { return
|
|
6734
|
+
get: function () { return chunkCRUIGXF7_cjs.createAgentInferenceCompiler; }
|
|
4695
6735
|
});
|
|
4696
6736
|
Object.defineProperty(exports, "createPythonAgentInferenceCompiler", {
|
|
4697
6737
|
enumerable: true,
|
|
4698
|
-
get: function () { return
|
|
6738
|
+
get: function () { return chunkCRUIGXF7_cjs.createPythonAgentInferenceCompiler; }
|
|
4699
6739
|
});
|
|
4700
6740
|
Object.defineProperty(exports, "USDPhysicsCompiler", {
|
|
4701
6741
|
enumerable: true,
|
|
4702
|
-
get: function () { return
|
|
6742
|
+
get: function () { return chunkFQ4MYZYU_cjs.USDPhysicsCompiler; }
|
|
4703
6743
|
});
|
|
4704
6744
|
Object.defineProperty(exports, "SDFCompiler", {
|
|
4705
6745
|
enumerable: true,
|
|
4706
|
-
get: function () { return
|
|
6746
|
+
get: function () { return chunkQ6VW7MGX_cjs.SDFCompiler; }
|
|
4707
6747
|
});
|
|
4708
6748
|
Object.defineProperty(exports, "StateCompiler", {
|
|
4709
6749
|
enumerable: true,
|
|
4710
|
-
get: function () { return
|
|
6750
|
+
get: function () { return chunkAUMTQV64_cjs.StateCompiler; }
|
|
4711
6751
|
});
|
|
4712
6752
|
Object.defineProperty(exports, "TraitCompositionCompiler", {
|
|
4713
6753
|
enumerable: true,
|
|
4714
|
-
get: function () { return
|
|
6754
|
+
get: function () { return chunkVSO6HPDZ_cjs.TraitCompositionCompiler; }
|
|
4715
6755
|
});
|
|
4716
6756
|
Object.defineProperty(exports, "IncrementalCompiler", {
|
|
4717
6757
|
enumerable: true,
|
|
4718
|
-
get: function () { return
|
|
6758
|
+
get: function () { return chunkXRQCTTDC_cjs.IncrementalCompiler; }
|
|
4719
6759
|
});
|
|
4720
6760
|
Object.defineProperty(exports, "createIncrementalCompiler", {
|
|
4721
6761
|
enumerable: true,
|
|
4722
|
-
get: function () { return
|
|
6762
|
+
get: function () { return chunkXRQCTTDC_cjs.createIncrementalCompiler; }
|
|
4723
6763
|
});
|
|
4724
6764
|
Object.defineProperty(exports, "AndroidCompiler", {
|
|
4725
6765
|
enumerable: true,
|
|
4726
|
-
get: function () { return
|
|
6766
|
+
get: function () { return chunkFPGYWNNA_cjs.AndroidCompiler; }
|
|
4727
6767
|
});
|
|
4728
6768
|
Object.defineProperty(exports, "AndroidXRCompiler", {
|
|
4729
6769
|
enumerable: true,
|
|
4730
|
-
get: function () { return
|
|
6770
|
+
get: function () { return chunkQKLEDRHN_cjs.AndroidXRCompiler; }
|
|
4731
6771
|
});
|
|
4732
6772
|
Object.defineProperty(exports, "IOSCompiler", {
|
|
4733
6773
|
enumerable: true,
|
|
4734
|
-
get: function () { return
|
|
6774
|
+
get: function () { return chunkK53L47NH_cjs.IOSCompiler; }
|
|
4735
6775
|
});
|
|
4736
6776
|
Object.defineProperty(exports, "VisionOSCompiler", {
|
|
4737
6777
|
enumerable: true,
|
|
4738
|
-
get: function () { return
|
|
6778
|
+
get: function () { return chunkJ74S4ZMF_cjs.VisionOSCompiler; }
|
|
4739
6779
|
});
|
|
4740
6780
|
Object.defineProperty(exports, "WASMCompiler", {
|
|
4741
6781
|
enumerable: true,
|
|
4742
|
-
get: function () { return
|
|
6782
|
+
get: function () { return chunkNTSLNIY7_cjs.WASMCompiler; }
|
|
4743
6783
|
});
|
|
4744
6784
|
Object.defineProperty(exports, "WebGPUCompiler", {
|
|
4745
6785
|
enumerable: true,
|
|
4746
|
-
get: function () { return
|
|
6786
|
+
get: function () { return chunkU6CQOM5Q_cjs.WebGPUCompiler; }
|
|
4747
6787
|
});
|
|
4748
6788
|
Object.defineProperty(exports, "DTDLCompiler", {
|
|
4749
6789
|
enumerable: true,
|
|
4750
|
-
get: function () { return
|
|
6790
|
+
get: function () { return chunkFGTXAVKG_cjs.DTDLCompiler; }
|
|
4751
6791
|
});
|
|
4752
6792
|
Object.defineProperty(exports, "URDFCompiler", {
|
|
4753
6793
|
enumerable: true,
|
|
4754
|
-
get: function () { return
|
|
6794
|
+
get: function () { return chunkN2BOTBPG_cjs.URDFCompiler; }
|
|
4755
6795
|
});
|
|
4756
6796
|
Object.defineProperty(exports, "createURDFCompiler", {
|
|
4757
6797
|
enumerable: true,
|
|
4758
|
-
get: function () { return
|
|
6798
|
+
get: function () { return chunkN2BOTBPG_cjs.createURDFCompiler; }
|
|
4759
6799
|
});
|
|
4760
6800
|
Object.defineProperty(exports, "OpenXRCompiler", {
|
|
4761
6801
|
enumerable: true,
|
|
4762
|
-
get: function () { return
|
|
6802
|
+
get: function () { return chunkZHW6TDZ6_cjs.OpenXRCompiler; }
|
|
4763
6803
|
});
|
|
4764
6804
|
Object.defineProperty(exports, "VRChatCompiler", {
|
|
4765
6805
|
enumerable: true,
|
|
4766
|
-
get: function () { return
|
|
6806
|
+
get: function () { return chunkZXXC2GXB_cjs.VRChatCompiler; }
|
|
4767
6807
|
});
|
|
4768
6808
|
Object.defineProperty(exports, "UnityCompiler", {
|
|
4769
6809
|
enumerable: true,
|
|
4770
|
-
get: function () { return
|
|
6810
|
+
get: function () { return chunkLNJKBQ2B_cjs.UnityCompiler; }
|
|
4771
6811
|
});
|
|
4772
6812
|
Object.defineProperty(exports, "PlatformConditionalCompilerMixin", {
|
|
4773
6813
|
enumerable: true,
|
|
@@ -4791,7 +6831,7 @@ Object.defineProperty(exports, "normalizePlatformName", {
|
|
|
4791
6831
|
});
|
|
4792
6832
|
Object.defineProperty(exports, "GodotCompiler", {
|
|
4793
6833
|
enumerable: true,
|
|
4794
|
-
get: function () { return
|
|
6834
|
+
get: function () { return chunkAN3ZH7M7_cjs.GodotCompiler; }
|
|
4795
6835
|
});
|
|
4796
6836
|
Object.defineProperty(exports, "SCIENTIFIC_COLOR_MAPS", {
|
|
4797
6837
|
enumerable: true,
|
|
@@ -4827,23 +6867,23 @@ Object.defineProperty(exports, "srgbToHex", {
|
|
|
4827
6867
|
});
|
|
4828
6868
|
Object.defineProperty(exports, "CompilerBase", {
|
|
4829
6869
|
enumerable: true,
|
|
4830
|
-
get: function () { return
|
|
6870
|
+
get: function () { return chunkCMEINO5I_cjs.CompilerBase; }
|
|
4831
6871
|
});
|
|
4832
6872
|
Object.defineProperty(exports, "CompilerDocumentationGenerator", {
|
|
4833
6873
|
enumerable: true,
|
|
4834
|
-
get: function () { return
|
|
6874
|
+
get: function () { return chunkCMEINO5I_cjs.CompilerDocumentationGenerator; }
|
|
4835
6875
|
});
|
|
4836
6876
|
Object.defineProperty(exports, "UnauthorizedCompilerAccessError", {
|
|
4837
6877
|
enumerable: true,
|
|
4838
|
-
get: function () { return
|
|
6878
|
+
get: function () { return chunkCMEINO5I_cjs.UnauthorizedCompilerAccessError; }
|
|
4839
6879
|
});
|
|
4840
6880
|
Object.defineProperty(exports, "createTestCompilerToken", {
|
|
4841
6881
|
enumerable: true,
|
|
4842
|
-
get: function () { return
|
|
6882
|
+
get: function () { return chunkCMEINO5I_cjs.createTestCompilerToken; }
|
|
4843
6883
|
});
|
|
4844
6884
|
Object.defineProperty(exports, "isCapabilityTokenCredential", {
|
|
4845
6885
|
enumerable: true,
|
|
4846
|
-
get: function () { return
|
|
6886
|
+
get: function () { return chunkCMEINO5I_cjs.isCapabilityTokenCredential; }
|
|
4847
6887
|
});
|
|
4848
6888
|
exports.AgentTrustLedger = AgentTrustLedger;
|
|
4849
6889
|
exports.AlphaTracker = AlphaTracker;
|
|
@@ -4856,6 +6896,13 @@ exports.COLYSEUS_SCHEMA_FIELD_TIERS = COLYSEUS_SCHEMA_FIELD_TIERS;
|
|
|
4856
6896
|
exports.DEFAULT_DISPATCH_LATENCY_OPERATION = DEFAULT_DISPATCH_LATENCY_OPERATION;
|
|
4857
6897
|
exports.DispatchPolicy = DispatchPolicy;
|
|
4858
6898
|
exports.DispatchTier = DispatchTier;
|
|
6899
|
+
exports.HSIAdmissionError = HSIAdmissionError;
|
|
6900
|
+
exports.HSIIRCompiler = HSIIRCompiler;
|
|
6901
|
+
exports.HSI_AUDIT_SCHEMA_VERSION = HSI_AUDIT_SCHEMA_VERSION;
|
|
6902
|
+
exports.HSI_IR_SCHEMA_VERSION = HSI_IR_SCHEMA_VERSION;
|
|
6903
|
+
exports.HSI_LEARNING_GRAPH_SCHEMA_VERSION = HSI_LEARNING_GRAPH_SCHEMA_VERSION;
|
|
6904
|
+
exports.HSI_OBSERVATION_MEDIATOR_EDGE = HSI_OBSERVATION_MEDIATOR_EDGE;
|
|
6905
|
+
exports.HSI_TRACE_SCHEMA_VERSION = HSI_TRACE_SCHEMA_VERSION;
|
|
4859
6906
|
exports.MCPConfigCompiler = MCPConfigCompiler;
|
|
4860
6907
|
exports.MultiLayerCompiler = MultiLayerCompiler;
|
|
4861
6908
|
exports.NATIVE_COMPILE_MODES = NATIVE_COMPILE_MODES;
|
|
@@ -4865,29 +6912,45 @@ exports.SOVEREIGN_ENGINES = SOVEREIGN_ENGINES;
|
|
|
4865
6912
|
exports.SOVEREIGN_TARGETS = SOVEREIGN_TARGETS;
|
|
4866
6913
|
exports.Vector2DCompiler = Vector2DCompiler;
|
|
4867
6914
|
exports.WebGPUWGSLPlugin = WebGPUWGSLPlugin;
|
|
6915
|
+
exports.applyIntervention = applyIntervention;
|
|
6916
|
+
exports.behavioralProjection = behavioralProjection;
|
|
4868
6917
|
exports.buildColyseusAuthorityGraph = buildColyseusAuthorityGraph;
|
|
4869
6918
|
exports.buildColyseusCrossFileContext = buildColyseusCrossFileContext;
|
|
4870
6919
|
exports.byzantineResilientMerge = byzantineResilientMerge;
|
|
4871
6920
|
exports.createAuthoritySymbolGraph = createAuthoritySymbolGraph;
|
|
4872
6921
|
exports.createDefaultDispatchLatencyScenarios = createDefaultDispatchLatencyScenarios;
|
|
6922
|
+
exports.createHSIIRCompiler = createHSIIRCompiler;
|
|
4873
6923
|
exports.createProvenanceBoundsChecker = createProvenanceBoundsChecker;
|
|
4874
6924
|
exports.createTier3CpuDirectOutput = createTier3CpuDirectOutput;
|
|
4875
6925
|
exports.detectWasmRuntime = detectWasmRuntime;
|
|
6926
|
+
exports.emitSceneIRTsx = emitSceneIRTsx;
|
|
4876
6927
|
exports.formatDispatchLatencyBenchmarkReport = formatDispatchLatencyBenchmarkReport;
|
|
6928
|
+
exports.generateAuditCases = generateAuditCases;
|
|
4877
6929
|
exports.generateTraitForTarget = generateTraitForTarget;
|
|
4878
6930
|
exports.getAllManifests = getAllManifests;
|
|
4879
6931
|
exports.getTraitInfo = getTraitInfo;
|
|
6932
|
+
exports.hsiSha256 = hsiSha256;
|
|
6933
|
+
exports.hsiSourceTextDigest = hsiSourceTextDigest;
|
|
6934
|
+
exports.hsiStableStringify = hsiStableStringify;
|
|
4880
6935
|
exports.isBridgeTarget = isBridgeTarget;
|
|
4881
6936
|
exports.isSovereignTarget = isSovereignTarget;
|
|
4882
6937
|
exports.listTraitsForTarget = listTraitsForTarget;
|
|
6938
|
+
exports.lowerCompositionToHSIIR = lowerCompositionToHSIIR;
|
|
6939
|
+
exports.lowerHoloExpression = lowerHoloExpression;
|
|
4883
6940
|
exports.manifestFromPlugin = manifestFromPlugin;
|
|
4884
6941
|
exports.mergeSocialCausalModels = mergeSocialCausalModels;
|
|
4885
6942
|
exports.mostRestrictiveTier = mostRestrictiveTier;
|
|
4886
6943
|
exports.platformPluginRegistry = platformPluginRegistry;
|
|
6944
|
+
exports.projectLearningGraph = projectLearningGraph;
|
|
4887
6945
|
exports.queryTrait = queryTrait;
|
|
4888
6946
|
exports.recommendDispatchPolicyDefaults = recommendDispatchPolicyDefaults;
|
|
6947
|
+
exports.renameComposition = renameComposition;
|
|
6948
|
+
exports.renameTrace = renameTrace;
|
|
6949
|
+
exports.reorderComposition = reorderComposition;
|
|
4889
6950
|
exports.runCompilerWasmSnnEmulator = runCompilerWasmSnnEmulator;
|
|
4890
6951
|
exports.runDispatchPolicyLatencyBenchmark = runDispatchPolicyLatencyBenchmark;
|
|
6952
|
+
exports.runExactTrace = runExactTrace;
|
|
6953
|
+
exports.runHSIAudit = runHSIAudit;
|
|
4891
6954
|
exports.splitServerAuthority = splitServerAuthority;
|
|
4892
6955
|
exports.targetSovereignty = targetSovereignty;
|
|
4893
6956
|
exports.traitExists = traitExists;
|