@holoscript/core 8.0.14 → 8.0.16
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 +6 -13
- package/bin/holo-decision.mjs +0 -0
- package/bin/holoscript.cjs +0 -0
- package/dist/{GLTFPipeline-6LS3UDYX.js → GLTFPipeline-FRBZIATS.js} +6 -6
- package/dist/{GLTFPipeline-VTI6PRRQ.cjs → GLTFPipeline-MTPP444P.cjs} +10 -10
- package/dist/{HoloCompositionParser-GILABNN3.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-VX75RB6H.js → SceneIRCompiler-BJQMKLWL.js} +6 -6
- package/dist/{SceneIRCompiler-7KQ5NKAU.cjs → SceneIRCompiler-RTPPDQAV.cjs} +11 -11
- package/dist/{chunk-Y2OCKXVD.js → chunk-22AULOAL.js} +5 -5
- package/dist/{chunk-D44CEFY4.cjs → chunk-2DJIS7TH.cjs} +5 -5
- package/dist/{chunk-LHUDAJQT.cjs → chunk-2PVEXEOL.cjs} +5 -5
- package/dist/{chunk-M7XR3F53.js → chunk-2UP2J3OK.js} +4 -4
- package/dist/{chunk-3KHRZTNW.js → chunk-3AUYBQ5I.js} +3 -3
- package/dist/{chunk-UKEK2NZJ.js → chunk-3MQAOMKD.js} +3 -3
- package/dist/{chunk-FWKEY4LD.js → chunk-4AGNARX6.js} +3 -3
- package/dist/{chunk-7ITJP33Q.cjs → chunk-4CQ7ULXZ.cjs} +3 -3
- package/dist/{chunk-47XZ62KM.js → chunk-4UA5OBWR.js} +5 -5
- package/dist/{chunk-ORBVCOTC.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-73EDVY5D.js → chunk-7AY66PZP.js} +3 -3
- package/dist/{chunk-6FCNMTL5.js → chunk-7HDRN5BW.js} +4 -4
- package/dist/{chunk-N7MIIDLI.cjs → chunk-7IBXTJP7.cjs} +8 -8
- package/dist/{chunk-R5VKLUMR.js → chunk-AAUQTR7I.js} +4 -4
- package/dist/{chunk-HCONR4J6.cjs → chunk-AN3ZH7M7.cjs} +38 -38
- package/dist/{chunk-YW3I2FQL.js → chunk-ANMME7XT.js} +4 -2
- package/dist/{chunk-W4AJMMQR.js → chunk-AUF7HFOO.js} +60 -22
- package/dist/{chunk-SKVBUGMC.cjs → chunk-AUMTQV64.cjs} +7 -7
- package/dist/{chunk-7ZKQ32XK.js → chunk-B5K3WHJ4.js} +4 -4
- package/dist/{chunk-QQFB4RT2.cjs → chunk-BTVHY3UB.cjs} +2 -2
- package/dist/{chunk-SE2Y5BSL.cjs → chunk-CMEINO5I.cjs} +186 -70
- package/dist/{chunk-YMI3ED3B.cjs → chunk-CRUIGXF7.cjs} +5 -5
- package/dist/chunk-DDBYJJZK.js +1571 -0
- package/dist/{chunk-2E6PP5UE.cjs → chunk-E2SNPMBO.cjs} +11 -11
- package/dist/{chunk-GI5YYZH6.js → chunk-E4YS5SIZ.js} +90 -25
- package/dist/{chunk-62OYZT6Q.js → chunk-EKNWUSGW.js} +3 -3
- package/dist/{chunk-RVN7OPCP.js → chunk-ETIJOUIO.js} +4 -4
- package/dist/chunk-EUNELE7Y.cjs +1605 -0
- package/dist/{chunk-C73GVAYC.js → chunk-F33KLYOS.js} +5 -5
- package/dist/{chunk-4CRMVEON.cjs → chunk-F47FEV4X.cjs} +40 -40
- package/dist/{chunk-FGXJPJ3W.cjs → chunk-FCGTI7FO.cjs} +4 -4
- package/dist/{chunk-OSKGCXAQ.cjs → chunk-FGTXAVKG.cjs} +5 -5
- package/dist/{chunk-XZC75AJ4.cjs → chunk-FPGYWNNA.cjs} +5 -5
- package/dist/{chunk-5B2AJKA5.cjs → chunk-FQ4MYZYU.cjs} +20 -20
- package/dist/{chunk-KOGPVAP6.js → chunk-FT4FGTR6.js} +3 -3
- package/dist/{chunk-N7IYRAFG.cjs → chunk-FVNV4WHQ.cjs} +14 -14
- package/dist/{chunk-SJIRCTIS.cjs → chunk-HSGJFCVJ.cjs} +2 -2
- package/dist/{chunk-TKDDIE3T.cjs → chunk-ILO2KMER.cjs} +4 -4
- package/dist/{chunk-GGH3ZYDB.cjs → chunk-IPBSNGAN.cjs} +92 -27
- package/dist/{chunk-JQCXLKAU.js → chunk-IX2U3RQT.js} +3 -3
- package/dist/{chunk-P65OIMJT.cjs → chunk-IYK6LMQ7.cjs} +7 -7
- package/dist/{chunk-NWKARJM2.js → chunk-J3VVM6GV.js} +4 -4
- package/dist/{chunk-FOM36K5I.cjs → chunk-J74S4ZMF.cjs} +18 -18
- package/dist/{chunk-36NPLOI4.cjs → chunk-JERWCCEJ.cjs} +4 -2
- package/dist/{chunk-VXHB6ZHY.js → chunk-JTDDLCSP.js} +4 -4
- package/dist/{chunk-GYJLP4BO.cjs → chunk-K53L47NH.cjs} +30 -30
- package/dist/{chunk-FHR2AVMA.cjs → chunk-LJTM5ONX.cjs} +23 -23
- package/dist/{chunk-JCVSCKUH.js → chunk-LJVVOVA6.js} +4 -4
- package/dist/{chunk-LQNL3IYV.cjs → chunk-LNJKBQ2B.cjs} +38 -38
- package/dist/{chunk-2GKF7JQ6.js → chunk-M2GDE3NV.js} +3 -3
- package/dist/{chunk-Z7NUL73U.js → chunk-MSZNGI5P.js} +3 -3
- package/dist/{chunk-B6JHTTMR.cjs → chunk-N2BOTBPG.cjs} +15 -15
- package/dist/{chunk-L4DBUX3N.cjs → chunk-NFALJJCH.cjs} +12 -12
- package/dist/{chunk-YBM34FUJ.cjs → chunk-NRZRBK25.cjs} +6 -6
- package/dist/{chunk-SNMQUWIO.cjs → chunk-NTSLNIY7.cjs} +10 -10
- package/dist/{chunk-645EWDZW.cjs → chunk-NZJOAWJM.cjs} +4 -4
- package/dist/{chunk-LGRKBTPM.js → chunk-OG7RKWWX.js} +3 -3
- package/dist/{chunk-OOP4S3GU.cjs → chunk-OQVHCYY4.cjs} +5 -5
- package/dist/{chunk-TMNAKNV2.cjs → chunk-PEBNX3VM.cjs} +5 -5
- package/dist/{chunk-5T6BWIB7.js → chunk-PFZ5WLIP.js} +4 -4
- package/dist/{chunk-CESMPUEZ.cjs → chunk-PHLNABJD.cjs} +159 -145
- package/dist/{chunk-CHIZSMWD.js → chunk-PLK3DLTF.js} +3 -3
- package/dist/{chunk-4NEPHK2K.js → chunk-PMACVMHL.js} +3 -3
- package/dist/{chunk-EYHPTJ3F.js → chunk-PV2OXNP5.js} +40 -26
- package/dist/{chunk-KLM6QD6D.cjs → chunk-Q6VW7MGX.cjs} +14 -14
- package/dist/{chunk-YDSNDCV3.js → chunk-QC3CAVFN.js} +186 -69
- package/dist/{chunk-REN3LHO6.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-S2BSXG3B.js +3308 -0
- package/dist/{chunk-TZQKJOPC.js → chunk-TW2AH2ZS.js} +3 -3
- package/dist/{chunk-Q4J2K7FI.js → chunk-TZM6DKSJ.js} +6 -6
- package/dist/{chunk-ESSEF6U2.js → chunk-U227RWXB.js} +3 -3
- package/dist/{chunk-ERYKKPHW.cjs → chunk-U6CQOM5Q.cjs} +13 -13
- package/dist/{chunk-VMCR5QVI.js → chunk-ULT2QAV5.js} +4 -4
- package/dist/chunk-VQOTDNFL.cjs +3337 -0
- package/dist/{chunk-VZI7S7P6.cjs → chunk-VSO6HPDZ.cjs} +7 -7
- package/dist/{chunk-QLPRI3QW.js → chunk-WQJMSSJT.js} +4 -4
- package/dist/{chunk-GILYQ5VH.cjs → chunk-WXSDBWGM.cjs} +4 -4
- package/dist/{chunk-42Z3SVHQ.js → chunk-X5PMMK7H.js} +3 -3
- package/dist/{chunk-ML4V5PVU.cjs → chunk-X5ZLSPU2.cjs} +74 -32
- package/dist/{chunk-PSWCJQS4.js → chunk-X727CQ7X.js} +5 -5
- package/dist/{chunk-YM7UUYR5.cjs → chunk-XHZYS4QO.cjs} +5 -5
- package/dist/{chunk-PZ46WRHX.cjs → chunk-XRQCTTDC.cjs} +8 -8
- package/dist/{chunk-IXFNA5TT.js → chunk-YBIHSN55.js} +4 -4
- package/dist/{chunk-BLCWQ225.js → chunk-Z574GVI3.js} +4 -4
- package/dist/{chunk-ZVQMKUGJ.js → chunk-Z5V3KA7L.js} +2 -2
- package/dist/{chunk-VTFLKSJL.cjs → chunk-ZHW6TDZ6.cjs} +14 -14
- package/dist/{chunk-KYJD2UMV.js → chunk-ZPHCTPR6.js} +4 -4
- package/dist/{chunk-VA7THINF.cjs → chunk-ZXXC2GXB.cjs} +38 -38
- package/dist/cli/holoscript-runner.cjs +168 -19
- package/dist/cli/holoscript-runner.js +162 -13
- package/dist/compiler/agent-inference.cjs +7 -7
- package/dist/compiler/agent-inference.js +3 -3
- package/dist/compiler/android-xr.cjs +6 -6
- package/dist/compiler/android-xr.js +4 -4
- package/dist/compiler/android.cjs +5 -5
- package/dist/compiler/android.js +3 -3
- package/dist/compiler/context.cjs +5 -5
- package/dist/compiler/context.js +2 -2
- package/dist/compiler/daimon-seed.cjs +8 -8
- package/dist/compiler/daimon-seed.js +3 -3
- package/dist/compiler/domain-block-utils.cjs +164 -164
- package/dist/compiler/domain-block-utils.js +3 -3
- package/dist/compiler/dtdl.cjs +6 -6
- package/dist/compiler/dtdl.js +3 -3
- package/dist/compiler/gltf-pipeline.cjs +8 -8
- package/dist/compiler/gltf-pipeline.js +1 -1
- package/dist/compiler/godot.cjs +5 -5
- package/dist/compiler/godot.js +4 -4
- package/dist/compiler/incremental.cjs +7 -7
- package/dist/compiler/incremental.js +2 -2
- package/dist/compiler/index.cjs +1603 -204
- package/dist/compiler/index.d.ts +8 -0
- package/dist/compiler/index.js +1431 -55
- package/dist/compiler/ios.cjs +5 -5
- package/dist/compiler/ios.js +3 -3
- package/dist/compiler/llm-provider-capabilities.cjs +5 -5
- package/dist/compiler/llm-provider-capabilities.js +2 -2
- package/dist/compiler/openxr.cjs +5 -5
- package/dist/compiler/openxr.js +4 -4
- package/dist/compiler/sdf.cjs +6 -6
- package/dist/compiler/sdf.js +4 -4
- package/dist/compiler/state.cjs +5 -5
- package/dist/compiler/state.js +3 -3
- package/dist/compiler/trait-composition.cjs +6 -6
- package/dist/compiler/trait-composition.js +2 -2
- package/dist/compiler/unity.cjs +5 -5
- package/dist/compiler/unity.js +4 -4
- package/dist/compiler/unreal.cjs +6 -6
- package/dist/compiler/unreal.js +4 -4
- package/dist/compiler/urdf.cjs +13 -13
- package/dist/compiler/urdf.js +4 -4
- package/dist/compiler/usd-physics.cjs +6 -6
- package/dist/compiler/usd-physics.js +3 -3
- package/dist/compiler/visionos.cjs +5 -5
- package/dist/compiler/visionos.js +4 -4
- package/dist/compiler/vrchat.cjs +6 -6
- package/dist/compiler/vrchat.js +4 -4
- package/dist/compiler/wasm.cjs +9 -9
- package/dist/compiler/wasm.js +4 -4
- package/dist/compiler/webgpu.cjs +5 -5
- package/dist/compiler/webgpu.js +4 -4
- 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 +871 -809
- package/dist/index.d.ts +8 -0
- package/dist/index.js +132 -70
- 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 +63 -63
- package/dist/reconstruction/index.js +7 -7
- package/dist/runtime.cjs +9 -9
- package/dist/runtime.js +3 -3
- package/dist/traits/botanical-lotus.d.ts +61 -0
- package/dist/traits/index.cjs +664 -671
- package/dist/traits/index.d.ts +65 -0
- package/dist/traits/index.js +14 -21
- package/dist/types/HoloScriptPlus.d.ts +1 -1
- package/package.json +65 -63
- package/dist/HoloCompositionParser-ZVRYVEA5.cjs +0 -45
- package/dist/HoloScriptPlusParser-WTPRPRPR.cjs +0 -30
- package/dist/HoloScriptPlusParser-ZP53ECSL.js +0 -13
package/dist/compiler/index.js
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
export { ContextCompileError, ContextCompiler, createContextCompiler } from '../chunk-
|
|
2
|
-
export { LLMCapabilityCompileError, LLMProviderCapabilitiesCompiler, createLLMProviderCapabilitiesCompiler } from '../chunk-
|
|
3
|
-
export { GLTF_PIPELINE_TOOLS, registerGLTFTools } from '../chunk-
|
|
1
|
+
export { ContextCompileError, ContextCompiler, createContextCompiler } from '../chunk-X5PMMK7H.js';
|
|
2
|
+
export { LLMCapabilityCompileError, LLMProviderCapabilitiesCompiler, createLLMProviderCapabilitiesCompiler } from '../chunk-OG7RKWWX.js';
|
|
3
|
+
export { GLTF_PIPELINE_TOOLS, registerGLTFTools } from '../chunk-M2GDE3NV.js';
|
|
4
4
|
export { BUSINESS_QUEST_TOOLS, buildVRRCompositionFromDraft, businessVRRDraftSchema, draftToHoloPreview, handleBusinessQuestToolCall, registerBusinessQuestTools, validateBusinessVRRDraft } from '../chunk-NWMJPTVL.js';
|
|
5
5
|
export { NodeToyMapper, mapNodeToyToShader } from '../chunk-TG7O4WBC.js';
|
|
6
6
|
export { createReproducibilityContext, parseReproducibilityFlags } from '../chunk-5GLCTO44.js';
|
|
7
|
-
export { QuantumCircuitCompiler } from '../chunk-
|
|
8
|
-
import { init_NextJSAPICompiler, init_DialectRegistry, DialectRegistry, init_HoloMCPCompiler, init_OmnigentAgentYamlCompiler, init_NodeServiceCompiler, init_SDKCompiler, init_LlamaServerCompiler, init_holoscript_gbnf, init_registerBuiltinDialects, init_PCGGraphCompiler } from '../chunk-
|
|
9
|
-
export { CodeEditorCompiler, CompileTimeAuthorityEffectError, CompilerBridge, ComputePhysicsCompiler, CpuPathTracer, DEFAULT_MATERIAL_KEYWORDS, DEFAULT_OBJECT_KEYWORDS, DEFAULT_PRIMITIVE_SHAPES, DesktopGPUCompiler, DialectRegistry, EdgeCompiler, FMUCompiler, GaussianSplattingCompiler, GaussianTrainCompiler, GaussianTrainConfigError, HOLOSCRIPT_GRAMMAR_PRESETS, HoloMCPCompiler, LlamaServerCompiler, MediaPipelineCompiler, NextJSAPICompiler, NodeServiceCompiler, OmnigentAgentYamlCompiler, PCGGraphCompiler, PCG_GRAPH_SCHEMA, PathTracerCompiler, PhysicsColliderCompiler, REMOTE_TRAIN_EXECUTOR, REQUIRED_SANDBOX_AUTHORITY_EFFECT, SANDBOX_AUTHORITY_TRAIT, SCMCompiler, SDKCompiler, SHARED_SORT_SHADER_PATH, SOVEREIGN_TRAIN_EXECUTOR, SVGCompiler, SpatialAudioCompiler, SpatialPartitionPass, ThreeDTilesCompiler, USDZPipeline, absorbFMU, assertAuthorityEffects, bestCategoryForTraits, checkAuthorityEffects, collectAuthorityEffectNodes, compileAllToNextJSAPI, compilePCGGraphFromBlocks, compilePipelineSource, compilePipelineSourceToNode, compilePipelineSourceToPython, compilePipelineToNode, compilePipelineToPython, compileTo3DTiles, compileToFMU, compileToNextJSAPI, compileToPCGGraph, createGaussianSplattingCompiler, createGaussianTrainCompiler, createOmnigentAgentYamlCompiler, createThreeDTilesCompiler, detectMultiUserSharedSort, ensureDialectsBooted, generateHoloScriptGbnf, isHoloScriptGrammarPreset, pcgGraphToUnrealXml, quickSafetyCheck, registerBuiltinDialects, runSafetyPass, selectModality, selectModalityForAll, spatialPartition, streamWorldTiles } from '../chunk-
|
|
7
|
+
export { QuantumCircuitCompiler } from '../chunk-E4YS5SIZ.js';
|
|
8
|
+
import { init_NextJSAPICompiler, init_DialectRegistry, DialectRegistry, init_HoloMCPCompiler, init_OmnigentAgentYamlCompiler, init_NodeServiceCompiler, init_SDKCompiler, init_LlamaServerCompiler, init_holoscript_gbnf, init_registerBuiltinDialects, init_PCGGraphCompiler } from '../chunk-PV2OXNP5.js';
|
|
9
|
+
export { CodeEditorCompiler, CompileTimeAuthorityEffectError, CompilerBridge, ComputePhysicsCompiler, CpuPathTracer, DEFAULT_MATERIAL_KEYWORDS, DEFAULT_OBJECT_KEYWORDS, DEFAULT_PRIMITIVE_SHAPES, DesktopGPUCompiler, DialectRegistry, EdgeCompiler, FMUCompiler, GaussianSplattingCompiler, GaussianTrainCompiler, GaussianTrainConfigError, HOLOSCRIPT_GRAMMAR_PRESETS, HoloMCPCompiler, LlamaServerCompiler, MediaPipelineCompiler, NextJSAPICompiler, NodeServiceCompiler, OmnigentAgentYamlCompiler, PCGGraphCompiler, PCG_GRAPH_SCHEMA, PathTracerCompiler, PhysicsColliderCompiler, REMOTE_TRAIN_EXECUTOR, REQUIRED_SANDBOX_AUTHORITY_EFFECT, SANDBOX_AUTHORITY_TRAIT, SCMCompiler, SDKCompiler, SHARED_SORT_SHADER_PATH, SOVEREIGN_TRAIN_EXECUTOR, SVGCompiler, SpatialAudioCompiler, SpatialPartitionPass, ThreeDTilesCompiler, USDZPipeline, absorbFMU, assertAuthorityEffects, bestCategoryForTraits, checkAuthorityEffects, collectAuthorityEffectNodes, compileAllToNextJSAPI, compilePCGGraphFromBlocks, compilePipelineSource, compilePipelineSourceToNode, compilePipelineSourceToPython, compilePipelineToNode, compilePipelineToPython, compileTo3DTiles, compileToFMU, compileToNextJSAPI, compileToPCGGraph, createGaussianSplattingCompiler, createGaussianTrainCompiler, createOmnigentAgentYamlCompiler, createThreeDTilesCompiler, detectMultiUserSharedSort, ensureDialectsBooted, generateHoloScriptGbnf, isHoloScriptGrammarPreset, pcgGraphToUnrealXml, quickSafetyCheck, registerBuiltinDialects, runSafetyPass, selectModality, selectModalityForAll, spatialPartition, streamWorldTiles } from '../chunk-PV2OXNP5.js';
|
|
10
10
|
export { generateHullGeometry, generateMembraneGeometry, generateSplineGeometry } from '../chunk-UDE4OZMR.js';
|
|
11
11
|
import '../chunk-3F7ZZWIN.js';
|
|
12
|
-
export { SceneIRCompiler } from '../chunk-
|
|
12
|
+
export { SceneIRCompiler } from '../chunk-X727CQ7X.js';
|
|
13
13
|
import '../chunk-2MQKNDNH.js';
|
|
14
|
-
import { init_DaimonSeedCompiler } from '../chunk-
|
|
15
|
-
export { DaimonSeedCompiler, computeExportFidelity, createDaimonSeedCompiler, runHysteresisExp2 } from '../chunk-
|
|
14
|
+
import { init_DaimonSeedCompiler } from '../chunk-PMACVMHL.js';
|
|
15
|
+
export { DaimonSeedCompiler, computeExportFidelity, createDaimonSeedCompiler, runHysteresisExp2 } from '../chunk-PMACVMHL.js';
|
|
16
16
|
import { assertHoloMapManifestContract } from '../chunk-IXWGYWH6.js';
|
|
17
17
|
export { COCOExporterImpl as COCOExporter } from '../chunk-Q56TT7IL.js';
|
|
18
18
|
export { RemotionBridgeImpl as RemotionBridge } from '../chunk-YYXH45E2.js';
|
|
19
19
|
export { SemanticSceneGraph } from '../chunk-HHRZ6STP.js';
|
|
20
|
-
import { init_AgentInferenceExportTarget } from '../chunk-
|
|
21
|
-
export { AgentInferenceCompiler, AgentInferenceExportTarget_default as AgentInferenceExportTarget, createAgentInferenceCompiler, createPythonAgentInferenceCompiler } from '../chunk-
|
|
22
|
-
import { vrTraitRegistry } from '../chunk-
|
|
20
|
+
import { init_AgentInferenceExportTarget } from '../chunk-FT4FGTR6.js';
|
|
21
|
+
export { AgentInferenceCompiler, AgentInferenceExportTarget_default as AgentInferenceExportTarget, createAgentInferenceCompiler, createPythonAgentInferenceCompiler } from '../chunk-FT4FGTR6.js';
|
|
22
|
+
import { vrTraitRegistry, evaluateExpressionIR, parseExpressionToIR, ExpressionParseError } from '../chunk-AUF7HFOO.js';
|
|
23
23
|
import '../chunk-6TRX6AR2.js';
|
|
24
|
-
import '../chunk-
|
|
24
|
+
import '../chunk-Z5V3KA7L.js';
|
|
25
25
|
import { isWebGpuEnvironmentPresent } from '../chunk-K56UVEXV.js';
|
|
26
26
|
import '../chunk-OG3MBHM3.js';
|
|
27
27
|
import '../chunk-2M2DPHKB.js';
|
|
28
28
|
import '../chunk-TDCNJHWO.js';
|
|
29
29
|
import '../chunk-VKCTYLDN.js';
|
|
30
30
|
import '../chunk-YQELFNJV.js';
|
|
31
|
-
export { USDPhysicsCompiler } from '../chunk-
|
|
32
|
-
import { init_SDFCompiler } from '../chunk-
|
|
33
|
-
export { SDFCompiler } from '../chunk-
|
|
34
|
-
import { init_StateCompiler } from '../chunk-
|
|
35
|
-
export { StateCompiler } from '../chunk-
|
|
36
|
-
export { TraitCompositionCompiler } from '../chunk-
|
|
31
|
+
export { USDPhysicsCompiler } from '../chunk-Z574GVI3.js';
|
|
32
|
+
import { init_SDFCompiler } from '../chunk-YBIHSN55.js';
|
|
33
|
+
export { SDFCompiler } from '../chunk-YBIHSN55.js';
|
|
34
|
+
import { init_StateCompiler } from '../chunk-EKNWUSGW.js';
|
|
35
|
+
export { StateCompiler } from '../chunk-EKNWUSGW.js';
|
|
36
|
+
export { TraitCompositionCompiler } from '../chunk-3MQAOMKD.js';
|
|
37
37
|
import '../chunk-DQRJ5RJG.js';
|
|
38
|
-
export { IncrementalCompiler, createIncrementalCompiler } from '../chunk-
|
|
38
|
+
export { IncrementalCompiler, createIncrementalCompiler } from '../chunk-JTDDLCSP.js';
|
|
39
39
|
import '../chunk-4R6SBXDB.js';
|
|
40
|
-
import { init_AndroidCompiler } from '../chunk-
|
|
41
|
-
export { AndroidCompiler } from '../chunk-
|
|
42
|
-
import { init_AndroidXRCompiler, init_AndroidXRTraitMap, AndroidXRCompiler, getTraitMapping, ANDROIDXR_TRAIT_MAP } from '../chunk-
|
|
43
|
-
export { AndroidXRCompiler } from '../chunk-
|
|
40
|
+
import { init_AndroidCompiler } from '../chunk-3AUYBQ5I.js';
|
|
41
|
+
export { AndroidCompiler } from '../chunk-3AUYBQ5I.js';
|
|
42
|
+
import { init_AndroidXRCompiler, init_AndroidXRTraitMap, AndroidXRCompiler, getTraitMapping, ANDROIDXR_TRAIT_MAP } from '../chunk-LJVVOVA6.js';
|
|
43
|
+
export { AndroidXRCompiler } from '../chunk-LJVVOVA6.js';
|
|
44
44
|
import '../chunk-CBSDJF3B.js';
|
|
45
|
-
import { init_IOSCompiler } from '../chunk-
|
|
46
|
-
export { IOSCompiler } from '../chunk-
|
|
47
|
-
import { init_VisionOSCompiler, init_VisionOSTraitMap, getTraitMapping as getTraitMapping$1, listAllTraits, generateTraitCode } from '../chunk-
|
|
48
|
-
export { VisionOSCompiler } from '../chunk-
|
|
49
|
-
import { init_WASMCompiler } from '../chunk-
|
|
50
|
-
export { WASMCompiler } from '../chunk-
|
|
51
|
-
import { init_WebGPUCompiler, WebGPUCompiler } from '../chunk-
|
|
52
|
-
export { WebGPUCompiler } from '../chunk-
|
|
53
|
-
import { init_DTDLCompiler } from '../chunk-
|
|
54
|
-
export { DTDLCompiler } from '../chunk-
|
|
55
|
-
import { init_URDFCompiler } from '../chunk-
|
|
56
|
-
export { URDFCompiler, createURDFCompiler } from '../chunk-
|
|
45
|
+
import { init_IOSCompiler } from '../chunk-7AY66PZP.js';
|
|
46
|
+
export { IOSCompiler } from '../chunk-7AY66PZP.js';
|
|
47
|
+
import { init_VisionOSCompiler, init_VisionOSTraitMap, getTraitMapping as getTraitMapping$1, listAllTraits, generateTraitCode } from '../chunk-ULT2QAV5.js';
|
|
48
|
+
export { VisionOSCompiler } from '../chunk-ULT2QAV5.js';
|
|
49
|
+
import { init_WASMCompiler } from '../chunk-PFZ5WLIP.js';
|
|
50
|
+
export { WASMCompiler } from '../chunk-PFZ5WLIP.js';
|
|
51
|
+
import { init_WebGPUCompiler, WebGPUCompiler } from '../chunk-WQJMSSJT.js';
|
|
52
|
+
export { WebGPUCompiler } from '../chunk-WQJMSSJT.js';
|
|
53
|
+
import { init_DTDLCompiler } from '../chunk-PLK3DLTF.js';
|
|
54
|
+
export { DTDLCompiler } from '../chunk-PLK3DLTF.js';
|
|
55
|
+
import { init_URDFCompiler } from '../chunk-TZM6DKSJ.js';
|
|
56
|
+
export { URDFCompiler, createURDFCompiler } from '../chunk-TZM6DKSJ.js';
|
|
57
57
|
import '../chunk-JBQXZIWB.js';
|
|
58
|
-
import { init_OpenXRCompiler } from '../chunk-
|
|
59
|
-
export { OpenXRCompiler } from '../chunk-
|
|
60
|
-
import { init_VRChatCompiler } from '../chunk-
|
|
61
|
-
export { VRChatCompiler } from '../chunk-
|
|
62
|
-
import { init_UnityCompiler } from '../chunk-
|
|
63
|
-
export { UnityCompiler } from '../chunk-
|
|
64
|
-
import '../chunk-
|
|
58
|
+
import { init_OpenXRCompiler } from '../chunk-AAUQTR7I.js';
|
|
59
|
+
export { OpenXRCompiler } from '../chunk-AAUQTR7I.js';
|
|
60
|
+
import { init_VRChatCompiler } from '../chunk-7HDRN5BW.js';
|
|
61
|
+
export { VRChatCompiler } from '../chunk-7HDRN5BW.js';
|
|
62
|
+
import { init_UnityCompiler } from '../chunk-ZPHCTPR6.js';
|
|
63
|
+
export { UnityCompiler } from '../chunk-ZPHCTPR6.js';
|
|
64
|
+
import '../chunk-2UP2J3OK.js';
|
|
65
65
|
import { init_PlatformConditionalCompilerMixin } from '../chunk-DJNH4HFW.js';
|
|
66
66
|
export { PlatformConditionalCompilerMixin, createPlatformTarget, filterCompositionForPlatform, matchesPlatformConstraint, normalizePlatformName } from '../chunk-DJNH4HFW.js';
|
|
67
|
-
import { init_GodotCompiler } from '../chunk-
|
|
68
|
-
export { GodotCompiler } from '../chunk-
|
|
69
|
-
import '../chunk-
|
|
67
|
+
import { init_GodotCompiler } from '../chunk-ETIJOUIO.js';
|
|
68
|
+
export { GodotCompiler } from '../chunk-ETIJOUIO.js';
|
|
69
|
+
import '../chunk-TW2AH2ZS.js';
|
|
70
70
|
import { init_PerceptualColorPass } from '../chunk-UCVZXQ63.js';
|
|
71
71
|
export { SCIENTIFIC_COLOR_MAPS, analyzePerceptualColor, applyPerceptualColorPass, buildPerceptualGradient, buildPerceptualPalette, hexToSrgb, normalizeHexColor, srgbToHex } from '../chunk-UCVZXQ63.js';
|
|
72
|
-
import { init_CompilerBase, init_CompilerDocumentationGenerator, CompilerBase } from '../chunk-
|
|
73
|
-
export { CompilerBase, CompilerDocumentationGenerator, UnauthorizedCompilerAccessError, createTestCompilerToken, isCapabilityTokenCredential } from '../chunk-
|
|
72
|
+
import { init_CompilerBase, init_CompilerDocumentationGenerator, CompilerBase } from '../chunk-QC3CAVFN.js';
|
|
73
|
+
export { CompilerBase, CompilerDocumentationGenerator, UnauthorizedCompilerAccessError, createTestCompilerToken, isCapabilityTokenCredential } from '../chunk-QC3CAVFN.js';
|
|
74
74
|
import { init_traitDocs, getTraitDoc, getAllTraitNames } from '../chunk-IA7FCSRY.js';
|
|
75
75
|
import '../chunk-5CURIYGT.js';
|
|
76
76
|
import '../chunk-33YHE7HX.js';
|
|
77
77
|
import '../chunk-GLEJ2TLS.js';
|
|
78
78
|
import '../chunk-SYTRBGDS.js';
|
|
79
79
|
import '../chunk-UNMVGZVW.js';
|
|
80
|
-
import '../chunk-
|
|
81
|
-
import '../chunk-
|
|
80
|
+
import '../chunk-QS27OYBU.js';
|
|
81
|
+
import '../chunk-ANMME7XT.js';
|
|
82
82
|
import '../chunk-7I74JWPW.js';
|
|
83
83
|
import '../chunk-2I3XAGMF.js';
|
|
84
84
|
import '../chunk-MD4IVS42.js';
|
|
85
85
|
import { ExpressionEvaluator } from '../chunk-XL6INWKT.js';
|
|
86
|
-
import '../chunk-
|
|
86
|
+
import '../chunk-6OQHLNTT.js';
|
|
87
87
|
import '../chunk-PHENW4MQ.js';
|
|
88
88
|
import '../chunk-ZVFHPMC5.js';
|
|
89
89
|
import { init_safeJsonParse, readJson } from '../chunk-RAN3ECAS.js';
|
|
@@ -94,6 +94,80 @@ import { createHash } from 'crypto';
|
|
|
94
94
|
// src/compiler/index.ts
|
|
95
95
|
init_CompilerBase();
|
|
96
96
|
init_CompilerDocumentationGenerator();
|
|
97
|
+
|
|
98
|
+
// src/compiler/SceneIRTsxEmitter.ts
|
|
99
|
+
var GENERATED_HEADER = "// @generated by HoloScript SceneIRTsxEmitter -- DO NOT EDIT";
|
|
100
|
+
function emitSceneIRTsx(root, options = {}) {
|
|
101
|
+
const componentName = sanitizeComponentName(options.componentName ?? root.id ?? "HoloScene");
|
|
102
|
+
const sceneConstName = `${componentName}SceneIR`;
|
|
103
|
+
const imports = [
|
|
104
|
+
options.includeCanvas ?? true ? "import { Canvas } from '@react-three/fiber';" : "",
|
|
105
|
+
"import { HoloSceneIRRenderer } from '@holoscript/r3f-renderer';"
|
|
106
|
+
].filter(Boolean);
|
|
107
|
+
const source = options.sourcePath ? `// source: ${options.sourcePath}
|
|
108
|
+
` : "";
|
|
109
|
+
if (options.includeCanvas === false) {
|
|
110
|
+
return [
|
|
111
|
+
GENERATED_HEADER,
|
|
112
|
+
source.trimEnd(),
|
|
113
|
+
...imports,
|
|
114
|
+
"",
|
|
115
|
+
`const ${sceneConstName} = ${json(root)};`,
|
|
116
|
+
"",
|
|
117
|
+
`export function ${componentName}() {`,
|
|
118
|
+
` return <HoloSceneIRRenderer node={${sceneConstName}} />;`,
|
|
119
|
+
"}",
|
|
120
|
+
"",
|
|
121
|
+
`export default ${componentName};`,
|
|
122
|
+
""
|
|
123
|
+
].filter((line, idx) => line !== "" || idx !== 1).join("\n");
|
|
124
|
+
}
|
|
125
|
+
return [
|
|
126
|
+
GENERATED_HEADER,
|
|
127
|
+
source.trimEnd(),
|
|
128
|
+
...imports,
|
|
129
|
+
"",
|
|
130
|
+
`const ${sceneConstName} = ${json(root)};`,
|
|
131
|
+
"",
|
|
132
|
+
`export function ${componentName}() {`,
|
|
133
|
+
" return (",
|
|
134
|
+
" <Canvas>",
|
|
135
|
+
` <HoloSceneIRRenderer node={${sceneConstName}} />`,
|
|
136
|
+
" </Canvas>",
|
|
137
|
+
" );",
|
|
138
|
+
"}",
|
|
139
|
+
"",
|
|
140
|
+
`export default ${componentName};`,
|
|
141
|
+
""
|
|
142
|
+
].filter((line, idx) => line !== "" || idx !== 1).join("\n");
|
|
143
|
+
}
|
|
144
|
+
function sanitizeComponentName(name) {
|
|
145
|
+
const words = name.replace(/[^A-Za-z0-9_$]+/g, " ").trim().split(/\s+/).filter(Boolean);
|
|
146
|
+
const joined = words.map((word) => word[0].toUpperCase() + word.slice(1)).join("");
|
|
147
|
+
const candidate = joined || "HoloScene";
|
|
148
|
+
return /^[A-Za-z_$]/.test(candidate) ? candidate : `HoloScene${candidate}`;
|
|
149
|
+
}
|
|
150
|
+
function json(value) {
|
|
151
|
+
return JSON.stringify(normalizeValue(value), null, 2).replace(/</g, "\\u003c");
|
|
152
|
+
}
|
|
153
|
+
function normalizeValue(value) {
|
|
154
|
+
if (ArrayBuffer.isView(value) && !(value instanceof DataView)) {
|
|
155
|
+
return Array.from(value);
|
|
156
|
+
}
|
|
157
|
+
if (Array.isArray(value)) {
|
|
158
|
+
return value.map((entry) => normalizeValue(entry));
|
|
159
|
+
}
|
|
160
|
+
if (value && typeof value === "object") {
|
|
161
|
+
const out = {};
|
|
162
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
163
|
+
out[key] = normalizeValue(entry);
|
|
164
|
+
}
|
|
165
|
+
return out;
|
|
166
|
+
}
|
|
167
|
+
return value;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// src/compiler/index.ts
|
|
97
171
|
init_PerceptualColorPass();
|
|
98
172
|
init_UnityCompiler();
|
|
99
173
|
init_GodotCompiler();
|
|
@@ -2148,6 +2222,1306 @@ init_HoloMCPCompiler();
|
|
|
2148
2222
|
init_AgentInferenceExportTarget();
|
|
2149
2223
|
init_OmnigentAgentYamlCompiler();
|
|
2150
2224
|
init_DaimonSeedCompiler();
|
|
2225
|
+
|
|
2226
|
+
// src/compiler/HSIIRCompiler.ts
|
|
2227
|
+
init_CompilerBase();
|
|
2228
|
+
var HSI_IR_SCHEMA_VERSION = "holoscript.hsi-ir.v0.1.0";
|
|
2229
|
+
var HSI_TRACE_SCHEMA_VERSION = "holoscript.hsi-trace.v0.1.0";
|
|
2230
|
+
var HSI_LEARNING_GRAPH_SCHEMA_VERSION = "holoscript.learning-graph.v0.1.0";
|
|
2231
|
+
var HSI_AUDIT_SCHEMA_VERSION = "holoscript.hsi-audit.v0.1.0";
|
|
2232
|
+
var HSIAdmissionError = class extends Error {
|
|
2233
|
+
constructor(code, message) {
|
|
2234
|
+
super(`[${code}] ${message}`);
|
|
2235
|
+
this.name = "HSIAdmissionError";
|
|
2236
|
+
this.code = code;
|
|
2237
|
+
}
|
|
2238
|
+
};
|
|
2239
|
+
function hsiStableStringify(value) {
|
|
2240
|
+
if (value === null || typeof value !== "object") {
|
|
2241
|
+
return JSON.stringify(value) ?? "null";
|
|
2242
|
+
}
|
|
2243
|
+
if (Array.isArray(value)) {
|
|
2244
|
+
return `[${value.map((item) => hsiStableStringify(item)).join(",")}]`;
|
|
2245
|
+
}
|
|
2246
|
+
const record = value;
|
|
2247
|
+
const keys = Object.keys(record).filter((key) => record[key] !== void 0).sort();
|
|
2248
|
+
return `{${keys.map((key) => `${JSON.stringify(key)}:${hsiStableStringify(record[key])}`).join(",")}}`;
|
|
2249
|
+
}
|
|
2250
|
+
function hsiSha256(value) {
|
|
2251
|
+
return `sha256:${createHash("sha256").update(hsiStableStringify(value)).digest("hex")}`;
|
|
2252
|
+
}
|
|
2253
|
+
function hsiSourceTextDigest(source) {
|
|
2254
|
+
return `sha256:${createHash("sha256").update(source.replace(/\r\n/g, "\n")).digest("hex")}`;
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
// src/compiler/HSIIRCompiler.ts
|
|
2258
|
+
var HSI_OBSERVATION_MEDIATOR_EDGE = "shields";
|
|
2259
|
+
var ASSIGN_OPERATORS = /* @__PURE__ */ new Set(["=", "+=", "-=", "*=", "/="]);
|
|
2260
|
+
var BINARY_OPERATORS = /* @__PURE__ */ new Set([
|
|
2261
|
+
"+",
|
|
2262
|
+
"-",
|
|
2263
|
+
"*",
|
|
2264
|
+
"/",
|
|
2265
|
+
"%",
|
|
2266
|
+
"===",
|
|
2267
|
+
"!==",
|
|
2268
|
+
"==",
|
|
2269
|
+
"!=",
|
|
2270
|
+
"<",
|
|
2271
|
+
">",
|
|
2272
|
+
"<=",
|
|
2273
|
+
">=",
|
|
2274
|
+
"&&",
|
|
2275
|
+
"||"
|
|
2276
|
+
]);
|
|
2277
|
+
function spanOf(node) {
|
|
2278
|
+
const loc = node?.loc;
|
|
2279
|
+
if (!loc) return void 0;
|
|
2280
|
+
return {
|
|
2281
|
+
line: loc.start.line,
|
|
2282
|
+
column: loc.start.column,
|
|
2283
|
+
endLine: loc.end.line,
|
|
2284
|
+
endColumn: loc.end.column
|
|
2285
|
+
};
|
|
2286
|
+
}
|
|
2287
|
+
function scalarType(value) {
|
|
2288
|
+
if (value === null) return "null";
|
|
2289
|
+
return typeof value;
|
|
2290
|
+
}
|
|
2291
|
+
function asScalar(value, where) {
|
|
2292
|
+
if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
2293
|
+
return value;
|
|
2294
|
+
}
|
|
2295
|
+
throw new HSIAdmissionError(
|
|
2296
|
+
"unsupported-value",
|
|
2297
|
+
`${where}: HS-Core v0 admits scalar values only, got ${Array.isArray(value) ? "array" : typeof value}`
|
|
2298
|
+
);
|
|
2299
|
+
}
|
|
2300
|
+
function asTriple(value, where) {
|
|
2301
|
+
let arr;
|
|
2302
|
+
if (Array.isArray(value)) {
|
|
2303
|
+
arr = value;
|
|
2304
|
+
} else if (typeof value === "object" && value !== null && "x" in value) {
|
|
2305
|
+
const vec = value;
|
|
2306
|
+
arr = [vec["x"], vec["y"], vec["z"]];
|
|
2307
|
+
}
|
|
2308
|
+
if (!arr || arr.length !== 3 || !arr.every((n) => typeof n === "number" && Number.isFinite(n))) {
|
|
2309
|
+
throw new HSIAdmissionError("invalid-spatial", `${where}: position/scale must be a finite numeric triple`);
|
|
2310
|
+
}
|
|
2311
|
+
return [arr[0], arr[1], arr[2]];
|
|
2312
|
+
}
|
|
2313
|
+
function collectSlots(ir, into) {
|
|
2314
|
+
switch (ir.kind) {
|
|
2315
|
+
case "Identifier":
|
|
2316
|
+
into.add(ir.name);
|
|
2317
|
+
return;
|
|
2318
|
+
case "BinaryExpression":
|
|
2319
|
+
collectSlots(ir.left, into);
|
|
2320
|
+
collectSlots(ir.right, into);
|
|
2321
|
+
return;
|
|
2322
|
+
case "UnaryExpression":
|
|
2323
|
+
collectSlots(ir.argument, into);
|
|
2324
|
+
return;
|
|
2325
|
+
case "MemberExpression":
|
|
2326
|
+
collectSlots(ir.object, into);
|
|
2327
|
+
return;
|
|
2328
|
+
case "CallExpression":
|
|
2329
|
+
for (const arg of ir.arguments) collectSlots(arg, into);
|
|
2330
|
+
return;
|
|
2331
|
+
case "Literal":
|
|
2332
|
+
return;
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
function assertSlots(ir, allowed, where) {
|
|
2336
|
+
const used = /* @__PURE__ */ new Set();
|
|
2337
|
+
collectSlots(ir, used);
|
|
2338
|
+
for (const name of used) {
|
|
2339
|
+
if (!allowed.has(name)) {
|
|
2340
|
+
throw new HSIAdmissionError("unknown-slot", `${where}: expression reads undeclared slot "${name}"`);
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
return [...used].sort();
|
|
2344
|
+
}
|
|
2345
|
+
function lowerHoloExpression(expr, where) {
|
|
2346
|
+
switch (expr.type) {
|
|
2347
|
+
case "Literal":
|
|
2348
|
+
return { kind: "Literal", value: expr.value };
|
|
2349
|
+
case "Identifier":
|
|
2350
|
+
return { kind: "Identifier", name: expr.name };
|
|
2351
|
+
case "BinaryExpression": {
|
|
2352
|
+
if (!BINARY_OPERATORS.has(expr.operator)) {
|
|
2353
|
+
throw new HSIAdmissionError("unsupported-operator", `${where}: operator "${expr.operator}"`);
|
|
2354
|
+
}
|
|
2355
|
+
return {
|
|
2356
|
+
kind: "BinaryExpression",
|
|
2357
|
+
operator: expr.operator,
|
|
2358
|
+
left: lowerHoloExpression(expr.left, where),
|
|
2359
|
+
right: lowerHoloExpression(expr.right, where)
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2362
|
+
case "UnaryExpression":
|
|
2363
|
+
return {
|
|
2364
|
+
kind: "UnaryExpression",
|
|
2365
|
+
operator: expr.operator,
|
|
2366
|
+
argument: lowerHoloExpression(expr.argument, where)
|
|
2367
|
+
};
|
|
2368
|
+
case "MemberExpression": {
|
|
2369
|
+
if (expr.computed) {
|
|
2370
|
+
throw new HSIAdmissionError("unsupported-expression", `${where}: computed member access`);
|
|
2371
|
+
}
|
|
2372
|
+
return {
|
|
2373
|
+
kind: "MemberExpression",
|
|
2374
|
+
object: lowerHoloExpression(expr.object, where),
|
|
2375
|
+
property: expr.property
|
|
2376
|
+
};
|
|
2377
|
+
}
|
|
2378
|
+
default:
|
|
2379
|
+
throw new HSIAdmissionError("unsupported-expression", `${where}: ${expr.type} is outside HS-Core v0`);
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
function lowerEntities(composition) {
|
|
2383
|
+
const templates = /* @__PURE__ */ new Map();
|
|
2384
|
+
for (const template of composition.templates ?? []) {
|
|
2385
|
+
if (templates.has(template.name)) {
|
|
2386
|
+
throw new HSIAdmissionError("duplicate-template", `template "${template.name}" declared twice`);
|
|
2387
|
+
}
|
|
2388
|
+
templates.set(template.name, template);
|
|
2389
|
+
}
|
|
2390
|
+
const entities = /* @__PURE__ */ new Map();
|
|
2391
|
+
for (const obj of composition.objects ?? []) {
|
|
2392
|
+
if (entities.has(obj.name)) {
|
|
2393
|
+
throw new HSIAdmissionError("duplicate-entity", `entity "${obj.name}" declared twice`);
|
|
2394
|
+
}
|
|
2395
|
+
if ((obj.children ?? []).length > 0) {
|
|
2396
|
+
throw new HSIAdmissionError("unsupported-value", `entity "${obj.name}": nested children are outside HS-Core v0`);
|
|
2397
|
+
}
|
|
2398
|
+
const components = {};
|
|
2399
|
+
const traitNames = /* @__PURE__ */ new Set();
|
|
2400
|
+
let template;
|
|
2401
|
+
if (obj.template !== void 0) {
|
|
2402
|
+
template = templates.get(obj.template);
|
|
2403
|
+
if (!template) {
|
|
2404
|
+
throw new HSIAdmissionError("unknown-archetype", `entity "${obj.name}" uses missing template "${obj.template}"`);
|
|
2405
|
+
}
|
|
2406
|
+
for (const prop of template.properties ?? []) {
|
|
2407
|
+
if (prop.key === "position" || prop.key === "scale") continue;
|
|
2408
|
+
components[prop.key] = asScalar(prop.value, `template "${template.name}".${prop.key}`);
|
|
2409
|
+
}
|
|
2410
|
+
for (const trait of template.traits ?? []) traitNames.add(trait.name);
|
|
2411
|
+
}
|
|
2412
|
+
let position;
|
|
2413
|
+
let scale;
|
|
2414
|
+
for (const prop of obj.properties ?? []) {
|
|
2415
|
+
if (prop.key === "position") {
|
|
2416
|
+
position = asTriple(prop.value, `entity "${obj.name}".position`);
|
|
2417
|
+
continue;
|
|
2418
|
+
}
|
|
2419
|
+
if (prop.key === "scale") {
|
|
2420
|
+
scale = asTriple(prop.value, `entity "${obj.name}".scale`);
|
|
2421
|
+
continue;
|
|
2422
|
+
}
|
|
2423
|
+
components[prop.key] = asScalar(prop.value, `entity "${obj.name}".${prop.key}`);
|
|
2424
|
+
}
|
|
2425
|
+
for (const trait of obj.traits ?? []) traitNames.add(trait.name);
|
|
2426
|
+
const opaqueValue = components["opaque"];
|
|
2427
|
+
const opacity = opaqueValue === void 0 ? "unknown" : opaqueValue === true ? "opaque" : "transparent";
|
|
2428
|
+
delete components["opaque"];
|
|
2429
|
+
const role = typeof components["role"] === "string" ? components["role"] : void 0;
|
|
2430
|
+
const entity = {
|
|
2431
|
+
id: `entity:${obj.name}`,
|
|
2432
|
+
name: obj.name,
|
|
2433
|
+
opacity,
|
|
2434
|
+
components,
|
|
2435
|
+
traits: [...traitNames].sort(),
|
|
2436
|
+
sourceSpan: spanOf(obj)
|
|
2437
|
+
};
|
|
2438
|
+
if (obj.template !== void 0) entity.archetype = obj.template;
|
|
2439
|
+
if (role !== void 0) entity.role = role;
|
|
2440
|
+
if (position === void 0 && obj.position !== void 0) {
|
|
2441
|
+
position = asTriple(obj.position, `entity "${obj.name}".position`);
|
|
2442
|
+
}
|
|
2443
|
+
if (scale === void 0 && obj.scale !== void 0) {
|
|
2444
|
+
scale = asTriple(obj.scale, `entity "${obj.name}".scale`);
|
|
2445
|
+
}
|
|
2446
|
+
if (position !== void 0) entity.position = position;
|
|
2447
|
+
if (scale !== void 0) entity.scale = scale;
|
|
2448
|
+
entities.set(obj.name, entity);
|
|
2449
|
+
}
|
|
2450
|
+
return { templates, entities };
|
|
2451
|
+
}
|
|
2452
|
+
function lowerRelations(composition, entities) {
|
|
2453
|
+
const relations = [];
|
|
2454
|
+
const connections = composition.connections ?? [];
|
|
2455
|
+
for (const conn of connections) {
|
|
2456
|
+
for (const endpoint of [conn.from, conn.to]) {
|
|
2457
|
+
if (!entities.has(endpoint)) {
|
|
2458
|
+
throw new HSIAdmissionError(
|
|
2459
|
+
"unknown-relation-endpoint",
|
|
2460
|
+
`connection ${conn.from} -> ${conn.to} references undeclared entity "${endpoint}"`
|
|
2461
|
+
);
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
const edgeType = conn.edgeType ?? "connects";
|
|
2465
|
+
relations.push({
|
|
2466
|
+
id: `relation:${conn.from}->${conn.to}:${edgeType}`,
|
|
2467
|
+
from: conn.from,
|
|
2468
|
+
to: conn.to,
|
|
2469
|
+
edgeType,
|
|
2470
|
+
sourceSpan: spanOf(conn)
|
|
2471
|
+
});
|
|
2472
|
+
}
|
|
2473
|
+
return relations;
|
|
2474
|
+
}
|
|
2475
|
+
function lowerState(composition) {
|
|
2476
|
+
const fields = [];
|
|
2477
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2478
|
+
for (const prop of composition.state?.properties ?? []) {
|
|
2479
|
+
if (seen.has(prop.key)) {
|
|
2480
|
+
throw new HSIAdmissionError("duplicate-state-key", `state key "${prop.key}" declared twice`);
|
|
2481
|
+
}
|
|
2482
|
+
seen.add(prop.key);
|
|
2483
|
+
const baseline = asScalar(prop.value, `state.${prop.key}`);
|
|
2484
|
+
fields.push({
|
|
2485
|
+
id: `state:world.${prop.key}`,
|
|
2486
|
+
key: prop.key,
|
|
2487
|
+
baseline,
|
|
2488
|
+
valueType: scalarType(baseline),
|
|
2489
|
+
reactive: prop.reactive === true,
|
|
2490
|
+
sourceSpan: spanOf(prop)
|
|
2491
|
+
});
|
|
2492
|
+
}
|
|
2493
|
+
return fields;
|
|
2494
|
+
}
|
|
2495
|
+
function deriveObservationPolicy(entities, relations) {
|
|
2496
|
+
const rules = [];
|
|
2497
|
+
const observers = [...entities.values()].filter((e) => e.role === "agent");
|
|
2498
|
+
const mediatorsByTarget = /* @__PURE__ */ new Map();
|
|
2499
|
+
for (const rel of relations) {
|
|
2500
|
+
if (rel.edgeType !== HSI_OBSERVATION_MEDIATOR_EDGE) continue;
|
|
2501
|
+
const list = mediatorsByTarget.get(rel.to) ?? [];
|
|
2502
|
+
list.push(entities.get(rel.from));
|
|
2503
|
+
mediatorsByTarget.set(rel.to, list);
|
|
2504
|
+
}
|
|
2505
|
+
for (const observer of observers) {
|
|
2506
|
+
for (const observed of entities.values()) {
|
|
2507
|
+
if (observed.name === observer.name) continue;
|
|
2508
|
+
if (observed.role === "barrier") continue;
|
|
2509
|
+
const mediators = (mediatorsByTarget.get(observed.name) ?? []).slice().sort((a, b) => a.name.localeCompare(b.name));
|
|
2510
|
+
const access = mediators.some((m) => m.opacity === "opaque") ? "blocked" : mediators.some((m) => m.opacity === "unknown") ? "unknown" : "visible";
|
|
2511
|
+
rules.push({
|
|
2512
|
+
id: `obs:${observer.name}->${observed.name}`,
|
|
2513
|
+
observer: observer.name,
|
|
2514
|
+
observed: observed.name,
|
|
2515
|
+
access,
|
|
2516
|
+
mediators: mediators.map((m) => m.name)
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
return rules;
|
|
2521
|
+
}
|
|
2522
|
+
function lowerStatements(statements, handlerEvent, stateSlots, counter) {
|
|
2523
|
+
const effects = [];
|
|
2524
|
+
for (const stmt of statements) {
|
|
2525
|
+
const ordinal = counter.n++;
|
|
2526
|
+
const id = `effect:${handlerEvent}#${ordinal}`;
|
|
2527
|
+
switch (stmt.type) {
|
|
2528
|
+
case "Assignment": {
|
|
2529
|
+
if (!ASSIGN_OPERATORS.has(stmt.operator)) {
|
|
2530
|
+
throw new HSIAdmissionError("unsupported-operator", `${id}: assignment operator "${stmt.operator}"`);
|
|
2531
|
+
}
|
|
2532
|
+
const target = stmt.target.startsWith("state.") ? stmt.target.slice("state.".length) : stmt.target;
|
|
2533
|
+
if (!stateSlots.has(target)) {
|
|
2534
|
+
throw new HSIAdmissionError("unknown-assignment-target", `${id}: "${stmt.target}" is not a declared state key`);
|
|
2535
|
+
}
|
|
2536
|
+
const value = lowerHoloExpression(stmt.value, id);
|
|
2537
|
+
assertSlots(value, stateSlots, id);
|
|
2538
|
+
effects.push({ kind: "assign", id, target, operator: stmt.operator, value, sourceSpan: spanOf(stmt) });
|
|
2539
|
+
break;
|
|
2540
|
+
}
|
|
2541
|
+
case "EmitStatement": {
|
|
2542
|
+
effects.push({ kind: "emit", id, event: stmt.event, sourceSpan: spanOf(stmt) });
|
|
2543
|
+
break;
|
|
2544
|
+
}
|
|
2545
|
+
case "IfStatement": {
|
|
2546
|
+
const condition = lowerHoloExpression(stmt.condition, id);
|
|
2547
|
+
assertSlots(condition, stateSlots, id);
|
|
2548
|
+
effects.push({
|
|
2549
|
+
kind: "branch",
|
|
2550
|
+
id,
|
|
2551
|
+
condition,
|
|
2552
|
+
then: lowerStatements(stmt.consequent, handlerEvent, stateSlots, counter),
|
|
2553
|
+
else: lowerStatements(stmt.alternate ?? [], handlerEvent, stateSlots, counter),
|
|
2554
|
+
sourceSpan: spanOf(stmt)
|
|
2555
|
+
});
|
|
2556
|
+
break;
|
|
2557
|
+
}
|
|
2558
|
+
default:
|
|
2559
|
+
throw new HSIAdmissionError("unsupported-statement", `${id}: ${stmt.type} is outside HS-Core v0`);
|
|
2560
|
+
}
|
|
2561
|
+
}
|
|
2562
|
+
return effects;
|
|
2563
|
+
}
|
|
2564
|
+
function lowerEventHandlers(composition, stateSlots) {
|
|
2565
|
+
const logic = composition.logic;
|
|
2566
|
+
const handlers = [];
|
|
2567
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2568
|
+
for (const handler of logic?.handlers ?? []) {
|
|
2569
|
+
if (seen.has(handler.event)) {
|
|
2570
|
+
throw new HSIAdmissionError("duplicate-handler", `handler "${handler.event}" declared twice`);
|
|
2571
|
+
}
|
|
2572
|
+
seen.add(handler.event);
|
|
2573
|
+
handlers.push({
|
|
2574
|
+
id: `event:${handler.event}`,
|
|
2575
|
+
event: handler.event,
|
|
2576
|
+
effects: lowerStatements(handler.body, handler.event, stateSlots, { n: 0 }),
|
|
2577
|
+
sourceSpan: spanOf(handler)
|
|
2578
|
+
});
|
|
2579
|
+
}
|
|
2580
|
+
return handlers;
|
|
2581
|
+
}
|
|
2582
|
+
function lowerMachine(machine) {
|
|
2583
|
+
const stateNames = Object.keys(machine.states ?? {});
|
|
2584
|
+
if (stateNames.length === 0) {
|
|
2585
|
+
throw new HSIAdmissionError("admission-skewed", `state machine "${machine.name}" declares no states`);
|
|
2586
|
+
}
|
|
2587
|
+
if (!stateNames.includes(machine.initialState)) {
|
|
2588
|
+
throw new HSIAdmissionError(
|
|
2589
|
+
"unknown-initial-state",
|
|
2590
|
+
`state machine "${machine.name}": initial state "${machine.initialState}" is not declared`
|
|
2591
|
+
);
|
|
2592
|
+
}
|
|
2593
|
+
const inputs = (machine.inputs ?? []).map((input) => ({
|
|
2594
|
+
id: `input:${machine.name}.${input.name}`,
|
|
2595
|
+
name: input.name,
|
|
2596
|
+
inputType: input.inputType,
|
|
2597
|
+
baseline: input.default !== void 0 ? input.default : input.inputType === "bool" || input.inputType === "trigger" ? false : 0
|
|
2598
|
+
}));
|
|
2599
|
+
const inputSlots = new Set(inputs.map((i) => i.name));
|
|
2600
|
+
const allTransitions = [];
|
|
2601
|
+
for (const t of machine.transitions ?? []) {
|
|
2602
|
+
allTransitions.push({ from: t.from && t.from !== "any" ? t.from : t.from ?? "any", t });
|
|
2603
|
+
}
|
|
2604
|
+
for (const stateName of stateNames) {
|
|
2605
|
+
for (const t of machine.states[stateName]?.transitions ?? []) {
|
|
2606
|
+
allTransitions.push({ from: t.from ?? stateName, t });
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
const ordinals = /* @__PURE__ */ new Map();
|
|
2610
|
+
const transitions = allTransitions.map(({ from, t }, declarationOrdinal) => {
|
|
2611
|
+
if (from !== "any" && !stateNames.includes(from)) {
|
|
2612
|
+
throw new HSIAdmissionError(
|
|
2613
|
+
"unknown-transition-endpoint",
|
|
2614
|
+
`state machine "${machine.name}": transition from undeclared state "${from}"`
|
|
2615
|
+
);
|
|
2616
|
+
}
|
|
2617
|
+
if (!stateNames.includes(t.target)) {
|
|
2618
|
+
throw new HSIAdmissionError(
|
|
2619
|
+
"unknown-transition-endpoint",
|
|
2620
|
+
`state machine "${machine.name}": transition to undeclared state "${t.target}"`
|
|
2621
|
+
);
|
|
2622
|
+
}
|
|
2623
|
+
const baseId = `transition:${machine.name}.${from}->${t.target}`;
|
|
2624
|
+
const ordinal = ordinals.get(baseId) ?? 0;
|
|
2625
|
+
ordinals.set(baseId, ordinal + 1);
|
|
2626
|
+
const id = `${baseId}#${ordinal}`;
|
|
2627
|
+
let guard;
|
|
2628
|
+
if (t.condition) {
|
|
2629
|
+
guard = lowerHoloExpression(t.condition, id);
|
|
2630
|
+
} else if ((t.conditions ?? []).length > 0) {
|
|
2631
|
+
for (const cond of t.conditions) {
|
|
2632
|
+
const clause = {
|
|
2633
|
+
kind: "BinaryExpression",
|
|
2634
|
+
operator: cond.operator,
|
|
2635
|
+
left: { kind: "Identifier", name: cond.parameter },
|
|
2636
|
+
right: { kind: "Literal", value: cond.value }
|
|
2637
|
+
};
|
|
2638
|
+
guard = guard ? { kind: "BinaryExpression", operator: cond.chain === "or" ? "||" : "&&", left: guard, right: clause } : clause;
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2641
|
+
if (!guard) {
|
|
2642
|
+
throw new HSIAdmissionError("admission-skewed", `${id}: transition has neither guard nor trigger condition`);
|
|
2643
|
+
}
|
|
2644
|
+
const reads = assertSlots(guard, inputSlots, id);
|
|
2645
|
+
const transition = {
|
|
2646
|
+
id,
|
|
2647
|
+
from,
|
|
2648
|
+
target: t.target,
|
|
2649
|
+
priority: declarationOrdinal,
|
|
2650
|
+
guard,
|
|
2651
|
+
reads,
|
|
2652
|
+
sourceSpan: spanOf(t)
|
|
2653
|
+
};
|
|
2654
|
+
if (t.event !== void 0) transition.event = t.event;
|
|
2655
|
+
return transition;
|
|
2656
|
+
});
|
|
2657
|
+
return {
|
|
2658
|
+
id: `machine:${machine.name}`,
|
|
2659
|
+
name: machine.name,
|
|
2660
|
+
initialState: machine.initialState,
|
|
2661
|
+
states: [...stateNames].sort(),
|
|
2662
|
+
inputs,
|
|
2663
|
+
transitions,
|
|
2664
|
+
sourceSpan: spanOf(machine)
|
|
2665
|
+
};
|
|
2666
|
+
}
|
|
2667
|
+
function lowerPredicates(composition, stateSlots) {
|
|
2668
|
+
const predicates = [];
|
|
2669
|
+
const slotList = [...stateSlots];
|
|
2670
|
+
const lowerClause = (kind, name, expr) => {
|
|
2671
|
+
const id = `${kind}:${name}`;
|
|
2672
|
+
let ir;
|
|
2673
|
+
try {
|
|
2674
|
+
ir = parseExpressionToIR(expr, slotList);
|
|
2675
|
+
} catch (error) {
|
|
2676
|
+
if (error instanceof ExpressionParseError) {
|
|
2677
|
+
throw new HSIAdmissionError("unparseable-clause", `${id}: ${error.message}`);
|
|
2678
|
+
}
|
|
2679
|
+
throw error;
|
|
2680
|
+
}
|
|
2681
|
+
return { id, name, kind, expression: ir, reads: assertSlots(ir, stateSlots, id), sourceSpan: spanOf(composition.contract) };
|
|
2682
|
+
};
|
|
2683
|
+
for (const clause of composition.contract?.preconditions ?? []) {
|
|
2684
|
+
predicates.push(lowerClause("precondition", clause.name, clause.expr));
|
|
2685
|
+
}
|
|
2686
|
+
for (const clause of composition.contract?.invariants ?? []) {
|
|
2687
|
+
predicates.push(lowerClause("invariant", clause.name, clause.expr));
|
|
2688
|
+
}
|
|
2689
|
+
for (const achievement of composition.achievements ?? []) {
|
|
2690
|
+
const id = `goal:${achievement.name}`;
|
|
2691
|
+
const ir = lowerHoloExpression(achievement.condition, id);
|
|
2692
|
+
predicates.push({
|
|
2693
|
+
id,
|
|
2694
|
+
name: achievement.name,
|
|
2695
|
+
kind: "goal",
|
|
2696
|
+
expression: ir,
|
|
2697
|
+
reads: assertSlots(ir, stateSlots, id),
|
|
2698
|
+
sourceSpan: spanOf(achievement)
|
|
2699
|
+
});
|
|
2700
|
+
}
|
|
2701
|
+
return predicates;
|
|
2702
|
+
}
|
|
2703
|
+
function lowerCompositionToHSIIR(composition, options = {}) {
|
|
2704
|
+
if (!composition || composition.type !== "Composition" || typeof composition.name !== "string" || composition.name.length === 0) {
|
|
2705
|
+
throw new HSIAdmissionError("empty-world", "input is not a named HoloComposition");
|
|
2706
|
+
}
|
|
2707
|
+
const { entities } = lowerEntities(composition);
|
|
2708
|
+
const stateFields = lowerState(composition);
|
|
2709
|
+
if (entities.size === 0 && stateFields.length === 0) {
|
|
2710
|
+
throw new HSIAdmissionError("empty-world", `composition "${composition.name}" declares no entities and no state`);
|
|
2711
|
+
}
|
|
2712
|
+
const relations = lowerRelations(composition, entities);
|
|
2713
|
+
const observationPolicy = deriveObservationPolicy(entities, relations);
|
|
2714
|
+
const stateSlots = new Set(stateFields.map((f) => f.key));
|
|
2715
|
+
const eventHandlers = lowerEventHandlers(composition, stateSlots);
|
|
2716
|
+
const machines = (composition.stateMachines ?? []).map(lowerMachine);
|
|
2717
|
+
const predicates = lowerPredicates(composition, stateSlots);
|
|
2718
|
+
const sourceDigest = options.sourceText !== void 0 ? hsiSourceTextDigest(options.sourceText) : hsiSha256({ compositionName: composition.name, note: "no-source-text-provided" });
|
|
2719
|
+
const byId = (items) => [...items].sort((a, b) => a.id.localeCompare(b.id));
|
|
2720
|
+
const docWithoutDigest = {
|
|
2721
|
+
schemaVersion: HSI_IR_SCHEMA_VERSION,
|
|
2722
|
+
kind: "HSIIR",
|
|
2723
|
+
world: { name: composition.name, sourceDigest },
|
|
2724
|
+
entities: byId([...entities.values()]),
|
|
2725
|
+
relations: byId(relations),
|
|
2726
|
+
state: byId(stateFields),
|
|
2727
|
+
observationPolicy: byId(observationPolicy),
|
|
2728
|
+
eventHandlers: byId(eventHandlers),
|
|
2729
|
+
machines: byId(machines),
|
|
2730
|
+
predicates: byId(predicates),
|
|
2731
|
+
declaredUnknowns: [
|
|
2732
|
+
"action-capabilities",
|
|
2733
|
+
"action-costs",
|
|
2734
|
+
"beliefs",
|
|
2735
|
+
"first-class-observations",
|
|
2736
|
+
"memory-events",
|
|
2737
|
+
"receipt-shape"
|
|
2738
|
+
],
|
|
2739
|
+
provenance: { compiler: "HSIIRCompiler" }
|
|
2740
|
+
};
|
|
2741
|
+
const deterministicDigest = hsiSha256(docWithoutDigest);
|
|
2742
|
+
return {
|
|
2743
|
+
...docWithoutDigest,
|
|
2744
|
+
provenance: { compiler: "HSIIRCompiler", deterministicDigest }
|
|
2745
|
+
};
|
|
2746
|
+
}
|
|
2747
|
+
var HSIIRCompiler = class extends CompilerBase {
|
|
2748
|
+
constructor(options = {}) {
|
|
2749
|
+
super();
|
|
2750
|
+
this.compilerName = "HSIIRCompiler";
|
|
2751
|
+
this.options = options;
|
|
2752
|
+
}
|
|
2753
|
+
getRequiredCapability() {
|
|
2754
|
+
return ANSCapabilityPath.HSI_IR;
|
|
2755
|
+
}
|
|
2756
|
+
compile(composition, agentToken, outputPath) {
|
|
2757
|
+
this.validateCompilerAccess(agentToken, outputPath);
|
|
2758
|
+
return JSON.stringify(lowerCompositionToHSIIR(composition, this.options), null, 2);
|
|
2759
|
+
}
|
|
2760
|
+
compileToFiles(composition, agentToken = "") {
|
|
2761
|
+
return { [this.defaultOutputFileName()]: this.compile(composition, agentToken) };
|
|
2762
|
+
}
|
|
2763
|
+
defaultOutputFileName() {
|
|
2764
|
+
return "hsi-ir.json";
|
|
2765
|
+
}
|
|
2766
|
+
};
|
|
2767
|
+
function createHSIIRCompiler(options) {
|
|
2768
|
+
return new HSIIRCompiler(options);
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
// src/compiler/HSIExactTrace.ts
|
|
2772
|
+
function snapshot(world) {
|
|
2773
|
+
const state = {};
|
|
2774
|
+
for (const key of Object.keys(world.state).sort()) state[key] = world.state[key];
|
|
2775
|
+
const machineStates = {};
|
|
2776
|
+
for (const name of [...world.machines.keys()].sort()) {
|
|
2777
|
+
machineStates[name] = world.machines.get(name).current;
|
|
2778
|
+
}
|
|
2779
|
+
return { state, machineStates, stateDigest: hsiSha256({ state, machineStates }) };
|
|
2780
|
+
}
|
|
2781
|
+
function evaluateGuard(guard, context) {
|
|
2782
|
+
return evaluateExpressionIR(guard, context) === true;
|
|
2783
|
+
}
|
|
2784
|
+
function applyOperator(operator, before, operand, where) {
|
|
2785
|
+
if (operator === "=") {
|
|
2786
|
+
if (operand === null || typeof operand === "string" || typeof operand === "number" || typeof operand === "boolean") {
|
|
2787
|
+
return operand;
|
|
2788
|
+
}
|
|
2789
|
+
throw new HSIAdmissionError("unsupported-value", `${where}: assignment produced a non-scalar value`);
|
|
2790
|
+
}
|
|
2791
|
+
if (typeof before !== "number" || typeof operand !== "number" || !Number.isFinite(operand)) {
|
|
2792
|
+
throw new HSIAdmissionError(
|
|
2793
|
+
"unsupported-value",
|
|
2794
|
+
`${where}: compound assignment requires numeric operands (got ${typeof before} ${operator} ${typeof operand})`
|
|
2795
|
+
);
|
|
2796
|
+
}
|
|
2797
|
+
switch (operator) {
|
|
2798
|
+
case "+=":
|
|
2799
|
+
return before + operand;
|
|
2800
|
+
case "-=":
|
|
2801
|
+
return before - operand;
|
|
2802
|
+
case "*=":
|
|
2803
|
+
return before * operand;
|
|
2804
|
+
case "/=": {
|
|
2805
|
+
if (operand === 0) {
|
|
2806
|
+
throw new HSIAdmissionError("unsupported-value", `${where}: division by zero`);
|
|
2807
|
+
}
|
|
2808
|
+
return before / operand;
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
}
|
|
2812
|
+
function runEffects(effects, world, records, emitted) {
|
|
2813
|
+
for (const effect of effects) {
|
|
2814
|
+
switch (effect.kind) {
|
|
2815
|
+
case "assign": {
|
|
2816
|
+
const before = world.state[effect.target];
|
|
2817
|
+
const operand = evaluateExpressionIR(effect.value, world.state);
|
|
2818
|
+
const after = applyOperator(effect.operator, before, operand, effect.id);
|
|
2819
|
+
world.state[effect.target] = after;
|
|
2820
|
+
records.push({ sourceId: effect.id, target: effect.target, before, after });
|
|
2821
|
+
break;
|
|
2822
|
+
}
|
|
2823
|
+
case "emit": {
|
|
2824
|
+
emitted.push(effect.event);
|
|
2825
|
+
break;
|
|
2826
|
+
}
|
|
2827
|
+
case "branch": {
|
|
2828
|
+
const taken = evaluateGuard(effect.condition, world.state);
|
|
2829
|
+
runEffects(taken ? effect.then : effect.else, world, records, emitted);
|
|
2830
|
+
break;
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
function evaluateTransitions(world, ir) {
|
|
2836
|
+
const fired = [];
|
|
2837
|
+
for (const machineIR of ir.machines) {
|
|
2838
|
+
const runtime = world.machines.get(machineIR.name);
|
|
2839
|
+
const context = { ...runtime.inputs };
|
|
2840
|
+
for (const trigger of runtime.triggers) context[trigger] = true;
|
|
2841
|
+
const candidates = [...machineIR.transitions].sort((a, b) => a.priority - b.priority);
|
|
2842
|
+
for (const transition of candidates) {
|
|
2843
|
+
if (transition.from !== "any" && transition.from !== runtime.current) continue;
|
|
2844
|
+
if (!transition.guard) continue;
|
|
2845
|
+
if (evaluateGuard(transition.guard, context)) {
|
|
2846
|
+
fired.push({
|
|
2847
|
+
machine: machineIR.name,
|
|
2848
|
+
transitionId: transition.id,
|
|
2849
|
+
from: runtime.current,
|
|
2850
|
+
to: transition.target
|
|
2851
|
+
});
|
|
2852
|
+
runtime.current = transition.target;
|
|
2853
|
+
break;
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
runtime.triggers.clear();
|
|
2857
|
+
}
|
|
2858
|
+
return fired;
|
|
2859
|
+
}
|
|
2860
|
+
function checkInvariants(world, ir) {
|
|
2861
|
+
const violations = [];
|
|
2862
|
+
for (const predicate of ir.predicates) {
|
|
2863
|
+
if (predicate.kind !== "invariant") continue;
|
|
2864
|
+
if (!evaluateGuard(predicate.expression, world.state)) violations.push(predicate.id);
|
|
2865
|
+
}
|
|
2866
|
+
return violations;
|
|
2867
|
+
}
|
|
2868
|
+
function runExactTrace(ir, scenario) {
|
|
2869
|
+
const world = { state: {}, machines: /* @__PURE__ */ new Map() };
|
|
2870
|
+
for (const field of ir.state) world.state[field.key] = field.baseline;
|
|
2871
|
+
for (const machine of ir.machines) {
|
|
2872
|
+
const inputs = {};
|
|
2873
|
+
for (const input of machine.inputs) {
|
|
2874
|
+
inputs[input.name] = input.inputType === "trigger" ? false : input.baseline;
|
|
2875
|
+
}
|
|
2876
|
+
world.machines.set(machine.name, {
|
|
2877
|
+
name: machine.name,
|
|
2878
|
+
current: machine.initialState,
|
|
2879
|
+
inputs,
|
|
2880
|
+
triggers: /* @__PURE__ */ new Set()
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
const preconditionResults = ir.predicates.filter((p) => p.kind === "precondition").map((p) => ({ id: p.id, holds: evaluateGuard(p.expression, world.state) }));
|
|
2884
|
+
const initial = snapshot(world);
|
|
2885
|
+
const steps = [];
|
|
2886
|
+
let valid = preconditionResults.every((r) => r.holds);
|
|
2887
|
+
scenario.forEach((step, ordinal) => {
|
|
2888
|
+
const effects = [];
|
|
2889
|
+
const emitted = [];
|
|
2890
|
+
let transitions = [];
|
|
2891
|
+
switch (step.kind) {
|
|
2892
|
+
case "set-input": {
|
|
2893
|
+
const machine = world.machines.get(step.machine);
|
|
2894
|
+
if (!machine || !(step.input in machine.inputs)) {
|
|
2895
|
+
throw new HSIAdmissionError(
|
|
2896
|
+
"unknown-slot",
|
|
2897
|
+
`scenario step ${ordinal}: unknown machine input ${step.machine}.${step.input}`
|
|
2898
|
+
);
|
|
2899
|
+
}
|
|
2900
|
+
machine.inputs[step.input] = step.value;
|
|
2901
|
+
transitions = evaluateTransitions(world, ir);
|
|
2902
|
+
break;
|
|
2903
|
+
}
|
|
2904
|
+
case "fire-trigger": {
|
|
2905
|
+
const machine = world.machines.get(step.machine);
|
|
2906
|
+
const declared = ir.machines.find((m) => m.name === step.machine)?.inputs.find((i) => i.name === step.input && i.inputType === "trigger");
|
|
2907
|
+
if (!machine || !declared) {
|
|
2908
|
+
throw new HSIAdmissionError(
|
|
2909
|
+
"unknown-slot",
|
|
2910
|
+
`scenario step ${ordinal}: unknown trigger ${step.machine}.${step.input}`
|
|
2911
|
+
);
|
|
2912
|
+
}
|
|
2913
|
+
machine.triggers.add(step.input);
|
|
2914
|
+
transitions = evaluateTransitions(world, ir);
|
|
2915
|
+
break;
|
|
2916
|
+
}
|
|
2917
|
+
case "fire-event": {
|
|
2918
|
+
const handler = ir.eventHandlers.find((h) => h.event === step.event);
|
|
2919
|
+
if (!handler) {
|
|
2920
|
+
throw new HSIAdmissionError(
|
|
2921
|
+
"unknown-slot",
|
|
2922
|
+
`scenario step ${ordinal}: no handler for event "${step.event}"`
|
|
2923
|
+
);
|
|
2924
|
+
}
|
|
2925
|
+
runEffects(handler.effects, world, effects, emitted);
|
|
2926
|
+
break;
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
const invariantViolations = checkInvariants(world, ir);
|
|
2930
|
+
if (invariantViolations.length > 0) valid = false;
|
|
2931
|
+
steps.push({
|
|
2932
|
+
ordinal,
|
|
2933
|
+
step,
|
|
2934
|
+
transitions,
|
|
2935
|
+
effects,
|
|
2936
|
+
emitted,
|
|
2937
|
+
invariantViolations,
|
|
2938
|
+
stateDigest: snapshot(world).stateDigest
|
|
2939
|
+
});
|
|
2940
|
+
});
|
|
2941
|
+
const final = snapshot(world);
|
|
2942
|
+
const traceWithoutDigest = {
|
|
2943
|
+
schemaVersion: HSI_TRACE_SCHEMA_VERSION,
|
|
2944
|
+
kind: "HSITrace",
|
|
2945
|
+
worldDigest: ir.provenance.deterministicDigest,
|
|
2946
|
+
preconditionResults,
|
|
2947
|
+
initial,
|
|
2948
|
+
steps,
|
|
2949
|
+
final,
|
|
2950
|
+
valid
|
|
2951
|
+
};
|
|
2952
|
+
return { ...traceWithoutDigest, deterministicDigest: hsiSha256(traceWithoutDigest) };
|
|
2953
|
+
}
|
|
2954
|
+
function splitFor(nodeId, worldDigest) {
|
|
2955
|
+
const digest = createHash("sha256").update(`${nodeId}|${worldDigest}`).digest();
|
|
2956
|
+
return digest[0] % 4 === 0 ? "eval" : "train";
|
|
2957
|
+
}
|
|
2958
|
+
function collectAssignTargets(effects, into, reads) {
|
|
2959
|
+
for (const effect of effects) {
|
|
2960
|
+
if (effect.kind === "assign") {
|
|
2961
|
+
into.add(effect.target);
|
|
2962
|
+
const stack = [effect.value];
|
|
2963
|
+
while (stack.length > 0) {
|
|
2964
|
+
const node = stack.pop();
|
|
2965
|
+
if (node.kind === "Identifier") reads.add(node.name);
|
|
2966
|
+
else if (node.kind === "BinaryExpression") stack.push(node.left, node.right);
|
|
2967
|
+
else if (node.kind === "UnaryExpression") stack.push(node.argument);
|
|
2968
|
+
else if (node.kind === "MemberExpression") stack.push(node.object);
|
|
2969
|
+
else if (node.kind === "CallExpression") stack.push(...node.arguments);
|
|
2970
|
+
}
|
|
2971
|
+
} else if (effect.kind === "branch") {
|
|
2972
|
+
collectAssignTargets(effect.then, into, reads);
|
|
2973
|
+
collectAssignTargets(effect.else, into, reads);
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
function projectLearningGraph(ir) {
|
|
2978
|
+
const worldDigest = ir.provenance.deterministicDigest;
|
|
2979
|
+
const nodes = [];
|
|
2980
|
+
const edges = [];
|
|
2981
|
+
const addNode = (node) => {
|
|
2982
|
+
nodes.push({ ...node, split: splitFor(node.id, worldDigest) });
|
|
2983
|
+
};
|
|
2984
|
+
const addEdge = (edgeType, from, to, label) => {
|
|
2985
|
+
const edge = { id: `edge:${edgeType}:${from}->${to}`, edgeType, from, to };
|
|
2986
|
+
if (label !== void 0) edge.label = label;
|
|
2987
|
+
edges.push(edge);
|
|
2988
|
+
};
|
|
2989
|
+
const worldId = `entity:${ir.world.name}`;
|
|
2990
|
+
addNode({ id: worldId, nodeType: "entity", baseline: null, unknowns: [] });
|
|
2991
|
+
for (const entity of ir.entities) {
|
|
2992
|
+
addNode({
|
|
2993
|
+
id: entity.id,
|
|
2994
|
+
nodeType: "entity",
|
|
2995
|
+
baseline: null,
|
|
2996
|
+
unknowns: entity.opacity === "unknown" ? ["opacity"] : [],
|
|
2997
|
+
sourceSpan: entity.sourceSpan
|
|
2998
|
+
});
|
|
2999
|
+
addEdge("contains", worldId, entity.id);
|
|
3000
|
+
}
|
|
3001
|
+
for (const field of ir.state) {
|
|
3002
|
+
addNode({
|
|
3003
|
+
id: field.id,
|
|
3004
|
+
nodeType: "state",
|
|
3005
|
+
baseline: field.baseline,
|
|
3006
|
+
unknowns: [],
|
|
3007
|
+
sourceSpan: field.sourceSpan
|
|
3008
|
+
});
|
|
3009
|
+
addEdge("contains", worldId, field.id);
|
|
3010
|
+
}
|
|
3011
|
+
for (const rule of ir.observationPolicy) {
|
|
3012
|
+
addNode({
|
|
3013
|
+
id: rule.id,
|
|
3014
|
+
nodeType: "observation",
|
|
3015
|
+
baseline: null,
|
|
3016
|
+
unknowns: rule.access === "unknown" ? ["access"] : []
|
|
3017
|
+
});
|
|
3018
|
+
addEdge("observes", `entity:${rule.observer}`, rule.id, rule.access);
|
|
3019
|
+
addEdge("refers-to", rule.id, `entity:${rule.observed}`);
|
|
3020
|
+
for (const mediator of rule.mediators) {
|
|
3021
|
+
addEdge("refers-to", rule.id, `entity:${mediator}`, "mediator");
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
for (const handler of ir.eventHandlers) {
|
|
3025
|
+
addNode({ id: handler.id, nodeType: "event", baseline: null, unknowns: [], sourceSpan: handler.sourceSpan });
|
|
3026
|
+
const targets = /* @__PURE__ */ new Set();
|
|
3027
|
+
const reads = /* @__PURE__ */ new Set();
|
|
3028
|
+
collectAssignTargets(handler.effects, targets, reads);
|
|
3029
|
+
for (const target of [...targets].sort()) {
|
|
3030
|
+
addEdge("affects", handler.id, `state:world.${target}`);
|
|
3031
|
+
}
|
|
3032
|
+
for (const read of [...reads].sort()) {
|
|
3033
|
+
if (!targets.has(read)) addEdge("requires", handler.id, `state:world.${read}`);
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
for (const machine of ir.machines) {
|
|
3037
|
+
for (const transition of machine.transitions) {
|
|
3038
|
+
addNode({
|
|
3039
|
+
id: transition.id,
|
|
3040
|
+
nodeType: "action",
|
|
3041
|
+
baseline: null,
|
|
3042
|
+
unknowns: [],
|
|
3043
|
+
sourceSpan: transition.sourceSpan
|
|
3044
|
+
});
|
|
3045
|
+
for (const read of transition.reads) {
|
|
3046
|
+
addEdge("requires", transition.id, `input:${machine.name}.${read}`);
|
|
3047
|
+
}
|
|
3048
|
+
addEdge("causes", transition.id, `machineState:${machine.name}.${transition.target}`);
|
|
3049
|
+
if (transition.from !== "any") {
|
|
3050
|
+
addEdge("precedes", `machineState:${machine.name}.${transition.from}`, transition.id);
|
|
3051
|
+
}
|
|
3052
|
+
}
|
|
3053
|
+
for (const stateName of machine.states) {
|
|
3054
|
+
addNode({ id: `machineState:${machine.name}.${stateName}`, nodeType: "state", baseline: null, unknowns: [] });
|
|
3055
|
+
addEdge("contains", worldId, `machineState:${machine.name}.${stateName}`);
|
|
3056
|
+
}
|
|
3057
|
+
for (const input of machine.inputs) {
|
|
3058
|
+
addNode({ id: input.id, nodeType: "state", baseline: input.baseline, unknowns: [] });
|
|
3059
|
+
addEdge("contains", worldId, input.id);
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
for (const predicate of ir.predicates) {
|
|
3063
|
+
addNode({
|
|
3064
|
+
id: predicate.id,
|
|
3065
|
+
nodeType: "objective",
|
|
3066
|
+
baseline: null,
|
|
3067
|
+
unknowns: [],
|
|
3068
|
+
sourceSpan: predicate.sourceSpan
|
|
3069
|
+
});
|
|
3070
|
+
for (const read of predicate.reads) {
|
|
3071
|
+
addEdge("refers-to", predicate.id, `state:world.${read}`);
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
nodes.sort((a, b) => a.id.localeCompare(b.id));
|
|
3075
|
+
edges.sort((a, b) => a.id.localeCompare(b.id));
|
|
3076
|
+
const graphWithoutDigest = {
|
|
3077
|
+
schemaVersion: HSI_LEARNING_GRAPH_SCHEMA_VERSION,
|
|
3078
|
+
kind: "HSILearningGraph",
|
|
3079
|
+
worldDigest,
|
|
3080
|
+
emittedFrom: worldDigest,
|
|
3081
|
+
nodes,
|
|
3082
|
+
edges,
|
|
3083
|
+
interventions: [
|
|
3084
|
+
"intervention:flip-opacity",
|
|
3085
|
+
"intervention:raise-guard-threshold"
|
|
3086
|
+
]
|
|
3087
|
+
};
|
|
3088
|
+
return { ...graphWithoutDigest, deterministicDigest: hsiSha256(graphWithoutDigest) };
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
// src/compiler/HSIAuditVerifier.ts
|
|
3092
|
+
function renamed(name, map) {
|
|
3093
|
+
return map[name] ?? name;
|
|
3094
|
+
}
|
|
3095
|
+
function renameExpression(expr, map) {
|
|
3096
|
+
switch (expr.type) {
|
|
3097
|
+
case "Identifier":
|
|
3098
|
+
expr.name = renamed(expr.name, map);
|
|
3099
|
+
return;
|
|
3100
|
+
case "BinaryExpression":
|
|
3101
|
+
renameExpression(expr.left, map);
|
|
3102
|
+
renameExpression(expr.right, map);
|
|
3103
|
+
return;
|
|
3104
|
+
case "UnaryExpression":
|
|
3105
|
+
renameExpression(expr.argument, map);
|
|
3106
|
+
return;
|
|
3107
|
+
case "MemberExpression":
|
|
3108
|
+
renameExpression(expr.object, map);
|
|
3109
|
+
return;
|
|
3110
|
+
case "CallExpression":
|
|
3111
|
+
renameExpression(expr.callee, map);
|
|
3112
|
+
for (const arg of expr.arguments) renameExpression(arg, map);
|
|
3113
|
+
return;
|
|
3114
|
+
default:
|
|
3115
|
+
return;
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
function renameStatements(statements, map) {
|
|
3119
|
+
for (const stmt of statements) {
|
|
3120
|
+
switch (stmt.type) {
|
|
3121
|
+
case "Assignment": {
|
|
3122
|
+
const target = stmt.target.startsWith("state.") ? stmt.target.slice("state.".length) : stmt.target;
|
|
3123
|
+
const prefix = stmt.target.startsWith("state.") ? "state." : "";
|
|
3124
|
+
stmt.target = `${prefix}${renamed(target, map)}`;
|
|
3125
|
+
renameExpression(stmt.value, map);
|
|
3126
|
+
break;
|
|
3127
|
+
}
|
|
3128
|
+
case "IfStatement":
|
|
3129
|
+
renameExpression(stmt.condition, map);
|
|
3130
|
+
renameStatements(stmt.consequent, map);
|
|
3131
|
+
renameStatements(stmt.alternate ?? [], map);
|
|
3132
|
+
break;
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
}
|
|
3136
|
+
function renameRawExpr(expr, map) {
|
|
3137
|
+
return expr.replace(/[A-Za-z_][A-Za-z0-9_]*/g, (token) => renamed(token, map));
|
|
3138
|
+
}
|
|
3139
|
+
function renameComposition(composition, map) {
|
|
3140
|
+
for (const template of composition.templates ?? []) {
|
|
3141
|
+
template.name = renamed(template.name, map);
|
|
3142
|
+
}
|
|
3143
|
+
for (const obj of composition.objects ?? []) {
|
|
3144
|
+
obj.name = renamed(obj.name, map);
|
|
3145
|
+
if (obj.template !== void 0) obj.template = renamed(obj.template, map);
|
|
3146
|
+
}
|
|
3147
|
+
const connections = composition.connections;
|
|
3148
|
+
for (const conn of connections ?? []) {
|
|
3149
|
+
conn.from = renamed(conn.from, map);
|
|
3150
|
+
conn.to = renamed(conn.to, map);
|
|
3151
|
+
}
|
|
3152
|
+
for (const prop of composition.state?.properties ?? []) {
|
|
3153
|
+
prop.key = renamed(prop.key, map);
|
|
3154
|
+
}
|
|
3155
|
+
const logic = composition.logic;
|
|
3156
|
+
for (const handler of logic?.handlers ?? []) {
|
|
3157
|
+
renameStatements(handler.body, map);
|
|
3158
|
+
}
|
|
3159
|
+
for (const machine of composition.stateMachines ?? []) {
|
|
3160
|
+
machine.name = renamed(machine.name, map);
|
|
3161
|
+
machine.initialState = renamed(machine.initialState, map);
|
|
3162
|
+
const renamedStates = {};
|
|
3163
|
+
for (const [stateName, stateNode] of Object.entries(machine.states ?? {})) {
|
|
3164
|
+
stateNode.name = renamed(stateName, map);
|
|
3165
|
+
renamedStates[renamed(stateName, map)] = stateNode;
|
|
3166
|
+
for (const t of stateNode.transitions ?? []) {
|
|
3167
|
+
if (t.from && t.from !== "any") t.from = renamed(t.from, map);
|
|
3168
|
+
t.target = renamed(t.target, map);
|
|
3169
|
+
if (t.condition) renameExpression(t.condition, map);
|
|
3170
|
+
for (const cond of t.conditions ?? []) cond.parameter = renamed(cond.parameter, map);
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
machine.states = renamedStates;
|
|
3174
|
+
for (const input of machine.inputs ?? []) {
|
|
3175
|
+
input.name = renamed(input.name, map);
|
|
3176
|
+
}
|
|
3177
|
+
for (const t of machine.transitions ?? []) {
|
|
3178
|
+
if (t.from && t.from !== "any") t.from = renamed(t.from, map);
|
|
3179
|
+
t.target = renamed(t.target, map);
|
|
3180
|
+
if (t.condition) renameExpression(t.condition, map);
|
|
3181
|
+
for (const cond of t.conditions ?? []) cond.parameter = renamed(cond.parameter, map);
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
if (composition.contract) {
|
|
3185
|
+
for (const clause of [...composition.contract.preconditions, ...composition.contract.invariants]) {
|
|
3186
|
+
clause.expr = renameRawExpr(clause.expr, map);
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
for (const achievement of composition.achievements ?? []) {
|
|
3190
|
+
renameExpression(achievement.condition, map);
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
var ID_TOKEN_PATTERN = /[A-Za-z_][A-Za-z0-9_]*/g;
|
|
3194
|
+
function renameIdString(id, map) {
|
|
3195
|
+
return id.replace(ID_TOKEN_PATTERN, (token) => renamed(token, map));
|
|
3196
|
+
}
|
|
3197
|
+
function renameTrace(trace, map) {
|
|
3198
|
+
const renameSnapshot = (snap) => {
|
|
3199
|
+
const state = {};
|
|
3200
|
+
for (const [key, value] of Object.entries(snap.state)) state[renamed(key, map)] = value;
|
|
3201
|
+
const machineStates = {};
|
|
3202
|
+
for (const [machine, current] of Object.entries(snap.machineStates)) {
|
|
3203
|
+
machineStates[renamed(machine, map)] = renamed(current, map);
|
|
3204
|
+
}
|
|
3205
|
+
return { state, machineStates, stateDigest: hsiSha256({ state: sortRecord(state), machineStates: sortRecord(machineStates) }) };
|
|
3206
|
+
};
|
|
3207
|
+
const sortRecord = (record) => {
|
|
3208
|
+
const out = {};
|
|
3209
|
+
for (const key of Object.keys(record).sort()) out[key] = record[key];
|
|
3210
|
+
return out;
|
|
3211
|
+
};
|
|
3212
|
+
const stepsRenamed = trace.steps.map((step) => {
|
|
3213
|
+
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) };
|
|
3214
|
+
return {
|
|
3215
|
+
...step,
|
|
3216
|
+
step: scenario,
|
|
3217
|
+
transitions: step.transitions.map((t) => ({
|
|
3218
|
+
machine: renamed(t.machine, map),
|
|
3219
|
+
transitionId: renameIdString(t.transitionId, map),
|
|
3220
|
+
from: renamed(t.from, map),
|
|
3221
|
+
to: renamed(t.to, map)
|
|
3222
|
+
})),
|
|
3223
|
+
effects: step.effects.map((e) => ({ ...e, target: renamed(e.target, map), sourceId: renameIdString(e.sourceId, map) })),
|
|
3224
|
+
invariantViolations: step.invariantViolations.map((id) => renameIdString(id, map)),
|
|
3225
|
+
stateDigest: ""
|
|
3226
|
+
};
|
|
3227
|
+
});
|
|
3228
|
+
const initial = renameSnapshot(trace.initial);
|
|
3229
|
+
const final = renameSnapshot(trace.final);
|
|
3230
|
+
const traceWithoutDigest = {
|
|
3231
|
+
schemaVersion: trace.schemaVersion,
|
|
3232
|
+
kind: trace.kind,
|
|
3233
|
+
worldDigest: "",
|
|
3234
|
+
preconditionResults: trace.preconditionResults.map((r) => ({ id: renameIdString(r.id, map), holds: r.holds })),
|
|
3235
|
+
initial,
|
|
3236
|
+
steps: stepsRenamed,
|
|
3237
|
+
final,
|
|
3238
|
+
valid: trace.valid
|
|
3239
|
+
};
|
|
3240
|
+
return { ...traceWithoutDigest, deterministicDigest: "" };
|
|
3241
|
+
}
|
|
3242
|
+
function behavioralProjection(trace) {
|
|
3243
|
+
return {
|
|
3244
|
+
preconditionResults: trace.preconditionResults,
|
|
3245
|
+
initial: { state: trace.initial.state, machineStates: trace.initial.machineStates },
|
|
3246
|
+
steps: trace.steps.map((s) => ({
|
|
3247
|
+
ordinal: s.ordinal,
|
|
3248
|
+
step: s.step,
|
|
3249
|
+
transitions: s.transitions,
|
|
3250
|
+
effects: s.effects,
|
|
3251
|
+
emitted: s.emitted,
|
|
3252
|
+
invariantViolations: s.invariantViolations
|
|
3253
|
+
})),
|
|
3254
|
+
final: { state: trace.final.state, machineStates: trace.final.machineStates },
|
|
3255
|
+
valid: trace.valid
|
|
3256
|
+
};
|
|
3257
|
+
}
|
|
3258
|
+
function reorderComposition(composition) {
|
|
3259
|
+
composition.templates = [...composition.templates ?? []].reverse();
|
|
3260
|
+
composition.objects = [...composition.objects ?? []].reverse();
|
|
3261
|
+
const holder = composition;
|
|
3262
|
+
if (holder.connections) holder.connections = [...holder.connections].reverse();
|
|
3263
|
+
if (composition.state?.properties) {
|
|
3264
|
+
composition.state.properties = [...composition.state.properties].reverse();
|
|
3265
|
+
}
|
|
3266
|
+
if (composition.contract) {
|
|
3267
|
+
composition.contract.invariants = [...composition.contract.invariants].reverse();
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
function applyIntervention(composition, intervention) {
|
|
3271
|
+
if (intervention.kind === "set-opacity") {
|
|
3272
|
+
const obj = (composition.objects ?? []).find((o) => o.name === intervention.entity);
|
|
3273
|
+
if (!obj) {
|
|
3274
|
+
throw new HSIAdmissionError("admission-skewed", `intervention targets unknown entity "${intervention.entity}"`);
|
|
3275
|
+
}
|
|
3276
|
+
const existing = obj.properties.findIndex((p) => p.key === "opaque");
|
|
3277
|
+
if (existing >= 0) obj.properties.splice(existing, 1);
|
|
3278
|
+
if (intervention.opaque !== void 0) {
|
|
3279
|
+
obj.properties.push({ type: "ObjectProperty", key: "opaque", value: intervention.opaque });
|
|
3280
|
+
} else {
|
|
3281
|
+
const template = (composition.templates ?? []).find((t) => t.name === obj.template);
|
|
3282
|
+
if (template) {
|
|
3283
|
+
template.properties = (template.properties ?? []).filter((p) => p.key !== "opaque");
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3286
|
+
return;
|
|
3287
|
+
}
|
|
3288
|
+
const machine = (composition.stateMachines ?? []).find((m) => m.name === intervention.machine);
|
|
3289
|
+
if (!machine) {
|
|
3290
|
+
throw new HSIAdmissionError("admission-skewed", `intervention targets unknown machine "${intervention.machine}"`);
|
|
3291
|
+
}
|
|
3292
|
+
const transitions = [
|
|
3293
|
+
...machine.transitions ?? [],
|
|
3294
|
+
...Object.values(machine.states ?? {}).flatMap((s) => s.transitions ?? [])
|
|
3295
|
+
];
|
|
3296
|
+
const transition = transitions.find(
|
|
3297
|
+
(t) => (t.from ?? "") === intervention.fromState && t.target === intervention.toState
|
|
3298
|
+
);
|
|
3299
|
+
if (!transition) {
|
|
3300
|
+
throw new HSIAdmissionError(
|
|
3301
|
+
"admission-skewed",
|
|
3302
|
+
`intervention targets unknown transition ${intervention.fromState} -> ${intervention.toState}`
|
|
3303
|
+
);
|
|
3304
|
+
}
|
|
3305
|
+
if (transition.condition?.type === "BinaryExpression" && transition.condition.right.type === "Literal") {
|
|
3306
|
+
transition.condition.right.value = intervention.value;
|
|
3307
|
+
}
|
|
3308
|
+
for (const cond of transition.conditions ?? []) {
|
|
3309
|
+
if (typeof cond.value === "number") cond.value = intervention.value;
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
function generateAuditCases(ir) {
|
|
3313
|
+
const cases = [
|
|
3314
|
+
{
|
|
3315
|
+
id: "audit:admission-empty",
|
|
3316
|
+
kind: "admission-empty",
|
|
3317
|
+
description: "An empty composition (no entities, no state) must fail admission.",
|
|
3318
|
+
expectation: "HSIAdmissionError(empty-world)"
|
|
3319
|
+
},
|
|
3320
|
+
{
|
|
3321
|
+
id: "audit:admission-missing-archetype",
|
|
3322
|
+
kind: "admission-skewed",
|
|
3323
|
+
description: "An object using an undeclared template must fail admission.",
|
|
3324
|
+
expectation: "HSIAdmissionError(unknown-archetype)"
|
|
3325
|
+
},
|
|
3326
|
+
{
|
|
3327
|
+
id: "audit:admission-dangling-relation",
|
|
3328
|
+
kind: "admission-skewed",
|
|
3329
|
+
description: "A connection to an undeclared entity must fail admission.",
|
|
3330
|
+
expectation: "HSIAdmissionError(unknown-relation-endpoint)"
|
|
3331
|
+
},
|
|
3332
|
+
{
|
|
3333
|
+
id: "audit:alpha-rename",
|
|
3334
|
+
kind: "alpha-rename",
|
|
3335
|
+
description: "Consistent renaming of declared names preserves behavior (trace modulo names).",
|
|
3336
|
+
expectation: "behavioralProjection(renameTrace(base)) === behavioralProjection(trace(renamed))"
|
|
3337
|
+
},
|
|
3338
|
+
{
|
|
3339
|
+
id: "audit:declaration-reorder",
|
|
3340
|
+
kind: "declaration-reorder",
|
|
3341
|
+
description: "Reordering independent declarations yields a byte-identical IR.",
|
|
3342
|
+
expectation: "deterministicDigest(base) === deterministicDigest(reordered)"
|
|
3343
|
+
},
|
|
3344
|
+
{
|
|
3345
|
+
id: "audit:regenerate-determinism",
|
|
3346
|
+
kind: "regenerate-determinism",
|
|
3347
|
+
description: "Re-lowering and re-tracing from the same source is byte-identical.",
|
|
3348
|
+
expectation: "all artifact digests equal across two independent regenerations"
|
|
3349
|
+
}
|
|
3350
|
+
];
|
|
3351
|
+
const opaqueMediator = ir.entities.find(
|
|
3352
|
+
(e) => e.opacity === "opaque" && ir.observationPolicy.some((r) => r.mediators.includes(e.name) && r.access === "blocked")
|
|
3353
|
+
);
|
|
3354
|
+
if (opaqueMediator) {
|
|
3355
|
+
cases.push({
|
|
3356
|
+
id: "audit:counterfactual-opacity",
|
|
3357
|
+
kind: "counterfactual-intervention",
|
|
3358
|
+
description: `Making "${opaqueMediator.name}" transparent must change at least one observation access verdict.`,
|
|
3359
|
+
intervention: { kind: "set-opacity", id: "intervention:flip-opacity", entity: opaqueMediator.name, opacity: "transparent" },
|
|
3360
|
+
expectation: "observationPolicy access verdicts differ from base IR"
|
|
3361
|
+
});
|
|
3362
|
+
}
|
|
3363
|
+
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");
|
|
3364
|
+
if (guardedTransition) {
|
|
3365
|
+
cases.push({
|
|
3366
|
+
id: "audit:counterfactual-guard",
|
|
3367
|
+
kind: "counterfactual-intervention",
|
|
3368
|
+
description: `Raising the numeric guard of ${guardedTransition.t.id} beyond scenario inputs must change the exact trace.`,
|
|
3369
|
+
intervention: {
|
|
3370
|
+
kind: "set-transition-guard-literal",
|
|
3371
|
+
id: "intervention:raise-guard-threshold",
|
|
3372
|
+
machine: guardedTransition.machine,
|
|
3373
|
+
transitionId: guardedTransition.t.id,
|
|
3374
|
+
value: 1e6
|
|
3375
|
+
},
|
|
3376
|
+
expectation: "trace deterministicDigest differs and at least one step fires different transitions"
|
|
3377
|
+
});
|
|
3378
|
+
}
|
|
3379
|
+
return cases;
|
|
3380
|
+
}
|
|
3381
|
+
function clone(value) {
|
|
3382
|
+
return structuredClone(value);
|
|
3383
|
+
}
|
|
3384
|
+
function expectAdmissionFailure(fn, expectedCode) {
|
|
3385
|
+
try {
|
|
3386
|
+
fn();
|
|
3387
|
+
return "fail";
|
|
3388
|
+
} catch (error) {
|
|
3389
|
+
return error instanceof HSIAdmissionError && error.code === expectedCode ? "pass" : "fail";
|
|
3390
|
+
}
|
|
3391
|
+
}
|
|
3392
|
+
function runHSIAudit(input) {
|
|
3393
|
+
const { composition, sourceText, scenario, renameMap } = input;
|
|
3394
|
+
const baseIR = lowerCompositionToHSIIR(clone(composition), { sourceText });
|
|
3395
|
+
const baseTrace = runExactTrace(baseIR, scenario);
|
|
3396
|
+
const cases = generateAuditCases(baseIR);
|
|
3397
|
+
const checks = [];
|
|
3398
|
+
for (const auditCase of cases) {
|
|
3399
|
+
let status = "fail";
|
|
3400
|
+
let detail = auditCase.expectation;
|
|
3401
|
+
try {
|
|
3402
|
+
switch (auditCase.id) {
|
|
3403
|
+
case "audit:admission-empty": {
|
|
3404
|
+
const empty = {
|
|
3405
|
+
...clone(composition),
|
|
3406
|
+
name: "EmptyWorld",
|
|
3407
|
+
templates: [],
|
|
3408
|
+
objects: [],
|
|
3409
|
+
state: void 0,
|
|
3410
|
+
stateMachines: [],
|
|
3411
|
+
contract: void 0,
|
|
3412
|
+
achievements: []
|
|
3413
|
+
};
|
|
3414
|
+
empty.connections = [];
|
|
3415
|
+
empty.logic = void 0;
|
|
3416
|
+
status = expectAdmissionFailure(() => lowerCompositionToHSIIR(empty), "empty-world");
|
|
3417
|
+
break;
|
|
3418
|
+
}
|
|
3419
|
+
case "audit:admission-missing-archetype": {
|
|
3420
|
+
const skewed = clone(composition);
|
|
3421
|
+
if (skewed.objects.length === 0) throw new Error("fixture has no objects");
|
|
3422
|
+
skewed.objects[0].template = "GhostTemplate";
|
|
3423
|
+
status = expectAdmissionFailure(() => lowerCompositionToHSIIR(skewed), "unknown-archetype");
|
|
3424
|
+
break;
|
|
3425
|
+
}
|
|
3426
|
+
case "audit:admission-dangling-relation": {
|
|
3427
|
+
const skewed = clone(composition);
|
|
3428
|
+
const holder = skewed;
|
|
3429
|
+
holder.connections = [...holder.connections ?? [], { from: "NoSuchEntity", to: "AlsoMissing" }];
|
|
3430
|
+
status = expectAdmissionFailure(() => lowerCompositionToHSIIR(skewed), "unknown-relation-endpoint");
|
|
3431
|
+
break;
|
|
3432
|
+
}
|
|
3433
|
+
case "audit:alpha-rename": {
|
|
3434
|
+
const renamedComposition = clone(composition);
|
|
3435
|
+
renameComposition(renamedComposition, renameMap);
|
|
3436
|
+
const renamedIR = lowerCompositionToHSIIR(renamedComposition);
|
|
3437
|
+
const renamedScenario = scenario.map(
|
|
3438
|
+
(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 }
|
|
3439
|
+
);
|
|
3440
|
+
const renamedTrace = runExactTrace(renamedIR, renamedScenario);
|
|
3441
|
+
const expected = hsiStableStringify(behavioralProjection(renameTrace(baseTrace, renameMap)));
|
|
3442
|
+
const actual = hsiStableStringify(behavioralProjection(renamedTrace));
|
|
3443
|
+
status = expected === actual ? "pass" : "fail";
|
|
3444
|
+
if (status === "fail") detail = "renamed trace diverged from rename-projected base trace";
|
|
3445
|
+
break;
|
|
3446
|
+
}
|
|
3447
|
+
case "audit:declaration-reorder": {
|
|
3448
|
+
const reordered = clone(composition);
|
|
3449
|
+
reorderComposition(reordered);
|
|
3450
|
+
const reorderedIR = lowerCompositionToHSIIR(reordered, { sourceText });
|
|
3451
|
+
status = reorderedIR.provenance.deterministicDigest === baseIR.provenance.deterministicDigest ? "pass" : "fail";
|
|
3452
|
+
if (status === "fail") detail = "reordered IR digest differs from base IR digest";
|
|
3453
|
+
break;
|
|
3454
|
+
}
|
|
3455
|
+
case "audit:regenerate-determinism": {
|
|
3456
|
+
const secondIR = lowerCompositionToHSIIR(clone(composition), { sourceText });
|
|
3457
|
+
const secondTrace = runExactTrace(secondIR, scenario);
|
|
3458
|
+
status = secondIR.provenance.deterministicDigest === baseIR.provenance.deterministicDigest && secondTrace.deterministicDigest === baseTrace.deterministicDigest ? "pass" : "fail";
|
|
3459
|
+
if (status === "fail") detail = "regeneration produced different digests";
|
|
3460
|
+
break;
|
|
3461
|
+
}
|
|
3462
|
+
case "audit:counterfactual-opacity": {
|
|
3463
|
+
const intervention = auditCase.intervention;
|
|
3464
|
+
if (intervention.kind !== "set-opacity") throw new Error("case/intervention mismatch");
|
|
3465
|
+
const intervened = clone(composition);
|
|
3466
|
+
applyIntervention(intervened, {
|
|
3467
|
+
id: intervention.id,
|
|
3468
|
+
kind: "set-opacity",
|
|
3469
|
+
entity: intervention.entity,
|
|
3470
|
+
opaque: intervention.opacity === "opaque" ? true : intervention.opacity === "transparent" ? false : void 0
|
|
3471
|
+
});
|
|
3472
|
+
const intervenedIR = lowerCompositionToHSIIR(intervened);
|
|
3473
|
+
const baseAccess = hsiStableStringify(baseIR.observationPolicy);
|
|
3474
|
+
const newAccess = hsiStableStringify(intervenedIR.observationPolicy);
|
|
3475
|
+
status = baseAccess !== newAccess ? "pass" : "fail";
|
|
3476
|
+
if (status === "fail") detail = "opacity intervention did not change any observation verdict";
|
|
3477
|
+
break;
|
|
3478
|
+
}
|
|
3479
|
+
case "audit:counterfactual-guard": {
|
|
3480
|
+
const intervention = auditCase.intervention;
|
|
3481
|
+
if (intervention.kind !== "set-transition-guard-literal") throw new Error("case/intervention mismatch");
|
|
3482
|
+
const parsed = /transition:([^.]+)\.([^-]+)->([^#]+)#/.exec(intervention.transitionId);
|
|
3483
|
+
if (!parsed) throw new Error(`unparseable transition id ${intervention.transitionId}`);
|
|
3484
|
+
const intervened = clone(composition);
|
|
3485
|
+
applyIntervention(intervened, {
|
|
3486
|
+
id: intervention.id,
|
|
3487
|
+
kind: "set-guard-literal",
|
|
3488
|
+
machine: parsed[1],
|
|
3489
|
+
fromState: parsed[2],
|
|
3490
|
+
toState: parsed[3],
|
|
3491
|
+
value: intervention.value
|
|
3492
|
+
});
|
|
3493
|
+
const intervenedIR = lowerCompositionToHSIIR(intervened);
|
|
3494
|
+
const intervenedTrace = runExactTrace(intervenedIR, scenario);
|
|
3495
|
+
const digestDiffers = intervenedTrace.deterministicDigest !== baseTrace.deterministicDigest;
|
|
3496
|
+
const stepDiffers = baseTrace.steps.some(
|
|
3497
|
+
(step, i) => hsiStableStringify(step.transitions) !== hsiStableStringify(intervenedTrace.steps[i]?.transitions)
|
|
3498
|
+
);
|
|
3499
|
+
status = digestDiffers && stepDiffers ? "pass" : "fail";
|
|
3500
|
+
if (status === "fail") detail = "guard intervention did not change the exact trace";
|
|
3501
|
+
break;
|
|
3502
|
+
}
|
|
3503
|
+
default:
|
|
3504
|
+
detail = `unrecognized audit case ${auditCase.id}`;
|
|
3505
|
+
}
|
|
3506
|
+
} catch (error) {
|
|
3507
|
+
status = "fail";
|
|
3508
|
+
detail = `${detail} \u2014 threw: ${error.message}`;
|
|
3509
|
+
}
|
|
3510
|
+
checks.push({ caseId: auditCase.id, status, detail });
|
|
3511
|
+
}
|
|
3512
|
+
const overall = checks.every((c) => c.status === "pass") ? "pass" : "fail";
|
|
3513
|
+
const manifestWithoutDigest = {
|
|
3514
|
+
schemaVersion: HSI_AUDIT_SCHEMA_VERSION,
|
|
3515
|
+
kind: "HSIAuditManifest",
|
|
3516
|
+
worldDigest: baseIR.provenance.deterministicDigest,
|
|
3517
|
+
verifier: "HSIAuditVerifier",
|
|
3518
|
+
checks,
|
|
3519
|
+
overall
|
|
3520
|
+
};
|
|
3521
|
+
return { ...manifestWithoutDigest, deterministicDigest: hsiSha256(manifestWithoutDigest) };
|
|
3522
|
+
}
|
|
3523
|
+
|
|
3524
|
+
// src/compiler/index.ts
|
|
2151
3525
|
init_PlatformConditionalCompilerMixin();
|
|
2152
3526
|
|
|
2153
3527
|
// src/compiler/authority/AuthoritySymbolGraph.ts
|
|
@@ -3744,7 +5118,7 @@ async function runTier3CpuDirectExecutor(op) {
|
|
|
3744
5118
|
}
|
|
3745
5119
|
async function runTier1BrowserSnn(op) {
|
|
3746
5120
|
try {
|
|
3747
|
-
const snnWebgpu = await import('../dist-
|
|
5121
|
+
const snnWebgpu = await import('../dist-ZEZXRCBG.js');
|
|
3748
5122
|
const { GPUContext, LIFSimulator, DEFAULT_LIF_PARAMS } = snnWebgpu;
|
|
3749
5123
|
const ctx = new GPUContext();
|
|
3750
5124
|
await ctx.initialize();
|
|
@@ -3849,8 +5223,8 @@ async function sha256Hex(input) {
|
|
|
3849
5223
|
const digest = await subtle.digest("SHA-256", new TextEncoder().encode(input));
|
|
3850
5224
|
return bytesToHex(new Uint8Array(digest));
|
|
3851
5225
|
}
|
|
3852
|
-
const { createHash:
|
|
3853
|
-
return
|
|
5226
|
+
const { createHash: createHash4 } = await import('crypto');
|
|
5227
|
+
return createHash4("sha256").update(input).digest("hex");
|
|
3854
5228
|
}
|
|
3855
5229
|
function bytesToHex(bytes) {
|
|
3856
5230
|
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
@@ -4716,6 +6090,8 @@ var BRIDGE_TARGETS = [
|
|
|
4716
6090
|
// Meta Quest (Horizon OS / Meta Spatial SDK) — emits a native Kotlin app to Meta's runtime
|
|
4717
6091
|
"ios",
|
|
4718
6092
|
"visionos",
|
|
6093
|
+
"r3f",
|
|
6094
|
+
// SceneIR -> generated TSX shell consumed by React Three Fiber; HoloScript owns SceneIR, R3F is the host runtime bridge
|
|
4719
6095
|
"usd",
|
|
4720
6096
|
"usdz",
|
|
4721
6097
|
"fmu",
|
|
@@ -4959,6 +6335,6 @@ var SOVEREIGN_ENGINES = [
|
|
|
4959
6335
|
}
|
|
4960
6336
|
];
|
|
4961
6337
|
|
|
4962
|
-
export { AgentTrustLedger, AlphaTracker, AndroidARCorePlugin, AuthoritySymbolGraph, BRIDGE_TARGETS, COLYSEUS_CONSTANT_TIERS, COLYSEUS_EMIT_FILE, COLYSEUS_SCHEMA_FIELD_TIERS, DEFAULT_DISPATCH_LATENCY_OPERATION, DispatchPolicy, DispatchTier, MCPConfigCompiler, MultiLayerCompiler, NATIVE_COMPILE_MODES, NextJSCompiler, ProvenanceBoundsChecker, SOVEREIGN_ENGINES, SOVEREIGN_TARGETS, Vector2DCompiler, WebGPUWGSLPlugin, buildColyseusAuthorityGraph, buildColyseusCrossFileContext, byzantineResilientMerge, createAuthoritySymbolGraph, createDefaultDispatchLatencyScenarios, createProvenanceBoundsChecker, createTier3CpuDirectOutput, detectWasmRuntime, formatDispatchLatencyBenchmarkReport, generateTraitForTarget, getAllManifests, getTraitInfo, isBridgeTarget, isSovereignTarget, listTraitsForTarget, manifestFromPlugin, mergeSocialCausalModels, mostRestrictiveTier, platformPluginRegistry, queryTrait, recommendDispatchPolicyDefaults, runCompilerWasmSnnEmulator, runDispatchPolicyLatencyBenchmark, splitServerAuthority, targetSovereignty, traitExists };
|
|
6338
|
+
export { AgentTrustLedger, AlphaTracker, AndroidARCorePlugin, AuthoritySymbolGraph, BRIDGE_TARGETS, COLYSEUS_CONSTANT_TIERS, COLYSEUS_EMIT_FILE, COLYSEUS_SCHEMA_FIELD_TIERS, DEFAULT_DISPATCH_LATENCY_OPERATION, DispatchPolicy, DispatchTier, HSIAdmissionError, HSIIRCompiler, HSI_AUDIT_SCHEMA_VERSION, HSI_IR_SCHEMA_VERSION, HSI_LEARNING_GRAPH_SCHEMA_VERSION, HSI_OBSERVATION_MEDIATOR_EDGE, HSI_TRACE_SCHEMA_VERSION, MCPConfigCompiler, MultiLayerCompiler, NATIVE_COMPILE_MODES, NextJSCompiler, ProvenanceBoundsChecker, SOVEREIGN_ENGINES, SOVEREIGN_TARGETS, Vector2DCompiler, WebGPUWGSLPlugin, applyIntervention, behavioralProjection, buildColyseusAuthorityGraph, buildColyseusCrossFileContext, byzantineResilientMerge, createAuthoritySymbolGraph, createDefaultDispatchLatencyScenarios, createHSIIRCompiler, createProvenanceBoundsChecker, createTier3CpuDirectOutput, detectWasmRuntime, emitSceneIRTsx, formatDispatchLatencyBenchmarkReport, generateAuditCases, generateTraitForTarget, getAllManifests, getTraitInfo, hsiSha256, hsiSourceTextDigest, hsiStableStringify, isBridgeTarget, isSovereignTarget, listTraitsForTarget, lowerCompositionToHSIIR, lowerHoloExpression, manifestFromPlugin, mergeSocialCausalModels, mostRestrictiveTier, platformPluginRegistry, projectLearningGraph, queryTrait, recommendDispatchPolicyDefaults, renameComposition, renameTrace, reorderComposition, runCompilerWasmSnnEmulator, runDispatchPolicyLatencyBenchmark, runExactTrace, runHSIAudit, splitServerAuthority, targetSovereignty, traitExists };
|
|
4963
6339
|
//# sourceMappingURL=index.js.map
|
|
4964
6340
|
//# sourceMappingURL=index.js.map
|