@holoscript/core 8.0.13 → 8.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -13
- package/bin/holo-decision.mjs +133 -0
- package/bin/holoscript.cjs +0 -0
- package/dist/{GLTFPipeline-L76YTXKA.js → GLTFPipeline-FRBZIATS.js} +7 -7
- package/dist/{GLTFPipeline-ZWJN7GI6.cjs → GLTFPipeline-MTPP444P.cjs} +11 -11
- package/dist/{HoloCompositionParser-P4Y3CXKQ.js → HoloCompositionParser-2GVQAZ2X.js} +7 -7
- package/dist/HoloCompositionParser-3NDF6BMX.cjs +45 -0
- package/dist/HoloScriptPlusParser-URSIBEAW.cjs +30 -0
- package/dist/HoloScriptPlusParser-YCV6L7GI.js +13 -0
- package/dist/{HoloScriptRuntime-YBYXJHJN.cjs → HoloScriptRuntime-CRWI6C3P.cjs} +5 -5
- package/dist/{HoloScriptRuntime-UTRLJI5L.js → HoloScriptRuntime-IAZGHPFP.js} +4 -4
- package/dist/{SceneIRCompiler-63KA3M2F.js → SceneIRCompiler-BJQMKLWL.js} +7 -7
- package/dist/{SceneIRCompiler-KWUFHZ4O.cjs → SceneIRCompiler-RTPPDQAV.cjs} +12 -12
- package/dist/{chunk-FWCHPCD4.js → chunk-22AULOAL.js} +5 -5
- package/dist/{chunk-G35CAQ7I.cjs → chunk-2DJIS7TH.cjs} +5 -5
- package/dist/{chunk-LHUDAJQT.cjs → chunk-2PVEXEOL.cjs} +5 -5
- package/dist/{chunk-WWNCM473.js → chunk-2UP2J3OK.js} +4 -4
- package/dist/{chunk-HVX7QQYK.js → chunk-3AUYBQ5I.js} +3 -3
- package/dist/{chunk-TSTFYGGX.js → chunk-3MQAOMKD.js} +3 -3
- package/dist/{chunk-FWKEY4LD.js → chunk-4AGNARX6.js} +3 -3
- package/dist/{chunk-WNYXT4TE.cjs → chunk-4CQ7ULXZ.cjs} +3 -3
- package/dist/{chunk-U3D4SYQ5.js → chunk-5LCJDX5A.js} +3 -3
- package/dist/{chunk-IK6Z2HNC.js → chunk-6OQHLNTT.js} +2 -2
- package/dist/{chunk-EI3J6LTW.cjs → chunk-6RDHWSZM.cjs} +217 -217
- package/dist/{chunk-77QI552M.js → chunk-7AY66PZP.js} +3 -3
- package/dist/{chunk-7IDJDMPU.cjs → chunk-7FYSSI3C.cjs} +27 -2
- package/dist/{chunk-BP4KTMLY.js → chunk-7HDRN5BW.js} +4 -4
- package/dist/{chunk-SQAAWO4V.cjs → chunk-7YKNV2BE.cjs} +5 -5
- package/dist/{chunk-WTH23ISI.js → chunk-AAUQTR7I.js} +4 -4
- package/dist/{chunk-OC6GV5QH.cjs → chunk-AN3ZH7M7.cjs} +38 -38
- package/dist/{chunk-YW3I2FQL.js → chunk-ANMME7XT.js} +4 -2
- package/dist/{chunk-A4OOLBZD.js → chunk-ATRAK4RC.js} +5 -5
- package/dist/{chunk-BQJ3YBF3.js → chunk-AUF7HFOO.js} +724 -647
- package/dist/{chunk-2X3IPCBK.cjs → chunk-AUMTQV64.cjs} +7 -7
- package/dist/chunk-AUU4ACJP.cjs +1605 -0
- package/dist/{chunk-QQFB4RT2.cjs → chunk-BTVHY3UB.cjs} +2 -2
- package/dist/{chunk-ZK7KX5CD.cjs → chunk-CMEINO5I.cjs} +190 -74
- package/dist/{chunk-BCP4E7MD.cjs → chunk-CRUIGXF7.cjs} +26 -10
- package/dist/{chunk-2E6PP5UE.cjs → chunk-E2SNPMBO.cjs} +11 -11
- package/dist/{chunk-2BYAUHBO.js → chunk-E4YS5SIZ.js} +90 -25
- package/dist/{chunk-KFVNCW4Q.js → chunk-EKNWUSGW.js} +3 -3
- package/dist/{chunk-JEJ7TT54.js → chunk-ETIJOUIO.js} +4 -4
- package/dist/{chunk-FRSKLX6I.js → chunk-F33KLYOS.js} +12 -9
- package/dist/{chunk-GGR7QUKK.cjs → chunk-F47FEV4X.cjs} +40 -40
- package/dist/{chunk-J3UHV5T4.cjs → chunk-FCGTI7FO.cjs} +4 -4
- package/dist/{chunk-RRQIAJLQ.cjs → chunk-FGTXAVKG.cjs} +5 -5
- package/dist/{chunk-2KKOYZYI.cjs → chunk-FPGYWNNA.cjs} +5 -5
- package/dist/{chunk-65S62L4D.cjs → chunk-FQ4MYZYU.cjs} +20 -20
- package/dist/{chunk-UGQ3QNV6.js → chunk-FT4FGTR6.js} +24 -8
- package/dist/{chunk-Q4K2GEMW.cjs → chunk-FVNV4WHQ.cjs} +20 -17
- package/dist/{chunk-SJIRCTIS.cjs → chunk-HSGJFCVJ.cjs} +2 -2
- package/dist/{chunk-B3CWTCK2.js → chunk-IA7FCSRY.js} +27 -2
- package/dist/{chunk-OIBRWLPY.cjs → chunk-ILO2KMER.cjs} +55 -4
- package/dist/{chunk-ZRPALBQB.cjs → chunk-IPBSNGAN.cjs} +92 -27
- package/dist/{chunk-FHVPN7BN.js → chunk-IX2U3RQT.js} +3 -3
- package/dist/{chunk-QEDMOGF3.cjs → chunk-IYK6LMQ7.cjs} +7 -7
- package/dist/{chunk-G6EKZHXY.js → chunk-J3VVM6GV.js} +4 -4
- package/dist/{chunk-LMB555QB.cjs → chunk-J74S4ZMF.cjs} +18 -18
- package/dist/{chunk-36NPLOI4.cjs → chunk-JERWCCEJ.cjs} +4 -2
- package/dist/{chunk-RVNXBF2M.js → chunk-JTDDLCSP.js} +4 -4
- package/dist/{chunk-VTEXJOSD.cjs → chunk-K53L47NH.cjs} +30 -30
- package/dist/{chunk-IJU6AS67.cjs → chunk-LJTM5ONX.cjs} +23 -23
- package/dist/{chunk-G6KACNMO.js → chunk-LJVVOVA6.js} +4 -4
- package/dist/{chunk-PDXX5UI4.cjs → chunk-LNJKBQ2B.cjs} +38 -38
- package/dist/{chunk-EM2OGPYE.js → chunk-M2GDE3NV.js} +3 -3
- package/dist/{chunk-CP7V3ATL.js → chunk-MSZNGI5P.js} +52 -5
- package/dist/{chunk-P7JEKJTZ.cjs → chunk-N2BOTBPG.cjs} +27 -16
- package/dist/{chunk-LB3ZZMKT.cjs → chunk-NFALJJCH.cjs} +12 -12
- package/dist/{chunk-XF63CZ7E.cjs → chunk-NRZRBK25.cjs} +6 -6
- package/dist/{chunk-GZPUA2TL.cjs → chunk-NTSLNIY7.cjs} +10 -10
- package/dist/{chunk-Y57AVOM2.cjs → chunk-NZJOAWJM.cjs} +4 -4
- package/dist/{chunk-RXQNRZ5F.js → chunk-OG7RKWWX.js} +3 -3
- package/dist/{chunk-VVAAZITA.cjs → chunk-OQVHCYY4.cjs} +5 -5
- package/dist/{chunk-PJFTTSKE.js → chunk-PFZ5WLIP.js} +4 -4
- package/dist/{chunk-PXVAPGTR.cjs → chunk-PHLNABJD.cjs} +3788 -1138
- package/dist/{chunk-SQXAZHDG.js → chunk-PLK3DLTF.js} +3 -3
- package/dist/{chunk-QBY7LRN2.js → chunk-PMACVMHL.js} +3 -3
- package/dist/{chunk-DJ5BNRIS.js → chunk-PV2OXNP5.js} +3684 -1041
- package/dist/{chunk-F3YT6GUF.cjs → chunk-Q6VW7MGX.cjs} +14 -14
- package/dist/{chunk-DUG3OQAS.js → chunk-QC3CAVFN.js} +187 -70
- package/dist/{chunk-NQN5LFN4.cjs → chunk-QKLEDRHN.cjs} +19 -19
- package/dist/{chunk-2EGGAZT3.js → chunk-QS27OYBU.js} +3 -3
- package/dist/{chunk-4376VHNJ.js → chunk-RUB7WL6C.js} +3 -3
- package/dist/{chunk-5LVFTGKH.js → chunk-TW2AH2ZS.js} +3 -3
- package/dist/{chunk-AATYYLYK.js → chunk-TZM6DKSJ.js} +18 -7
- package/dist/{chunk-ESSEF6U2.js → chunk-U227RWXB.js} +3 -3
- package/dist/{chunk-TC7JEO6R.cjs → chunk-U6CQOM5Q.cjs} +711 -52
- package/dist/{chunk-Z557DVYN.js → chunk-ULT2QAV5.js} +4 -4
- package/dist/{chunk-S4O7CFHQ.cjs → chunk-VSO6HPDZ.cjs} +7 -7
- package/dist/{chunk-ONPVM4IV.js → chunk-WQJMSSJT.js} +698 -45
- package/dist/{chunk-GILYQ5VH.cjs → chunk-WXSDBWGM.cjs} +4 -4
- package/dist/{chunk-UTUD6GJI.js → chunk-X5PMMK7H.js} +3 -3
- package/dist/{chunk-IFW5IW4L.cjs → chunk-X5ZLSPU2.cjs} +742 -657
- package/dist/{chunk-QM7FJB5W.js → chunk-X727CQ7X.js} +5 -5
- package/dist/{chunk-566ZB4LZ.cjs → chunk-XHZYS4QO.cjs} +5 -5
- package/dist/{chunk-RZ2EPXO3.cjs → chunk-XRQCTTDC.cjs} +8 -8
- package/dist/{chunk-5FYMCVBY.js → chunk-YBIHSN55.js} +4 -4
- package/dist/{chunk-FG6PYGIZ.js → chunk-Z574GVI3.js} +4 -4
- package/dist/{chunk-ZVQMKUGJ.js → chunk-Z5V3KA7L.js} +2 -2
- package/dist/chunk-ZGDEOXGU.js +1571 -0
- package/dist/{chunk-IS7NTKY5.cjs → chunk-ZHW6TDZ6.cjs} +14 -14
- package/dist/{chunk-CKV5NYAE.js → chunk-ZPHCTPR6.js} +4 -4
- package/dist/{chunk-3IUHTGDD.cjs → chunk-ZXXC2GXB.cjs} +38 -38
- package/dist/cli/holoscript-runner.cjs +169 -20
- package/dist/cli/holoscript-runner.js +163 -14
- package/dist/compiler/agent-inference.cjs +8 -8
- package/dist/compiler/agent-inference.js +4 -4
- package/dist/compiler/android-xr.cjs +7 -7
- package/dist/compiler/android-xr.js +5 -5
- package/dist/compiler/android.cjs +6 -6
- package/dist/compiler/android.js +4 -4
- package/dist/compiler/context.cjs +6 -6
- package/dist/compiler/context.js +3 -3
- package/dist/compiler/daimon-seed.cjs +9 -9
- package/dist/compiler/daimon-seed.js +4 -4
- package/dist/compiler/domain-block-utils.cjs +165 -165
- package/dist/compiler/domain-block-utils.js +4 -4
- package/dist/compiler/dtdl.cjs +7 -7
- package/dist/compiler/dtdl.js +4 -4
- package/dist/compiler/gltf-pipeline.cjs +8 -8
- package/dist/compiler/gltf-pipeline.js +1 -1
- package/dist/compiler/godot.cjs +6 -6
- package/dist/compiler/godot.js +5 -5
- package/dist/compiler/incremental.cjs +8 -8
- package/dist/compiler/incremental.js +3 -3
- package/dist/compiler/index.cjs +2275 -212
- package/dist/compiler/index.d.ts +29 -1
- package/dist/compiler/index.js +2078 -66
- package/dist/compiler/ios.cjs +6 -6
- package/dist/compiler/ios.js +4 -4
- package/dist/compiler/llm-provider-capabilities.cjs +6 -6
- package/dist/compiler/llm-provider-capabilities.js +3 -3
- package/dist/compiler/openxr.cjs +6 -6
- package/dist/compiler/openxr.js +5 -5
- package/dist/compiler/sdf.cjs +7 -7
- package/dist/compiler/sdf.js +5 -5
- package/dist/compiler/state.cjs +6 -6
- package/dist/compiler/state.js +4 -4
- package/dist/compiler/trait-composition.cjs +7 -7
- package/dist/compiler/trait-composition.js +3 -3
- package/dist/compiler/unity.cjs +6 -6
- package/dist/compiler/unity.js +5 -5
- package/dist/compiler/unreal.cjs +7 -7
- package/dist/compiler/unreal.js +5 -5
- package/dist/compiler/urdf.cjs +14 -14
- package/dist/compiler/urdf.js +5 -5
- package/dist/compiler/usd-physics.cjs +7 -7
- package/dist/compiler/usd-physics.js +4 -4
- package/dist/compiler/visionos.cjs +6 -6
- package/dist/compiler/visionos.js +5 -5
- package/dist/compiler/vrchat.cjs +7 -7
- package/dist/compiler/vrchat.js +5 -5
- package/dist/compiler/wasm.cjs +10 -10
- package/dist/compiler/wasm.js +5 -5
- package/dist/compiler/webgpu.cjs +6 -6
- package/dist/compiler/webgpu.js +5 -5
- package/dist/constants.cjs +99 -99
- package/dist/constants.js +3 -3
- package/dist/debugger.cjs +5 -5
- package/dist/debugger.js +3 -3
- package/dist/{dist-GRMOP2UL.cjs → dist-YGATNURH.cjs} +705 -9
- package/dist/{dist-ZBUKU2JG.js → dist-ZEZXRCBG.js} +701 -10
- package/dist/entries/scripting.cjs +8 -8
- package/dist/entries/scripting.js +4 -4
- package/dist/evolution/index.cjs +20 -20
- package/dist/evolution/index.js +8 -8
- package/dist/index.cjs +1099 -826
- package/dist/index.d.ts +78 -5
- package/dist/index.js +265 -120
- package/dist/parser/HoloCompositionTypes.d.ts +1 -1
- package/dist/parser.cjs +21 -21
- package/dist/parser.js +7 -7
- package/dist/reconstruction/index.cjs +127 -38
- package/dist/reconstruction/index.d.ts +159 -0
- package/dist/reconstruction/index.js +11 -2
- package/dist/runtime.cjs +9 -9
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +3 -3
- package/dist/traitDocs/traitDocs.cjs +8 -8
- package/dist/traitDocs/traitDocs.js +2 -2
- package/dist/traits/botanical-lotus.d.ts +61 -0
- package/dist/traits/index.cjs +761 -673
- package/dist/traits/index.d.ts +65 -0
- package/dist/traits/index.js +102 -27
- package/dist/types/HoloScriptPlus.d.ts +1 -1
- package/package.json +71 -65
- package/dist/HoloCompositionParser-6GW2BZID.cjs +0 -45
- package/dist/HoloScriptPlusParser-HQV6IJAH.js +0 -13
- package/dist/HoloScriptPlusParser-RFNHRMPE.cjs +0 -30
- package/dist/chunk-DVHZD5HV.cjs +0 -639
- package/dist/chunk-G72754QB.js +0 -625
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { init_CompilerBase, CompilerBase } from './chunk-
|
|
1
|
+
import { init_CompilerBase, CompilerBase } from './chunk-QC3CAVFN.js';
|
|
2
2
|
|
|
3
3
|
// src/compiler/QuantumCircuitCompiler.ts
|
|
4
4
|
init_CompilerBase();
|
|
5
|
+
function configValue(entry) {
|
|
6
|
+
if (typeof entry === "object" && entry !== null && "value" in entry) {
|
|
7
|
+
return entry.value;
|
|
8
|
+
}
|
|
9
|
+
return entry;
|
|
10
|
+
}
|
|
5
11
|
function qubitsForMolecule(atoms) {
|
|
6
12
|
const orbitalCount = atoms.reduce((sum, a) => {
|
|
7
13
|
if (a.symbol === "H") return sum + 1;
|
|
@@ -12,8 +18,8 @@ function qubitsForMolecule(atoms) {
|
|
|
12
18
|
}
|
|
13
19
|
function extractNumber(config, key) {
|
|
14
20
|
const entry = config[key];
|
|
15
|
-
if (
|
|
16
|
-
const v = entry
|
|
21
|
+
if (entry === void 0) return void 0;
|
|
22
|
+
const v = configValue(entry);
|
|
17
23
|
if (typeof v === "number") return v;
|
|
18
24
|
if (typeof v === "string") {
|
|
19
25
|
const n = parseFloat(v);
|
|
@@ -21,10 +27,33 @@ function extractNumber(config, key) {
|
|
|
21
27
|
}
|
|
22
28
|
return void 0;
|
|
23
29
|
}
|
|
30
|
+
function extractString(config, ...keys) {
|
|
31
|
+
for (const key of keys) {
|
|
32
|
+
const value = configValue(config[key]);
|
|
33
|
+
if (typeof value === "string" && value.trim().length > 0) return value.trim();
|
|
34
|
+
}
|
|
35
|
+
return void 0;
|
|
36
|
+
}
|
|
37
|
+
function extractNumberArray(config, ...keys) {
|
|
38
|
+
for (const key of keys) {
|
|
39
|
+
let value = configValue(config[key]);
|
|
40
|
+
if (typeof value === "string") {
|
|
41
|
+
try {
|
|
42
|
+
value = JSON.parse(value);
|
|
43
|
+
} catch {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (Array.isArray(value) && value.every((entry) => typeof entry === "number" && Number.isFinite(entry))) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return void 0;
|
|
52
|
+
}
|
|
24
53
|
function extractAtoms(config) {
|
|
25
54
|
const entry = config["molecule"] ?? config["atoms"];
|
|
26
55
|
if (!entry) return void 0;
|
|
27
|
-
let raw = entry
|
|
56
|
+
let raw = configValue(entry);
|
|
28
57
|
if (typeof raw === "string") {
|
|
29
58
|
try {
|
|
30
59
|
raw = JSON.parse(raw);
|
|
@@ -38,9 +67,9 @@ function extractAtoms(config) {
|
|
|
38
67
|
);
|
|
39
68
|
}
|
|
40
69
|
function extractWeightMatrix(config) {
|
|
41
|
-
const entry = config["weightMatrix"] ?? config["weight_matrix"] ?? config["adjacency"];
|
|
70
|
+
const entry = config["quboMatrix"] ?? config["qubo_matrix"] ?? config["weightMatrix"] ?? config["weight_matrix"] ?? config["adjacency"];
|
|
42
71
|
if (!entry) return void 0;
|
|
43
|
-
let raw = entry
|
|
72
|
+
let raw = configValue(entry);
|
|
44
73
|
if (typeof raw === "string") {
|
|
45
74
|
try {
|
|
46
75
|
raw = JSON.parse(raw);
|
|
@@ -105,7 +134,7 @@ function generateVQECircuit(atoms, moleculeName, ansatzLayers, initialParams) {
|
|
|
105
134
|
const estimatedDepth = ansatzLayers * 2 + 1;
|
|
106
135
|
return { qasm: lines.join("\n"), numQubits: n, estimatedDepth, warnings, paramNames };
|
|
107
136
|
}
|
|
108
|
-
function generateQAOACircuit(weightMatrix, p, initialGamma, initialBeta) {
|
|
137
|
+
function generateQAOACircuit(weightMatrix, p, optimizationProblem, initialGamma, initialBeta) {
|
|
109
138
|
const warnings = [];
|
|
110
139
|
let n = weightMatrix.length;
|
|
111
140
|
if (n > 100) {
|
|
@@ -130,7 +159,9 @@ function generateQAOACircuit(weightMatrix, p, initialGamma, initialBeta) {
|
|
|
130
159
|
const lines = [];
|
|
131
160
|
lines.push("OPENQASM 3.0;");
|
|
132
161
|
lines.push('include "stdgates.inc";');
|
|
133
|
-
lines.push(
|
|
162
|
+
lines.push(
|
|
163
|
+
`// QAOA ${optimizationProblem === "qubo" ? "upper-triangular QUBO" : "Max-Cut"} circuit for ${n} binary variables (p=${p})`
|
|
164
|
+
);
|
|
134
165
|
lines.push("// Generated by HoloScript QuantumCircuitCompiler");
|
|
135
166
|
lines.push(`qubit[${n}] q;`);
|
|
136
167
|
lines.push(`bit[${n}] c;`);
|
|
@@ -145,16 +176,36 @@ function generateQAOACircuit(weightMatrix, p, initialGamma, initialBeta) {
|
|
|
145
176
|
}
|
|
146
177
|
for (let round = 0; round < p; round++) {
|
|
147
178
|
lines.push(`// Problem unitary - round ${round + 1} (gamma=gamma_${round})`);
|
|
148
|
-
|
|
149
|
-
for (let
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
152
|
-
lines.push(`//
|
|
179
|
+
if (optimizationProblem === "qubo") {
|
|
180
|
+
for (let i = 0; i < n; i++) {
|
|
181
|
+
const qii = weightMatrix[i]?.[i] ?? 0;
|
|
182
|
+
if (qii !== 0) {
|
|
183
|
+
lines.push(`// QUBO linear x_${i} coefficient=${qii}`);
|
|
184
|
+
lines.push(`rz(-1.0 * gamma_${round} * ${qii.toFixed(4)}) q[${i}];`);
|
|
185
|
+
}
|
|
186
|
+
for (let j = i + 1; j < n; j++) {
|
|
187
|
+
const qij = weightMatrix[i]?.[j] ?? 0;
|
|
188
|
+
if (qij === 0) continue;
|
|
189
|
+
lines.push(`// QUBO pair x_${i}*x_${j} coefficient=${qij}`);
|
|
190
|
+
lines.push(`rz(-0.5 * gamma_${round} * ${qij.toFixed(4)}) q[${i}];`);
|
|
191
|
+
lines.push(`rz(-0.5 * gamma_${round} * ${qij.toFixed(4)}) q[${j}];`);
|
|
153
192
|
lines.push(`cx q[${i}], q[${j}];`);
|
|
154
|
-
lines.push(`rz(
|
|
193
|
+
lines.push(`rz(0.5 * gamma_${round} * ${qij.toFixed(4)}) q[${j}];`);
|
|
155
194
|
lines.push(`cx q[${i}], q[${j}];`);
|
|
156
195
|
}
|
|
157
196
|
}
|
|
197
|
+
} else {
|
|
198
|
+
for (let i = 0; i < n; i++) {
|
|
199
|
+
for (let j = i + 1; j < n; j++) {
|
|
200
|
+
const w = weightMatrix[i]?.[j] ?? 0;
|
|
201
|
+
if (w !== 0) {
|
|
202
|
+
lines.push(`// Edge (${i},${j}) weight=${w}: rzz(2.0*gamma_${round}*${w.toFixed(4)})`);
|
|
203
|
+
lines.push(`cx q[${i}], q[${j}];`);
|
|
204
|
+
lines.push(`rz(2.0 * gamma_${round} * ${w.toFixed(4)}) q[${j}];`);
|
|
205
|
+
lines.push(`cx q[${i}], q[${j}];`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
158
209
|
}
|
|
159
210
|
lines.push(`// Mixer unitary - round ${round + 1} (beta=beta_${round})`);
|
|
160
211
|
for (let i = 0; i < n; i++) {
|
|
@@ -163,8 +214,11 @@ function generateQAOACircuit(weightMatrix, p, initialGamma, initialBeta) {
|
|
|
163
214
|
}
|
|
164
215
|
lines.push("// Measurement");
|
|
165
216
|
lines.push("c = measure q;");
|
|
166
|
-
const
|
|
167
|
-
|
|
217
|
+
const termCount = weightMatrix.reduce(
|
|
218
|
+
(count, row, i) => count + row.slice(optimizationProblem === "qubo" ? i : i + 1).filter((w) => w !== 0).length,
|
|
219
|
+
0
|
|
220
|
+
);
|
|
221
|
+
const estimatedDepth = 1 + p * (Math.ceil(termCount * (optimizationProblem === "qubo" ? 5 : 3)) + 1) + 1;
|
|
168
222
|
return { qasm: lines.join("\n"), numQubits: n, estimatedDepth, warnings, paramNames };
|
|
169
223
|
}
|
|
170
224
|
function generateStubCircuit() {
|
|
@@ -181,7 +235,7 @@ function generateStubCircuit() {
|
|
|
181
235
|
return {
|
|
182
236
|
qasm,
|
|
183
237
|
warnings: [
|
|
184
|
-
"No @quantumCircuit (or @quantum_circuit) trait found in the composition. A stub 1-qubit circuit has been emitted. Add a @
|
|
238
|
+
"No @quantumCircuit (or @quantum_circuit) trait found in the composition. A stub 1-qubit circuit has been emitted. Add a @quantum_circuit trait with `molecule`, `weightMatrix`, or `quboMatrix` params to generate a real circuit."
|
|
185
239
|
]
|
|
186
240
|
};
|
|
187
241
|
}
|
|
@@ -197,6 +251,7 @@ var QuantumCircuitCompiler = class extends CompilerBase {
|
|
|
197
251
|
* `@quantumCircuit` or `@quantum_circuit` trait. Trait params drive the type:
|
|
198
252
|
* - `molecule` (or `atoms`) - VQE hardware-efficient ansatz
|
|
199
253
|
* - `weightMatrix` / `weight_matrix` / `adjacency` / `numNodes` - QAOA Max-Cut
|
|
254
|
+
* - `quboMatrix` / `qubo_matrix` - QAOA upper-triangular QUBO minimization
|
|
200
255
|
* - none of the above - stub 1-qubit circuit with a warning
|
|
201
256
|
*
|
|
202
257
|
* @param composition - Parsed HoloScript AST
|
|
@@ -224,12 +279,20 @@ var QuantumCircuitCompiler = class extends CompilerBase {
|
|
|
224
279
|
const cfg = trait.config;
|
|
225
280
|
const atoms = extractAtoms(cfg);
|
|
226
281
|
const weightMatrix = extractWeightMatrix(cfg);
|
|
282
|
+
const requestedProblem = extractString(
|
|
283
|
+
cfg,
|
|
284
|
+
"problemType",
|
|
285
|
+
"problem_type",
|
|
286
|
+
"optimizationProblem"
|
|
287
|
+
);
|
|
288
|
+
const hasExplicitQuboMatrix = cfg["quboMatrix"] !== void 0 || cfg["qubo_matrix"] !== void 0;
|
|
289
|
+
const optimizationProblem = requestedProblem?.toLowerCase() === "qubo" || hasExplicitQuboMatrix ? "qubo" : "maxcut";
|
|
227
290
|
const numNodes = extractNumber(cfg, "numNodes") ?? extractNumber(cfg, "num_nodes");
|
|
228
291
|
if (atoms && atoms.length > 0) {
|
|
229
292
|
return this.buildVQEOutput(atoms, cfg);
|
|
230
293
|
}
|
|
231
294
|
if (weightMatrix) {
|
|
232
|
-
return this.buildQAOAOutput(weightMatrix, cfg);
|
|
295
|
+
return this.buildQAOAOutput(weightMatrix, cfg, optimizationProblem);
|
|
233
296
|
}
|
|
234
297
|
if (numNodes !== void 0 && numNodes > 0) {
|
|
235
298
|
const n = Math.min(Math.round(numNodes), 100);
|
|
@@ -237,11 +300,11 @@ var QuantumCircuitCompiler = class extends CompilerBase {
|
|
|
237
300
|
{ length: n },
|
|
238
301
|
(_, i) => Array.from({ length: n }, (_2, j) => i !== j ? 1 : 0)
|
|
239
302
|
);
|
|
240
|
-
return this.buildQAOAOutput(matrix, cfg);
|
|
303
|
+
return this.buildQAOAOutput(matrix, cfg, "maxcut");
|
|
241
304
|
}
|
|
242
305
|
const { qasm, warnings } = generateStubCircuit();
|
|
243
306
|
warnings.unshift(
|
|
244
|
-
"@quantumCircuit trait found but neither `molecule`/`atoms
|
|
307
|
+
"@quantumCircuit trait found but neither `molecule`/`atoms`, `weightMatrix`/`numNodes`, nor `quboMatrix` params are present. Add params to generate a circuit."
|
|
245
308
|
);
|
|
246
309
|
return {
|
|
247
310
|
qasm,
|
|
@@ -276,12 +339,12 @@ var QuantumCircuitCompiler = class extends CompilerBase {
|
|
|
276
339
|
}
|
|
277
340
|
/** Build a {@link QASMOutput} for a VQE circuit. */
|
|
278
341
|
buildVQEOutput(atoms, cfg) {
|
|
279
|
-
const moleculeName = (
|
|
342
|
+
const moleculeName = extractString(cfg, "moleculeName", "molecule_name") ?? atoms.map((a) => a.symbol).join("") ?? "molecule";
|
|
280
343
|
const ansatzLayers = Math.max(
|
|
281
344
|
1,
|
|
282
345
|
Math.round(extractNumber(cfg, "ansatzLayers") ?? extractNumber(cfg, "ansatz_layers") ?? 2)
|
|
283
346
|
);
|
|
284
|
-
const initialParams = cfg
|
|
347
|
+
const initialParams = extractNumberArray(cfg, "initialParams", "initial_params");
|
|
285
348
|
const { qasm, numQubits, estimatedDepth, warnings, paramNames } = generateVQECircuit(
|
|
286
349
|
atoms,
|
|
287
350
|
moleculeName,
|
|
@@ -301,13 +364,14 @@ var QuantumCircuitCompiler = class extends CompilerBase {
|
|
|
301
364
|
};
|
|
302
365
|
}
|
|
303
366
|
/** Build a {@link QASMOutput} for a QAOA circuit. */
|
|
304
|
-
buildQAOAOutput(weightMatrix, cfg) {
|
|
367
|
+
buildQAOAOutput(weightMatrix, cfg, optimizationProblem) {
|
|
305
368
|
const p = Math.max(1, Math.round(extractNumber(cfg, "p") ?? 1));
|
|
306
369
|
const initialGamma = extractNumber(cfg, "gamma") ?? extractNumber(cfg, "initial_gamma");
|
|
307
370
|
const initialBeta = extractNumber(cfg, "beta") ?? extractNumber(cfg, "initial_beta");
|
|
308
371
|
const { qasm, numQubits, estimatedDepth, warnings, paramNames } = generateQAOACircuit(
|
|
309
372
|
weightMatrix,
|
|
310
373
|
p,
|
|
374
|
+
optimizationProblem,
|
|
311
375
|
initialGamma,
|
|
312
376
|
initialBeta
|
|
313
377
|
);
|
|
@@ -318,6 +382,7 @@ var QuantumCircuitCompiler = class extends CompilerBase {
|
|
|
318
382
|
estimatedDepth,
|
|
319
383
|
circuitType: "qaoa",
|
|
320
384
|
weightMatrix,
|
|
385
|
+
optimizationProblem,
|
|
321
386
|
recommendedBackend: numQubits <= 50 ? "aer" : "ibm-quantum",
|
|
322
387
|
warnings,
|
|
323
388
|
paramNames
|
|
@@ -326,5 +391,5 @@ var QuantumCircuitCompiler = class extends CompilerBase {
|
|
|
326
391
|
};
|
|
327
392
|
|
|
328
393
|
export { QuantumCircuitCompiler };
|
|
329
|
-
//# sourceMappingURL=chunk-
|
|
330
|
-
//# sourceMappingURL=chunk-
|
|
394
|
+
//# sourceMappingURL=chunk-E4YS5SIZ.js.map
|
|
395
|
+
//# sourceMappingURL=chunk-E4YS5SIZ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init_AgentRBAC, init_CompilerBase, getRBAC, UnauthorizedCompilerAccessError } from './chunk-
|
|
1
|
+
import { init_AgentRBAC, init_CompilerBase, getRBAC, UnauthorizedCompilerAccessError } from './chunk-QC3CAVFN.js';
|
|
2
2
|
import { __export, __esm } from './chunk-W4GABFCR.js';
|
|
3
3
|
|
|
4
4
|
// src/compiler/StateCompiler.ts
|
|
@@ -109,5 +109,5 @@ var init_StateCompiler = __esm({
|
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
export { StateCompiler, StateCompiler_exports, UnauthorizedStateCompilerAccessError, init_StateCompiler };
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-EKNWUSGW.js.map
|
|
113
|
+
//# sourceMappingURL=chunk-EKNWUSGW.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_DomainBlockCompilerMixin, compileDomainBlocks, inputToGodot, compileInputBlock, navigationToGodot, compileNavigationBlock, renderingToGodot, compileRenderingBlock, proceduralToGodot, compileProceduralBlock, web3ToGodot, compileWeb3Block, architectureToGodot, compileArchitectureBlock, musicToGodot, compileMusicBlock, educationToGodot, compileEducationBlock, datavizToGodot, compileDataVizBlock, iotToGodot, compileIoTBlock, compileRoboticsBlock, roboticsToGodot, compileHealthcareBlock, healthcareToGodot, compilePaymentBlock, paymentToGodot, compileNarrativeBlock, narrativeToGodot, compileWeatherBlock, weatherToGodot, compileAudioSourceBlock, audioSourceToGodot, compilePostProcessingBlock, postProcessingToGodot, compileParticleBlock, particlesToGodot, compilePhysicsBlock, physicsToGodot, compileMaterialBlock, materialToGodot } from './chunk-
|
|
2
|
-
import { init_CompilerBase, CompilerBase } from './chunk-
|
|
1
|
+
import { init_DomainBlockCompilerMixin, compileDomainBlocks, inputToGodot, compileInputBlock, navigationToGodot, compileNavigationBlock, renderingToGodot, compileRenderingBlock, proceduralToGodot, compileProceduralBlock, web3ToGodot, compileWeb3Block, architectureToGodot, compileArchitectureBlock, musicToGodot, compileMusicBlock, educationToGodot, compileEducationBlock, datavizToGodot, compileDataVizBlock, iotToGodot, compileIoTBlock, compileRoboticsBlock, roboticsToGodot, compileHealthcareBlock, healthcareToGodot, compilePaymentBlock, paymentToGodot, compileNarrativeBlock, narrativeToGodot, compileWeatherBlock, weatherToGodot, compileAudioSourceBlock, audioSourceToGodot, compilePostProcessingBlock, postProcessingToGodot, compileParticleBlock, particlesToGodot, compilePhysicsBlock, physicsToGodot, compileMaterialBlock, materialToGodot } from './chunk-TW2AH2ZS.js';
|
|
2
|
+
import { init_CompilerBase, CompilerBase } from './chunk-QC3CAVFN.js';
|
|
3
3
|
import { __esm, __export } from './chunk-W4GABFCR.js';
|
|
4
4
|
import { ANSCapabilityPath } from '@holoscript/core-types/ans';
|
|
5
5
|
|
|
@@ -686,5 +686,5 @@ var init_GodotCompiler = __esm({
|
|
|
686
686
|
});
|
|
687
687
|
|
|
688
688
|
export { GodotCompiler, GodotCompiler_exports, init_GodotCompiler };
|
|
689
|
-
//# sourceMappingURL=chunk-
|
|
690
|
-
//# sourceMappingURL=chunk-
|
|
689
|
+
//# sourceMappingURL=chunk-ETIJOUIO.js.map
|
|
690
|
+
//# sourceMappingURL=chunk-ETIJOUIO.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ErrorRecovery, generateQuickFixes, enrichErrorWithSuggestions } from './chunk-
|
|
1
|
+
import { ErrorRecovery, generateQuickFixes, enrichErrorWithSuggestions, RUNTIME_DIRECTIVE_TRAITS } from './chunk-MSZNGI5P.js';
|
|
2
2
|
import { isBrainKeyword, isCognitiveVerb, nearestCognitiveVerb } from './chunk-UNMVGZVW.js';
|
|
3
|
-
import { LIFECYCLE_HOOKS, STRUCTURAL_DIRECTIVES } from './chunk-
|
|
4
|
-
import { VR_TRAITS } from './chunk-
|
|
3
|
+
import { LIFECYCLE_HOOKS, STRUCTURAL_DIRECTIVES } from './chunk-4AGNARX6.js';
|
|
4
|
+
import { VR_TRAITS } from './chunk-QS27OYBU.js';
|
|
5
5
|
import { isLocomotionReactionTrigger } from './chunk-63AUAIL6.js';
|
|
6
6
|
import * as crypto from 'crypto';
|
|
7
7
|
|
|
@@ -3271,10 +3271,13 @@ var HoloScriptPlusParser = class _HoloScriptPlusParser {
|
|
|
3271
3271
|
const config2 = this.check("LBRACE") ? this.parseBlockContent() : this.parseTraitConfig();
|
|
3272
3272
|
return { ...config2, type: name, name: nodeName };
|
|
3273
3273
|
}
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3274
|
+
const isKnownRuntimeDirective = RUNTIME_DIRECTIVE_TRAITS.includes(name);
|
|
3275
|
+
if (!isKnownRuntimeDirective) {
|
|
3276
|
+
if (this.options.strict) {
|
|
3277
|
+
this.traitError(name);
|
|
3278
|
+
} else {
|
|
3279
|
+
this.warn(`Unknown directive @${name}`);
|
|
3280
|
+
}
|
|
3278
3281
|
}
|
|
3279
3282
|
let config = {};
|
|
3280
3283
|
let configStyle = "none";
|
|
@@ -6251,5 +6254,5 @@ function parse(source, options) {
|
|
|
6251
6254
|
}
|
|
6252
6255
|
|
|
6253
6256
|
export { ChunkBasedIncrementalParser, HSPLUS_ERROR_CODES, HoloScriptPlusParser, ParseCache, createKeywordError, createParser, createRichError, createTraitError, findSimilarKeyword, findSimilarTrait, formatRichError, formatRichErrors, getErrorCodeDocumentation, getSourceContext, globalParseCache, parse, parseIncrementalChunks };
|
|
6254
|
-
//# sourceMappingURL=chunk-
|
|
6255
|
-
//# sourceMappingURL=chunk-
|
|
6257
|
+
//# sourceMappingURL=chunk-F33KLYOS.js.map
|
|
6258
|
+
//# sourceMappingURL=chunk-F33KLYOS.js.map
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkKROXXBK5_cjs = require('./chunk-KROXXBK5.cjs');
|
|
4
4
|
var chunkYKY2JBER_cjs = require('./chunk-YKY2JBER.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkBTVHY3UB_cjs = require('./chunk-BTVHY3UB.cjs');
|
|
6
6
|
var chunkENZCIQZC_cjs = require('./chunk-ENZCIQZC.cjs');
|
|
7
7
|
var chunkV6GXFSK7_cjs = require('./chunk-V6GXFSK7.cjs');
|
|
8
8
|
var chunkTZCFKZ6Z_cjs = require('./chunk-TZCFKZ6Z.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkIYK6LMQ7_cjs = require('./chunk-IYK6LMQ7.cjs');
|
|
10
10
|
var chunkVHORVGCG_cjs = require('./chunk-VHORVGCG.cjs');
|
|
11
|
-
var
|
|
11
|
+
var chunkCMEINO5I_cjs = require('./chunk-CMEINO5I.cjs');
|
|
12
12
|
var chunkHCX4SMFK_cjs = require('./chunk-HCX4SMFK.cjs');
|
|
13
13
|
|
|
14
14
|
// src/compiler/SceneIRCompiler.ts
|
|
@@ -581,7 +581,7 @@ var ALL_PRESETS = [
|
|
|
581
581
|
PHONE_SLEEVE_VR_VISUALS
|
|
582
582
|
];
|
|
583
583
|
function registerAllPresets() {
|
|
584
|
-
const registry =
|
|
584
|
+
const registry = chunkBTVHY3UB_cjs.TraitVisualRegistry.getInstance();
|
|
585
585
|
for (const presetMap of ALL_PRESETS) {
|
|
586
586
|
registry.registerBatch(presetMap);
|
|
587
587
|
}
|
|
@@ -589,10 +589,10 @@ function registerAllPresets() {
|
|
|
589
589
|
registerAllPresets();
|
|
590
590
|
|
|
591
591
|
// src/compiler/SceneIRCompiler.ts
|
|
592
|
-
|
|
592
|
+
chunkIYK6LMQ7_cjs.init_DomainBlockCompilerMixin();
|
|
593
593
|
chunkTZCFKZ6Z_cjs.init_PlatformConditionalCompilerMixin();
|
|
594
|
-
|
|
595
|
-
|
|
594
|
+
chunkCMEINO5I_cjs.init_AgentRBAC();
|
|
595
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
596
596
|
|
|
597
597
|
// src/animation/stagger.ts
|
|
598
598
|
function staggerOffsets(count, step, from = 0) {
|
|
@@ -2442,7 +2442,7 @@ var QUALITY_TIER_SCALES = {
|
|
|
2442
2442
|
var SceneIRCompiler = class {
|
|
2443
2443
|
constructor(options = {}) {
|
|
2444
2444
|
// ─── RBAC Enforcement ─────────────────────────────────────────────────
|
|
2445
|
-
this.rbac =
|
|
2445
|
+
this.rbac = chunkCMEINO5I_cjs.getRBAC();
|
|
2446
2446
|
this.compilerName = options.compilerName ?? "SceneIRCompiler";
|
|
2447
2447
|
this.qualityTier = options.qualityTier ?? "high";
|
|
2448
2448
|
this.tierScales = QUALITY_TIER_SCALES[this.qualityTier];
|
|
@@ -2474,7 +2474,7 @@ var SceneIRCompiler = class {
|
|
|
2474
2474
|
expectedWorkflowStep: "generate_assembly" /* GENERATE_ASSEMBLY */
|
|
2475
2475
|
});
|
|
2476
2476
|
if (!astDecision.allowed) {
|
|
2477
|
-
throw new
|
|
2477
|
+
throw new chunkCMEINO5I_cjs.UnauthorizedCompilerAccessError(astDecision, "AST access", this.compilerName);
|
|
2478
2478
|
}
|
|
2479
2479
|
const codeDecision = this.rbac.checkAccess({
|
|
2480
2480
|
token: agentToken,
|
|
@@ -2483,7 +2483,7 @@ var SceneIRCompiler = class {
|
|
|
2483
2483
|
expectedWorkflowStep: "generate_assembly" /* GENERATE_ASSEMBLY */
|
|
2484
2484
|
});
|
|
2485
2485
|
if (!codeDecision.allowed) {
|
|
2486
|
-
throw new
|
|
2486
|
+
throw new chunkCMEINO5I_cjs.UnauthorizedCompilerAccessError(codeDecision, "code generation", this.compilerName);
|
|
2487
2487
|
}
|
|
2488
2488
|
if (outputPath) {
|
|
2489
2489
|
const outputDecision = this.rbac.checkAccess({
|
|
@@ -2494,7 +2494,7 @@ var SceneIRCompiler = class {
|
|
|
2494
2494
|
expectedWorkflowStep: "serialize" /* SERIALIZE */
|
|
2495
2495
|
});
|
|
2496
2496
|
if (!outputDecision.allowed) {
|
|
2497
|
-
throw new
|
|
2497
|
+
throw new chunkCMEINO5I_cjs.UnauthorizedCompilerAccessError(
|
|
2498
2498
|
outputDecision,
|
|
2499
2499
|
`output write to '${outputPath}'`,
|
|
2500
2500
|
this.compilerName
|
|
@@ -2644,15 +2644,15 @@ var SceneIRCompiler = class {
|
|
|
2644
2644
|
this.injectDefaultLighting(root);
|
|
2645
2645
|
const domainBlocks = ast.domainBlocks ?? [];
|
|
2646
2646
|
if (domainBlocks.length > 0) {
|
|
2647
|
-
const compiled =
|
|
2647
|
+
const compiled = chunkIYK6LMQ7_cjs.compileDomainBlocks(
|
|
2648
2648
|
domainBlocks,
|
|
2649
2649
|
{
|
|
2650
2650
|
material: (block) => {
|
|
2651
|
-
const mat =
|
|
2651
|
+
const mat = chunkIYK6LMQ7_cjs.compileMaterialBlock(block);
|
|
2652
2652
|
return {
|
|
2653
2653
|
type: "DomainBlockOutput",
|
|
2654
2654
|
props: {
|
|
2655
|
-
__raw:
|
|
2655
|
+
__raw: chunkIYK6LMQ7_cjs.materialToR3F(mat, this.tierScales),
|
|
2656
2656
|
__domain: "material",
|
|
2657
2657
|
__name: mat.name
|
|
2658
2658
|
},
|
|
@@ -2660,11 +2660,11 @@ var SceneIRCompiler = class {
|
|
|
2660
2660
|
};
|
|
2661
2661
|
},
|
|
2662
2662
|
physics: (block) => {
|
|
2663
|
-
const phys =
|
|
2663
|
+
const phys = chunkIYK6LMQ7_cjs.compilePhysicsBlock(block);
|
|
2664
2664
|
return {
|
|
2665
2665
|
type: "DomainBlockOutput",
|
|
2666
2666
|
props: {
|
|
2667
|
-
__raw:
|
|
2667
|
+
__raw: chunkIYK6LMQ7_cjs.physicsToR3F(phys),
|
|
2668
2668
|
__domain: "physics",
|
|
2669
2669
|
__name: phys.name || phys.keyword
|
|
2670
2670
|
},
|
|
@@ -2672,11 +2672,11 @@ var SceneIRCompiler = class {
|
|
|
2672
2672
|
};
|
|
2673
2673
|
},
|
|
2674
2674
|
vfx: (block) => {
|
|
2675
|
-
const ps =
|
|
2675
|
+
const ps = chunkIYK6LMQ7_cjs.compileParticleBlock(block);
|
|
2676
2676
|
return {
|
|
2677
2677
|
type: "DomainBlockOutput",
|
|
2678
2678
|
props: {
|
|
2679
|
-
__raw:
|
|
2679
|
+
__raw: chunkIYK6LMQ7_cjs.particlesToR3F(ps, this.tierScales),
|
|
2680
2680
|
__domain: "vfx",
|
|
2681
2681
|
__name: ps.name
|
|
2682
2682
|
},
|
|
@@ -2684,11 +2684,11 @@ var SceneIRCompiler = class {
|
|
|
2684
2684
|
};
|
|
2685
2685
|
},
|
|
2686
2686
|
postfx: (block) => {
|
|
2687
|
-
const pp =
|
|
2687
|
+
const pp = chunkIYK6LMQ7_cjs.compilePostProcessingBlock(block);
|
|
2688
2688
|
return {
|
|
2689
2689
|
type: "DomainBlockOutput",
|
|
2690
2690
|
props: {
|
|
2691
|
-
__raw:
|
|
2691
|
+
__raw: chunkIYK6LMQ7_cjs.postProcessingToR3F(pp),
|
|
2692
2692
|
__domain: "postfx",
|
|
2693
2693
|
__name: pp.name || "PostProcessing"
|
|
2694
2694
|
},
|
|
@@ -2696,19 +2696,19 @@ var SceneIRCompiler = class {
|
|
|
2696
2696
|
};
|
|
2697
2697
|
},
|
|
2698
2698
|
audio: (block) => {
|
|
2699
|
-
const audio =
|
|
2699
|
+
const audio = chunkIYK6LMQ7_cjs.compileAudioSourceBlock(block);
|
|
2700
2700
|
return {
|
|
2701
2701
|
type: "DomainBlockOutput",
|
|
2702
|
-
props: { __raw:
|
|
2702
|
+
props: { __raw: chunkIYK6LMQ7_cjs.audioSourceToR3F(audio), __domain: "audio", __name: audio.name },
|
|
2703
2703
|
children: []
|
|
2704
2704
|
};
|
|
2705
2705
|
},
|
|
2706
2706
|
weather: (block) => {
|
|
2707
|
-
const weather =
|
|
2707
|
+
const weather = chunkIYK6LMQ7_cjs.compileWeatherBlock(block);
|
|
2708
2708
|
return {
|
|
2709
2709
|
type: "DomainBlockOutput",
|
|
2710
2710
|
props: {
|
|
2711
|
-
__raw:
|
|
2711
|
+
__raw: chunkIYK6LMQ7_cjs.weatherToR3F(weather),
|
|
2712
2712
|
__domain: "weather",
|
|
2713
2713
|
__name: weather.name || "Weather"
|
|
2714
2714
|
},
|
|
@@ -2716,11 +2716,11 @@ var SceneIRCompiler = class {
|
|
|
2716
2716
|
};
|
|
2717
2717
|
},
|
|
2718
2718
|
simulation: (block) => {
|
|
2719
|
-
const sim =
|
|
2719
|
+
const sim = chunkIYK6LMQ7_cjs.compileSimulationBlock(block);
|
|
2720
2720
|
return {
|
|
2721
2721
|
type: "DomainBlockOutput",
|
|
2722
2722
|
props: {
|
|
2723
|
-
__raw:
|
|
2723
|
+
__raw: chunkIYK6LMQ7_cjs.simulationToR3F(sim),
|
|
2724
2724
|
__domain: "simulation",
|
|
2725
2725
|
__name: sim.name || "Simulation"
|
|
2726
2726
|
},
|
|
@@ -2792,7 +2792,7 @@ var SceneIRCompiler = class {
|
|
|
2792
2792
|
const group = this.createNode(
|
|
2793
2793
|
"group",
|
|
2794
2794
|
{},
|
|
2795
|
-
world.name ?
|
|
2795
|
+
world.name ? chunkCMEINO5I_cjs.escapeStringValue(world.name, "JSX") : void 0
|
|
2796
2796
|
);
|
|
2797
2797
|
group.children = [...nodes, ...childNodes];
|
|
2798
2798
|
return [group];
|
|
@@ -2831,7 +2831,7 @@ var SceneIRCompiler = class {
|
|
|
2831
2831
|
* - Placement is flat (y=0); slope/terrain-conforming placement is out of scope.
|
|
2832
2832
|
*/
|
|
2833
2833
|
compileProceduralScatterNode(block) {
|
|
2834
|
-
const proc =
|
|
2834
|
+
const proc = chunkIYK6LMQ7_cjs.compileProceduralBlock(block);
|
|
2835
2835
|
const props = block.properties ?? {};
|
|
2836
2836
|
let scatterNode;
|
|
2837
2837
|
if (Array.isArray(props.nodes)) {
|
|
@@ -3061,7 +3061,7 @@ var SceneIRCompiler = class {
|
|
|
3061
3061
|
const r3fNode = sceneIRNodePool.acquire();
|
|
3062
3062
|
r3fNode.type = type;
|
|
3063
3063
|
const rawId = node.id || node.name;
|
|
3064
|
-
r3fNode.id = rawId ?
|
|
3064
|
+
r3fNode.id = rawId ? chunkCMEINO5I_cjs.escapeStringValue(rawId, "JSX") : void 0;
|
|
3065
3065
|
r3fNode.props = this.compileProperties(node, rawProps);
|
|
3066
3066
|
r3fNode.children = [];
|
|
3067
3067
|
r3fNode.traits = /* @__PURE__ */ new Map();
|
|
@@ -3100,7 +3100,7 @@ var SceneIRCompiler = class {
|
|
|
3100
3100
|
}
|
|
3101
3101
|
const root = sceneIRNodePool.acquire();
|
|
3102
3102
|
root.type = "group";
|
|
3103
|
-
root.id = composition.name ?
|
|
3103
|
+
root.id = composition.name ? chunkCMEINO5I_cjs.escapeStringValue(composition.name, "JSX") : void 0;
|
|
3104
3104
|
root.props = {};
|
|
3105
3105
|
root.children = [];
|
|
3106
3106
|
root.traits = /* @__PURE__ */ new Map();
|
|
@@ -3265,7 +3265,7 @@ var SceneIRCompiler = class {
|
|
|
3265
3265
|
}
|
|
3266
3266
|
const r3fNode = sceneIRNodePool.acquire();
|
|
3267
3267
|
r3fNode.type = type;
|
|
3268
|
-
r3fNode.id = light.name ?
|
|
3268
|
+
r3fNode.id = light.name ? chunkCMEINO5I_cjs.escapeStringValue(light.name, "JSX") : void 0;
|
|
3269
3269
|
r3fNode.props = props;
|
|
3270
3270
|
r3fNode.children = [];
|
|
3271
3271
|
r3fNode.traits = /* @__PURE__ */ new Map();
|
|
@@ -3856,7 +3856,7 @@ var SceneIRCompiler = class {
|
|
|
3856
3856
|
const traitNames = obj.traits.map(
|
|
3857
3857
|
(t) => t.name
|
|
3858
3858
|
);
|
|
3859
|
-
const compositor = new
|
|
3859
|
+
const compositor = new chunkBTVHY3UB_cjs.TraitCompositor();
|
|
3860
3860
|
const composedMaterial = compositor.compose(traitNames);
|
|
3861
3861
|
if (Object.keys(composedMaterial).length > 0) {
|
|
3862
3862
|
props.materialProps = {
|
|
@@ -4174,7 +4174,7 @@ var SceneIRCompiler = class {
|
|
|
4174
4174
|
entries.push(this.createNode("TimelineEntry", entryProps));
|
|
4175
4175
|
}
|
|
4176
4176
|
}
|
|
4177
|
-
const safeName = timeline.name ?
|
|
4177
|
+
const safeName = timeline.name ? chunkCMEINO5I_cjs.escapeStringValue(timeline.name, "JSX") : void 0;
|
|
4178
4178
|
const timelineNode = this.createNode(
|
|
4179
4179
|
"Timeline",
|
|
4180
4180
|
{ autoplay: timeline.autoplay, loop: timeline.loop },
|
|
@@ -4212,7 +4212,7 @@ var SceneIRCompiler = class {
|
|
|
4212
4212
|
}
|
|
4213
4213
|
}
|
|
4214
4214
|
const props = node.properties || {};
|
|
4215
|
-
const safeName = node.name ?
|
|
4215
|
+
const safeName = node.name ? chunkCMEINO5I_cjs.escapeStringValue(node.name, "JSX") : void 0;
|
|
4216
4216
|
const timelineNode = this.createNode(
|
|
4217
4217
|
"Timeline",
|
|
4218
4218
|
{ autoplay: props.autoplay, loop: props.loop },
|
|
@@ -4245,7 +4245,7 @@ var SceneIRCompiler = class {
|
|
|
4245
4245
|
}
|
|
4246
4246
|
}
|
|
4247
4247
|
}
|
|
4248
|
-
const safeName = audio.name ?
|
|
4248
|
+
const safeName = audio.name ? chunkCMEINO5I_cjs.escapeStringValue(audio.name, "JSX") : void 0;
|
|
4249
4249
|
return this.createNode("Audio", props, safeName);
|
|
4250
4250
|
}
|
|
4251
4251
|
compileZoneBlock(zone) {
|
|
@@ -4264,7 +4264,7 @@ var SceneIRCompiler = class {
|
|
|
4264
4264
|
})
|
|
4265
4265
|
);
|
|
4266
4266
|
}
|
|
4267
|
-
const safeName = zone.name ?
|
|
4267
|
+
const safeName = zone.name ? chunkCMEINO5I_cjs.escapeStringValue(zone.name, "JSX") : void 0;
|
|
4268
4268
|
return this.createNode("Zone", props, safeName);
|
|
4269
4269
|
}
|
|
4270
4270
|
compileUIBlock(ui) {
|
|
@@ -4281,7 +4281,7 @@ var SceneIRCompiler = class {
|
|
|
4281
4281
|
}
|
|
4282
4282
|
}
|
|
4283
4283
|
}
|
|
4284
|
-
const safeElName = el.name ?
|
|
4284
|
+
const safeElName = el.name ? chunkCMEINO5I_cjs.escapeStringValue(el.name, "JSX") : void 0;
|
|
4285
4285
|
children.push(this.createNode("UIElement", elProps, safeElName));
|
|
4286
4286
|
}
|
|
4287
4287
|
}
|
|
@@ -4296,7 +4296,7 @@ var SceneIRCompiler = class {
|
|
|
4296
4296
|
props[prop.key] = prop.value;
|
|
4297
4297
|
}
|
|
4298
4298
|
}
|
|
4299
|
-
const safeName = transition.name ?
|
|
4299
|
+
const safeName = transition.name ? chunkCMEINO5I_cjs.escapeStringValue(transition.name, "JSX") : void 0;
|
|
4300
4300
|
return this.createNode("Transition", props, safeName);
|
|
4301
4301
|
}
|
|
4302
4302
|
compileConditionalBlock(cond, templateMap) {
|
|
@@ -4720,5 +4720,5 @@ exports.QUALITY_TIER_SCALES = QUALITY_TIER_SCALES;
|
|
|
4720
4720
|
exports.SceneIRCompiler = SceneIRCompiler;
|
|
4721
4721
|
exports.UI_COMPONENT_PRESETS = UI_COMPONENT_PRESETS;
|
|
4722
4722
|
exports.registerAllPresets = registerAllPresets;
|
|
4723
|
-
//# sourceMappingURL=chunk-
|
|
4724
|
-
//# sourceMappingURL=chunk-
|
|
4723
|
+
//# sourceMappingURL=chunk-F47FEV4X.cjs.map
|
|
4724
|
+
//# sourceMappingURL=chunk-F47FEV4X.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk3VBO3IYQ_cjs = require('./chunk-3VBO3IYQ.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkILO2KMER_cjs = require('./chunk-ILO2KMER.cjs');
|
|
5
5
|
|
|
6
6
|
// src/parser/TypoDetector.ts
|
|
7
7
|
var TypoDetector = class {
|
|
@@ -1088,7 +1088,7 @@ var _HoloCompositionParser = class _HoloCompositionParser {
|
|
|
1088
1088
|
strict: false,
|
|
1089
1089
|
...options
|
|
1090
1090
|
};
|
|
1091
|
-
this.errorRecovery = new
|
|
1091
|
+
this.errorRecovery = new chunkILO2KMER_cjs.ErrorRecovery(this.options.knownTraits);
|
|
1092
1092
|
}
|
|
1093
1093
|
/**
|
|
1094
1094
|
* The error-recovery engine for this parser, seeded with the injected
|
|
@@ -7883,5 +7883,5 @@ exports.PRIMITIVE_SHAPES = PRIMITIVE_SHAPES;
|
|
|
7883
7883
|
exports.parseHolo = parseHolo;
|
|
7884
7884
|
exports.parseHoloPartial = parseHoloPartial;
|
|
7885
7885
|
exports.parseHoloStrict = parseHoloStrict;
|
|
7886
|
-
//# sourceMappingURL=chunk-
|
|
7887
|
-
//# sourceMappingURL=chunk-
|
|
7886
|
+
//# sourceMappingURL=chunk-FCGTI7FO.cjs.map
|
|
7887
|
+
//# sourceMappingURL=chunk-FCGTI7FO.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCMEINO5I_cjs = require('./chunk-CMEINO5I.cjs');
|
|
4
4
|
var chunkZHPMP447_cjs = require('./chunk-ZHPMP447.cjs');
|
|
5
5
|
var ans = require('@holoscript/core-types/ans');
|
|
6
6
|
|
|
@@ -14,8 +14,8 @@ chunkZHPMP447_cjs.__export(DTDLCompiler_exports, {
|
|
|
14
14
|
exports.DTDLCompiler = void 0; exports.DTDL_TRAIT_COMPONENTS = void 0; exports.DTDLCompiler_default = void 0;
|
|
15
15
|
var init_DTDLCompiler = chunkZHPMP447_cjs.__esm({
|
|
16
16
|
"src/compiler/DTDLCompiler.ts"() {
|
|
17
|
-
|
|
18
|
-
exports.DTDLCompiler = class extends
|
|
17
|
+
chunkCMEINO5I_cjs.init_CompilerBase();
|
|
18
|
+
exports.DTDLCompiler = class extends chunkCMEINO5I_cjs.CompilerBase {
|
|
19
19
|
constructor(options = {}) {
|
|
20
20
|
super();
|
|
21
21
|
this.compilerName = "DTDLCompiler";
|
|
@@ -420,5 +420,5 @@ var init_DTDLCompiler = chunkZHPMP447_cjs.__esm({
|
|
|
420
420
|
|
|
421
421
|
exports.DTDLCompiler_exports = DTDLCompiler_exports;
|
|
422
422
|
exports.init_DTDLCompiler = init_DTDLCompiler;
|
|
423
|
-
//# sourceMappingURL=chunk-
|
|
424
|
-
//# sourceMappingURL=chunk-
|
|
423
|
+
//# sourceMappingURL=chunk-FGTXAVKG.cjs.map
|
|
424
|
+
//# sourceMappingURL=chunk-FGTXAVKG.cjs.map
|