@holoscript/core 8.0.11 → 8.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{HoloCompositionParser-3XEC7IJC.cjs → HoloCompositionParser-6GW2BZID.cjs} +3 -3
  2. package/dist/{HoloCompositionParser-FLBZKFD3.js → HoloCompositionParser-P4Y3CXKQ.js} +3 -3
  3. package/dist/{HoloScriptPlusParser-55AY4MUF.js → HoloScriptPlusParser-HQV6IJAH.js} +4 -4
  4. package/dist/{HoloScriptPlusParser-RNUCHOAJ.cjs → HoloScriptPlusParser-RFNHRMPE.cjs} +7 -7
  5. package/dist/{chunk-4VVHNBCO.js → chunk-A4OOLBZD.js} +112 -55
  6. package/dist/{chunk-TYNRXRHF.js → chunk-DJ5BNRIS.js} +30 -9
  7. package/dist/{chunk-P534AGP5.cjs → chunk-DVHZD5HV.cjs} +5 -5
  8. package/dist/{chunk-7NPZZZD7.js → chunk-FRSKLX6I.js} +8 -4
  9. package/dist/{chunk-JBYBMBMW.js → chunk-FWKEY4LD.js} +3 -2
  10. package/dist/{chunk-USOUXQYD.js → chunk-G6EKZHXY.js} +129 -21
  11. package/dist/{chunk-2TAN7H54.js → chunk-G72754QB.js} +3 -3
  12. package/dist/{chunk-OMNHTCS4.cjs → chunk-LHUDAJQT.cjs} +3 -2
  13. package/dist/{chunk-KEYG7HGY.js → chunk-ONPVM4IV.js} +163 -3
  14. package/dist/{chunk-RMOEL2GD.cjs → chunk-PXVAPGTR.cjs} +31 -10
  15. package/dist/{chunk-656IAS7B.cjs → chunk-Q4K2GEMW.cjs} +10 -6
  16. package/dist/{chunk-VO52AJD5.js → chunk-RVNXBF2M.js} +3 -3
  17. package/dist/{chunk-7N63JHUN.cjs → chunk-RZ2EPXO3.cjs} +3 -3
  18. package/dist/{chunk-UDGTX7LY.cjs → chunk-SQAAWO4V.cjs} +112 -55
  19. package/dist/{chunk-W2GA3EQB.cjs → chunk-TC7JEO6R.cjs} +163 -3
  20. package/dist/{chunk-TX6ZBIF4.js → chunk-U3D4SYQ5.js} +3 -3
  21. package/dist/{chunk-EI5G5JLY.cjs → chunk-XF63CZ7E.cjs} +133 -21
  22. package/dist/{chunk-3KMANSQJ.cjs → chunk-Y57AVOM2.cjs} +4 -4
  23. package/dist/cli/holoscript-runner.cjs +9 -9
  24. package/dist/cli/holoscript-runner.js +2 -2
  25. package/dist/compiler/incremental.cjs +6 -6
  26. package/dist/compiler/incremental.js +1 -1
  27. package/dist/compiler/index.cjs +84 -84
  28. package/dist/compiler/index.js +5 -5
  29. package/dist/compiler/webgpu.cjs +3 -3
  30. package/dist/compiler/webgpu.js +2 -2
  31. package/dist/constants.cjs +3 -3
  32. package/dist/constants.js +1 -1
  33. package/dist/entries/scripting.cjs +1 -1
  34. package/dist/entries/scripting.js +1 -1
  35. package/dist/evolution/index.cjs +19 -15
  36. package/dist/evolution/index.d.ts +9 -0
  37. package/dist/evolution/index.js +4 -4
  38. package/dist/index.cjs +196 -180
  39. package/dist/index.js +15 -15
  40. package/dist/parser.cjs +13 -13
  41. package/dist/parser.js +3 -3
  42. package/dist/reconstruction/index.cjs +38 -38
  43. package/dist/reconstruction/index.js +2 -2
  44. package/dist/traits/index.cjs +4 -4
  45. package/dist/traits/index.js +1 -1
  46. package/package.json +20 -40
@@ -1,5 +1,5 @@
1
1
  import { parseHolo } from './chunk-FHVPN7BN.js';
2
- import { parse } from './chunk-7NPZZZD7.js';
2
+ import { parse } from './chunk-FRSKLX6I.js';
3
3
 
4
4
  // src/evolution/EvolveProgramBackend.ts
5
5
  async function sha256Hex(s) {
@@ -7,6 +7,24 @@ async function sha256Hex(s) {
7
7
  const digest = await globalThis.crypto.subtle.digest("SHA-256", bytes);
8
8
  return Array.from(new Uint8Array(digest)).map((b) => b.toString(16).padStart(2, "0")).join("");
9
9
  }
10
+ function buildProposerPrompt(parentCode, goal) {
11
+ return `You are improving a program toward a goal. GOAL: ${goal}
12
+
13
+ Return ONLY the full revised program - no prose, no explanation, no markdown code fences.
14
+
15
+ --- CURRENT PROGRAM ---
16
+ ${parentCode}
17
+ --- END ---`;
18
+ }
19
+ function stripMarkdownFences(text) {
20
+ return text.trim().replace(/^```[a-z]*\n?/i, "").replace(/\n?```$/i, "").trim();
21
+ }
22
+ function openAICompatibleChatUrl(endpoint) {
23
+ const base = endpoint.replace(/\/+$/, "");
24
+ if (/\/chat\/completions$/i.test(base)) return base;
25
+ if (/\/v1$/i.test(base)) return `${base}/chat/completions`;
26
+ return `${base}/v1/chat/completions`;
27
+ }
10
28
  async function runEvolution(seedCode, policy, io) {
11
29
  const now = io.now ?? (() => (/* @__PURE__ */ new Date()).toISOString());
12
30
  const trace = [];
@@ -130,13 +148,7 @@ async function runEvolution(seedCode, policy, io) {
130
148
  function makeOllamaProposer(endpoint, model) {
131
149
  const base = endpoint.replace(/\/+$/, "");
132
150
  return async (parentCode, goal) => {
133
- const prompt = `You are improving a program toward a goal. GOAL: ${goal}
134
-
135
- Return ONLY the full revised program \u2014 no prose, no explanation, no markdown code fences.
136
-
137
- --- CURRENT PROGRAM ---
138
- ${parentCode}
139
- --- END ---`;
151
+ const prompt = buildProposerPrompt(parentCode, goal);
140
152
  const res = await fetch(`${base}/api/generate`, {
141
153
  method: "POST",
142
154
  headers: { "content-type": "application/json" },
@@ -144,7 +156,44 @@ ${parentCode}
144
156
  });
145
157
  if (!res.ok) throw new Error(`ollama ${res.status}`);
146
158
  const body = await res.json();
147
- return (body.response ?? "").trim().replace(/^```[a-z]*\n?/i, "").replace(/\n?```$/i, "").trim();
159
+ return stripMarkdownFences(body.response ?? "");
160
+ };
161
+ }
162
+ function makeOpenAICompatibleProposer(endpoint, model, opts = {}) {
163
+ const fetchImpl = opts.fetchImpl ?? fetch;
164
+ const temperature = opts.temperature ?? 0.7;
165
+ return async (parentCode, goal) => {
166
+ const headers = { "content-type": "application/json" };
167
+ if (opts.apiKey) headers.authorization = `Bearer ${opts.apiKey}`;
168
+ const res = await fetchImpl(openAICompatibleChatUrl(endpoint), {
169
+ method: "POST",
170
+ headers,
171
+ body: JSON.stringify({
172
+ model,
173
+ stream: false,
174
+ temperature,
175
+ ...opts.maxTokens == null ? {} : { max_tokens: opts.maxTokens },
176
+ messages: [
177
+ {
178
+ role: "system",
179
+ content: "You are a HoloScript program-evolution proposer. Return only the full revised program."
180
+ },
181
+ { role: "user", content: buildProposerPrompt(parentCode, goal) }
182
+ ]
183
+ })
184
+ });
185
+ const raw = await res.text();
186
+ if (!res.ok) throw new Error(`openai-compatible ${res.status}: ${raw.slice(0, 160)}`);
187
+ let body;
188
+ try {
189
+ body = JSON.parse(raw);
190
+ } catch {
191
+ throw new Error("openai-compatible invalid JSON response");
192
+ }
193
+ const content = body.choices?.[0]?.message?.content ?? body.choices?.[0]?.text ?? "";
194
+ const code = stripMarkdownFences(content);
195
+ if (!code) throw new Error("openai-compatible empty response");
196
+ return code;
148
197
  };
149
198
  }
150
199
  function toGradedTraceRow(rec, opts) {
@@ -208,7 +257,8 @@ var CORPUS_PORTFOLIO = [
208
257
  " }",
209
258
  "}"
210
259
  ].join("\n"),
211
- preserved: [/PatrolBot/, /\bidle\b/, /\bchasing\b/]
260
+ preserved: [/PatrolBot/, /\bidle\b/, /\bchasing\b/],
261
+ semanticCheck: stateMachineSemanticCheck
212
262
  },
213
263
  {
214
264
  name: "mini-scene",
@@ -282,7 +332,8 @@ var CORPUS_PORTFOLIO = [
282
332
  " }",
283
333
  "}"
284
334
  ].join("\n"),
285
- preserved: [/SmartDoor/, /\bclosed\b/, /\bopening\b/, /\bopen\b/]
335
+ preserved: [/SmartDoor/, /\bclosed\b/, /\bopening\b/, /\bopen\b/],
336
+ semanticCheck: stateMachineSemanticCheck
286
337
  },
287
338
  {
288
339
  name: "trafficlight-statemachine",
@@ -301,7 +352,8 @@ var CORPUS_PORTFOLIO = [
301
352
  " }",
302
353
  "}"
303
354
  ].join("\n"),
304
- preserved: [/TrafficLight/, /\bred\b/, /\bgreen\b/, /\byellow\b/]
355
+ preserved: [/TrafficLight/, /\bred\b/, /\bgreen\b/, /\byellow\b/],
356
+ semanticCheck: stateMachineSemanticCheck
305
357
  },
306
358
  {
307
359
  name: "room-scene",
@@ -349,17 +401,73 @@ function parsesClean(src, format) {
349
401
  return false;
350
402
  }
351
403
  }
404
+ function findStateMachineConfig(node) {
405
+ if (!node || typeof node !== "object") return null;
406
+ const obj = node;
407
+ if (obj.name === "state_machine" && obj.config && typeof obj.config === "object") {
408
+ const cfg = obj.config;
409
+ if (cfg.states && typeof cfg.states === "object") return cfg;
410
+ }
411
+ for (const v of Object.values(obj)) {
412
+ if (Array.isArray(v)) {
413
+ for (const e of v) {
414
+ const f = findStateMachineConfig(e);
415
+ if (f) return f;
416
+ }
417
+ } else if (v && typeof v === "object") {
418
+ const f = findStateMachineConfig(v);
419
+ if (f) return f;
420
+ }
421
+ }
422
+ return null;
423
+ }
424
+ function extractStateMachine(ast) {
425
+ const cfg = findStateMachineConfig(ast);
426
+ if (!cfg) return null;
427
+ const statesObj = cfg.states;
428
+ const states = Object.keys(statesObj);
429
+ const transitions = [];
430
+ for (const from of states) {
431
+ const events = statesObj[from];
432
+ if (!events || typeof events !== "object") continue;
433
+ for (const event of Object.keys(events)) {
434
+ const t = events[event];
435
+ if (t && typeof t.target === "string") transitions.push({ from, event, target: t.target });
436
+ }
437
+ }
438
+ return { states, initial: typeof cfg.initial === "string" ? cfg.initial : "", transitions };
439
+ }
440
+ function stateMachineWellFormed(ast) {
441
+ const sm = extractStateMachine(ast);
442
+ if (!sm) return false;
443
+ const defined = new Set(sm.states);
444
+ return defined.has(sm.initial) && sm.transitions.every((t) => defined.has(t.target));
445
+ }
446
+ function stateMachineSemanticCheck(_candidate, ast) {
447
+ const sm = extractStateMachine(ast);
448
+ if (!sm) return { ok: false, reason: "no_state_machine" };
449
+ const defined = new Set(sm.states);
450
+ if (!defined.has(sm.initial)) return { ok: false, reason: `initial_undefined:${sm.initial}` };
451
+ const dangling = sm.transitions.filter((t) => !defined.has(t.target));
452
+ if (dangling.length) {
453
+ return { ok: false, reason: `dangling_transition:${dangling.map((d) => `${d.from}-${d.event}->${d.target}`).join(",")}` };
454
+ }
455
+ return { ok: true };
456
+ }
352
457
  function makeSeedGate(seed) {
353
- return async (candidate) => ({
354
- passed: parsesClean(candidate, seed.format) && seed.preserved.every((re) => re.test(candidate)),
355
- score: candidate.length
356
- });
458
+ return async (candidate) => {
459
+ const r = seed.format === "holo" ? parseHolo(candidate) : parse(candidate);
460
+ const clean = Boolean(r.success && r.ast) && (r.errors?.length ?? 0) === 0;
461
+ const preservedOk = clean && seed.preserved.every((re) => re.test(candidate));
462
+ const passed = preservedOk && (!seed.semanticCheck || seed.semanticCheck(candidate, r.ast).ok);
463
+ return { passed, score: candidate.length };
464
+ };
357
465
  }
358
466
  async function accrueOneStep(opts) {
359
467
  const seed = opts.seed ?? CORPUS_PORTFOLIO[(opts.tick ?? 0) % CORPUS_PORTFOLIO.length];
360
468
  const now = opts.now ?? (() => (/* @__PURE__ */ new Date()).toISOString());
361
469
  const rows = [];
362
- await runEvolution(
470
+ const { receipt } = await runEvolution(
363
471
  seed.source,
364
472
  { goal: seed.goal, generations: 1, population: 1, archiveSize: 4, proposerModel: "sovereign-local" },
365
473
  {
@@ -368,7 +476,7 @@ async function accrueOneStep(opts) {
368
476
  onCandidate: (rec) => rows.push(toGradedTraceRow(rec, { agentId: opts.agentId, ts: now(), source: `evolve-corpus:${seed.name}` }))
369
477
  }
370
478
  );
371
- return { target: seed.name, rows };
479
+ return { target: seed.name, rows, receipt };
372
480
  }
373
481
  function dedupRows(existingCorpus, rows) {
374
482
  const seen = /* @__PURE__ */ new Set();
@@ -485,6 +593,6 @@ function makeWasmCompilerFitnessGate(compileCandidate, opts = {}) {
485
593
  };
486
594
  }
487
595
 
488
- export { CORPUS_PORTFOLIO, accrueOneStep, dedupRows, makeOllamaProposer, makeSeedGate, makeWasmCompilerFitnessGate, parsesClean, runEvolution, scoreWasmCompilerArtifact, toGradedTraceRow, wasmFitnessBaselineFromScenario };
489
- //# sourceMappingURL=chunk-USOUXQYD.js.map
490
- //# sourceMappingURL=chunk-USOUXQYD.js.map
596
+ export { CORPUS_PORTFOLIO, accrueOneStep, dedupRows, extractStateMachine, makeOllamaProposer, makeOpenAICompatibleProposer, makeSeedGate, makeWasmCompilerFitnessGate, parsesClean, runEvolution, scoreWasmCompilerArtifact, stateMachineSemanticCheck, stateMachineWellFormed, toGradedTraceRow, wasmFitnessBaselineFromScenario };
597
+ //# sourceMappingURL=chunk-G6EKZHXY.js.map
598
+ //# sourceMappingURL=chunk-G6EKZHXY.js.map
@@ -1,4 +1,4 @@
1
- import { createHoloMapRuntime, HOLOMAP_DEFAULTS } from './chunk-4VVHNBCO.js';
1
+ import { createHoloMapRuntime, HOLOMAP_DEFAULTS } from './chunk-A4OOLBZD.js';
2
2
 
3
3
  // src/reconstruction/FusedAttentionKernel.ts
4
4
  var FUSED_ATTENTION_WGSL = `
@@ -621,5 +621,5 @@ async function replayMobileSensorBundle(bundle, config = {}) {
621
621
  }
622
622
 
623
623
  export { ANCHOR_DEFAULTS, ARCORE_DEPTH_RECOMMENDED_RANGE_MILLIMETERS, HOLOMAP_MOBILE_SENSOR_BUNDLE_VERSION, TRAJECTORY_DEFAULTS, arCoreDepthFrameToMobileSensorFrame, cameraPoseFromColumnMajorTransform, createAnchorContext, createArCoreDepthMobileSensorBundle, createFusedAttentionBackend, createTrajectoryMemory, mobileSensorBundleToFrames, replayMobileSensorBundle, validateMobileSensorBundle };
624
- //# sourceMappingURL=chunk-2TAN7H54.js.map
625
- //# sourceMappingURL=chunk-2TAN7H54.js.map
624
+ //# sourceMappingURL=chunk-G72754QB.js.map
625
+ //# sourceMappingURL=chunk-G72754QB.js.map
@@ -74,6 +74,7 @@ var LIFECYCLE_HOOKS = [
74
74
  "on_update",
75
75
  "on_data_update",
76
76
  "on_tick",
77
+ "on_spawn",
77
78
  "on_activate",
78
79
  "on_deactivate",
79
80
  "on_detected",
@@ -260,5 +261,5 @@ var LIFECYCLE_HOOKS = [
260
261
 
261
262
  exports.LIFECYCLE_HOOKS = LIFECYCLE_HOOKS;
262
263
  exports.STRUCTURAL_DIRECTIVES = STRUCTURAL_DIRECTIVES;
263
- //# sourceMappingURL=chunk-OMNHTCS4.cjs.map
264
- //# sourceMappingURL=chunk-OMNHTCS4.cjs.map
264
+ //# sourceMappingURL=chunk-LHUDAJQT.cjs.map
265
+ //# sourceMappingURL=chunk-LHUDAJQT.cjs.map
@@ -54,8 +54,10 @@ var init_WebGPUCompiler = __esm({
54
54
  this.emitDeviceInit();
55
55
  this.emitGeometryHelpers();
56
56
  this.emitShaderSources();
57
- if (composition.environment) this.emitEnvironment(composition.environment);
57
+ this.emitEnvironment(composition.environment ?? { type: "Environment", properties: [] });
58
58
  this.emitCamera(composition.camera);
59
+ this.emit("const holoGraphObjects = [];");
60
+ this.emit("");
59
61
  if (composition.objects) {
60
62
  for (const obj of composition.objects) this.emitObject(obj);
61
63
  }
@@ -67,6 +69,7 @@ var init_WebGPUCompiler = __esm({
67
69
  }
68
70
  if (this.options.enableCompute) this.emitComputeShaders(composition);
69
71
  this.emitWebGPUDomainBlocks(composition);
72
+ this.emitViewportRuntime();
70
73
  this.emitRenderLoop(composition);
71
74
  return this.lines.join("\n");
72
75
  }
@@ -495,6 +498,9 @@ var init_WebGPUCompiler = __esm({
495
498
  this.emit(
496
499
  `const ${v}Mat = createBuffer(device, new Float32Array([${cr},${cg},${cb},1.0, ${rough},${metal},${emissiveStrength},0, ${er},${eg},${eb},0]), GPUBufferUsage.UNIFORM);`
497
500
  );
501
+ this.emit(
502
+ `holoGraphObjects.push({ id: "${this.escapeStringValue(obj.name, "TypeScript")}", name: "${this.escapeStringValue(obj.name, "TypeScript")}", geometry: "${this.escapeStringValue(meshType, "TypeScript")}", traits: ${this.json((obj.traits || []).map((t) => t.name))}, properties: ${this.json(this.extractObjectProperties(obj))}, basePosition: [${px},${py},${pz}], position: [${px},${py},${pz}], baseScale: [${sx},${sy},${sz}], scale: [${sx},${sy},${sz}], baseColor: [${cr},${cg},${cb}], color: [${cr},${cg},${cb}], material: { roughness: ${rough}, metalness: ${metal}, emissiveStrength: ${emissiveStrength}, emissive: [${er},${eg},${eb}] }, modelBuffer: ${v}Model, matBuffer: ${v}Mat, visible: true });`
503
+ );
498
504
  this.emit(`const ${v}Pipeline = device.createRenderPipeline({`);
499
505
  this.indent();
500
506
  this.emit('layout: "auto",');
@@ -855,6 +861,145 @@ var init_WebGPUCompiler = __esm({
855
861
  this.emit("");
856
862
  }
857
863
  // ─── Render Loop ──────────────────────────────────────────────────────────
864
+ emitViewportRuntime() {
865
+ this.emit("// === HoloGraph Viewport Runtime ===");
866
+ this.emit("const holoGraphInitialCameraPos = new Float32Array(cameraPos);");
867
+ this.emit("const holoGraphInitialCameraTarget = new Float32Array(cameraTarget);");
868
+ this.emit(
869
+ 'const holoGraphViewportState = { actionCount: 0, lastAction: null, filter: "all", colorMode: "semantic", structureStyle: "flow", labelPolicy: "none", focusId: null };'
870
+ );
871
+ this.emit('document.body.style.position = document.body.style.position || "relative";');
872
+ this.emit('const holoGraphLabelLayer = document.createElement("div");');
873
+ this.emit('holoGraphLabelLayer.setAttribute("data-holograph-label-layer", "true");');
874
+ this.emit('Object.assign(holoGraphLabelLayer.style, { position: "absolute", inset: "0", pointerEvents: "none", overflow: "hidden", fontFamily: "ui-monospace, SFMono-Regular, Consolas, monospace", zIndex: "5" });');
875
+ this.emit('canvas.insertAdjacentElement("afterend", holoGraphLabelLayer);');
876
+ this.emit("function hsVec3(v) { return [Number(v[0] || 0), Number(v[1] || 0), Number(v[2] || 0)]; }");
877
+ this.emit("function hsSub(a, b) { return [a[0] - b[0], a[1] - b[1], a[2] - b[2]]; }");
878
+ this.emit("function hsAdd(a, b) { return [a[0] + b[0], a[1] + b[1], a[2] + b[2]]; }");
879
+ this.emit("function hsMul(v, s) { return [v[0] * s, v[1] * s, v[2] * s]; }");
880
+ this.emit("function hsLen(v) { return Math.hypot(v[0], v[1], v[2]) || 1; }");
881
+ this.emit("function hsNorm(v) { const l = hsLen(v); return [v[0] / l, v[1] / l, v[2] / l]; }");
882
+ this.emit(
883
+ "function hsCross(a, b) { return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]; }"
884
+ );
885
+ this.emit(
886
+ 'function hsHash(text) { let h = 2166136261; const s = String(text || ""); for (let i = 0; i < s.length; i++) { h ^= s.charCodeAt(i); h = Math.imul(h, 16777619); } return h >>> 0; }'
887
+ );
888
+ this.emit(
889
+ "function hsHueRgb(h) { const x = (n) => { const k = (n + h * 6) % 6; return Math.max(0, Math.min(1, Math.min(k, 4 - k, 1))); }; return [x(5), x(3), x(1)]; }"
890
+ );
891
+ this.emit(
892
+ "function hsGraphCenter() { if (!holoGraphObjects.length) return [0, 0, 0]; const sum = holoGraphObjects.reduce((acc, o) => [acc[0] + o.basePosition[0], acc[1] + o.basePosition[1], acc[2] + o.basePosition[2]], [0, 0, 0]); return hsMul(sum, 1 / holoGraphObjects.length); }"
893
+ );
894
+ this.emit(
895
+ "function hsWriteModel(o) { const s = o.visible ? o.scale : [0, 0, 0]; device.queue.writeBuffer(o.modelBuffer, 0, new Float32Array([s[0],0,0,0, 0,s[1],0,0, 0,0,s[2],0, o.position[0],o.position[1],o.position[2],1])); }"
896
+ );
897
+ this.emit(
898
+ "function hsWriteMaterial(o, color) { o.color = [color[0], color[1], color[2]]; const m = o.material; device.queue.writeBuffer(o.matBuffer, 0, new Float32Array([color[0],color[1],color[2],1.0, m.roughness,m.metalness,m.emissiveStrength,0, m.emissive[0],m.emissive[1],m.emissive[2],0])); }"
899
+ );
900
+ this.emit("function hsCameraDistance() { return hsLen(hsSub(hsVec3(cameraTarget), hsVec3(cameraPos))); }");
901
+ this.emit(
902
+ "function hsSetCamera(pos, target) { cameraPos.set(pos); cameraTarget.set(target); device.queue.writeBuffer(vpUniform, 0, buildViewProjection()); document.body.dataset.holoscriptWebgpuCamera = JSON.stringify({ position: Array.from(cameraPos), target: Array.from(cameraTarget) }); }"
903
+ );
904
+ this.emit(
905
+ "function hsCameraBasis() { const forward = hsNorm(hsSub(hsVec3(cameraTarget), hsVec3(cameraPos))); const worldUp = [0, 1, 0]; const right = hsNorm(hsCross(forward, worldUp)); const up = hsNorm(hsCross(right, forward)); return { forward, right, up }; }"
906
+ );
907
+ this.emit(
908
+ 'function hsMatchesFilter(o, filter) { const rawKind = o.properties.symbolType || o.properties.symbol_type || o.properties.kind || o.properties.role || o.properties.type || ""; const symbolType = String(rawKind).toLowerCase(); const traits = (o.traits || []).map((t) => String(t).toLowerCase()); if (filter === "all") return true; if (filter === "call") return symbolType === "function" || symbolType === "method" || symbolType === "call" || traits.includes("function") || traits.includes("method") || traits.includes("call"); if (filter === "import") return symbolType === "module" || symbolType === "namespace" || symbolType === "package" || symbolType === "import" || traits.includes("module") || traits.includes("namespace") || traits.includes("package") || traits.includes("import"); return true; }'
909
+ );
910
+ this.emit(
911
+ 'function hsColorForMode(o, mode) { if (mode === "identity_hue") return hsHueRgb((hsHash(o.id) % 10000) / 10000); if (mode === "file_hue") return hsHueRgb((hsHash(o.properties.file || o.properties.path || o.id) % 10000) / 10000); if (mode === "relation_hue") return hsHueRgb((hsHash(o.properties.symbolType || o.properties.symbol_type || o.properties.kind || o.properties.role || (o.traits || []).join(",")) % 10000) / 10000); return o.baseColor; }'
912
+ );
913
+ this.emit("function hsRound(n) { return Math.round(Number(n || 0) * 1000) / 1000; }");
914
+ this.emit("function hsRoundVec(v) { return [hsRound(v?.[0]), hsRound(v?.[1]), hsRound(v?.[2])]; }");
915
+ this.emit(
916
+ 'function hsHueBucket(o, mode = holoGraphViewportState.colorMode) { if (mode === "identity_hue") return hsHash(o.id) % 10000; if (mode === "file_hue") return hsHash(o.properties.file || o.properties.path || o.id) % 10000; if (mode === "relation_hue") return hsHash(o.properties.symbolType || o.properties.symbol_type || o.properties.kind || o.properties.role || (o.traits || []).join(",")) % 10000; return hsHash(JSON.stringify(o.color || o.baseColor || [])) % 10000; }'
917
+ );
918
+ this.emit(
919
+ 'function hsObjectRole(o) { return String(o.properties.symbolType || o.properties.symbol_type || o.properties.kind || o.properties.role || o.properties.type || (o.traits || [])[0] || "object"); }'
920
+ );
921
+ this.emit(
922
+ 'function hsCounts(items, keyFn, limit = 12) { const m = new Map(); for (const item of items) { const key = String(keyFn(item) || "unknown"); m.set(key, (m.get(key) || 0) + 1); } return Array.from(m.entries()).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0])).slice(0, limit).map(([key, count]) => ({ key, count })); }'
923
+ );
924
+ this.emit(
925
+ 'function hsCompactObject(o, index) { return { index, id: o.id, name: o.name, geometry: o.geometry || "mesh", shape: o.geometry || "mesh", role: hsObjectRole(o), traits: o.traits || [], file: o.properties.file || null, path: o.properties.path || null, signature: o.properties.signature || null, language: o.properties.language || null, position: hsRoundVec(o.position), scale: hsRoundVec(o.scale), color: hsRoundVec(o.color || o.baseColor), hueBucket: hsHueBucket(o), visible: o.visible, projection: hsProjectPoint(o.position) }; }'
926
+ );
927
+ this.emit(
928
+ 'function hsResolveObject(payload = {}) { const key = payload && (payload.nodeId ?? payload.id ?? payload.target ?? payload.anchorId ?? payload.name); let obj = null; if (typeof payload?.anchorIndex === "number") obj = holoGraphObjects[payload.anchorIndex] || null; if (!obj && typeof key === "number") obj = holoGraphObjects[key] || null; if (!obj && key !== undefined && key !== null) obj = holoGraphObjects.find((o) => o.id === String(key) || o.name === String(key)); if (!obj) obj = holoGraphObjects.find((o) => o.visible) || holoGraphObjects[0] || null; return obj; }'
929
+ );
930
+ this.emit(
931
+ "function hsNearestObjects(obj, limit = 8) { if (!obj) return []; return holoGraphObjects.filter((o) => o.visible && o !== obj).map((o) => ({ object: o, distance: hsLen(hsSub(o.position, obj.position)) })).sort((a, b) => a.distance - b.distance).slice(0, Math.max(0, Math.min(32, Number(limit) || 8))).map((entry) => ({ ...hsCompactObject(entry.object, holoGraphObjects.indexOf(entry.object)), distance: hsRound(entry.distance) })); }"
932
+ );
933
+ this.emit(
934
+ 'function hsDescribeScene(payload = {}) { const limit = Math.max(1, Math.min(128, Number(payload.limit || 24))); const visible = holoGraphObjects.filter((o) => o.visible); return { canonicalNames: { graphSurface: "HoloGraph", embeddingTower: "HoloEmbed", visionNavigator: "HoloLlama" }, actionContract: ["pan_left","pan_right","pan_up","pan_down","zoom_in","zoom_out","zoom_to_fit","focus_anchor","focus_node","filter_call","filter_import","filter_all","set_color_mode","set_structure_style","set_label_policy","reset_view"], projectionBridge: "renderer-native", canvas: { width: canvas.width, height: canvas.height, clientWidth: canvas.clientWidth, clientHeight: canvas.clientHeight }, camera: { position: hsRoundVec(cameraPos), target: hsRoundVec(cameraTarget), distance: hsRound(hsCameraDistance()) }, actionCount: holoGraphViewportState.actionCount, lastAction: holoGraphViewportState.lastAction, filter: holoGraphViewportState.filter, colorMode: holoGraphViewportState.colorMode, structureStyle: holoGraphViewportState.structureStyle, labelPolicy: holoGraphViewportState.labelPolicy, objectCount: holoGraphObjects.length, visibleObjects: visible.length, shapes: hsCounts(visible, (o) => o.geometry || "mesh"), roles: hsCounts(visible, hsObjectRole), hueBuckets: hsCounts(visible, (o) => `hue_${hsHueBucket(o)}`, 16), files: hsCounts(visible, (o) => o.properties.file || o.properties.path || "unknown", 16), objects: visible.slice(0, limit).map((o) => hsCompactObject(o, holoGraphObjects.indexOf(o))) }; }'
935
+ );
936
+ this.emit(
937
+ "function hsProjectObject(payload = {}) { const obj = hsResolveObject(payload); if (!obj) return null; return { ...hsCompactObject(obj, holoGraphObjects.indexOf(obj)), cameraDistance: hsRound(hsLen(hsSub(hsVec3(cameraPos), obj.position))) }; }"
938
+ );
939
+ this.emit(
940
+ "function hsInspectObject(payload = {}) { const obj = hsResolveObject(payload); if (!obj) return null; return { ...hsProjectObject(payload), properties: obj.properties, neighbors: hsNearestObjects(obj, payload.limit || 8) }; }"
941
+ );
942
+ this.emit('function hsNormalizeLabelPolicy(value) { const policy = String(value || "none").toLowerCase(); return ["none","ids","signatures","details"].includes(policy) ? policy : "none"; }');
943
+ this.emit(
944
+ 'function hsLabelText(o) { const policy = holoGraphViewportState.labelPolicy; if (policy === "none") return ""; if (policy === "ids") return o.id; if (policy === "signatures") return o.properties.signature || o.id; return `${hsObjectRole(o)}:${o.properties.signature || o.id}`; }'
945
+ );
946
+ this.emit(
947
+ 'function hsProjectPoint(p) { const m = buildViewProjection(); const x = Number(p?.[0] || 0), y = Number(p?.[1] || 0), z = Number(p?.[2] || 0); const cx = m[0]*x + m[4]*y + m[8]*z + m[12]; const cy = m[1]*x + m[5]*y + m[9]*z + m[13]; const cz = m[2]*x + m[6]*y + m[10]*z + m[14]; const cw = m[3]*x + m[7]*y + m[11]*z + m[15]; const clip = { x: hsRound(cx), y: hsRound(cy), z: hsRound(cz), w: hsRound(cw) }; if (!Number.isFinite(cw) || Math.abs(cw) < 0.00001) return { source: "renderer-native", valid: false, reason: "invalid-w", inFrame: false, clip }; const ndcX = cx / cw, ndcY = cy / cw, ndcZ = cz / cw; const normalizedX = ndcX * 0.5 + 0.5; const normalizedY = 0.5 - ndcY * 0.5; const width = canvas.clientWidth || canvas.width || 1; const height = canvas.clientHeight || canvas.height || 1; const screenX = normalizedX * width; const screenY = normalizedY * height; const centerDistance = Math.hypot(normalizedX - 0.5, normalizedY - 0.5); return { source: "renderer-native", valid: Number.isFinite(normalizedX) && Number.isFinite(normalizedY), inFrame: ndcX >= -1 && ndcX <= 1 && ndcY >= -1 && ndcY <= 1, ndc: { x: hsRound(ndcX), y: hsRound(ndcY), z: hsRound(ndcZ) }, normalizedX: hsRound(normalizedX), normalizedY: hsRound(normalizedY), screenX: hsRound(screenX), screenY: hsRound(screenY), centerDistance: hsRound(centerDistance), clip }; }'
948
+ );
949
+ this.emit(
950
+ 'function hsRenderLabels() { const policy = holoGraphViewportState.labelPolicy; document.body.dataset.holoscriptWebgpuLabels = policy; if (policy === "none") { holoGraphLabelLayer.replaceChildren(); return; } const ranked = holoGraphObjects.filter((o) => o.visible).map((o) => ({ object: o, distance: hsLen(hsSub(o.position, hsVec3(cameraTarget))) })).sort((a, b) => a.distance - b.distance).slice(0, 18); const nodes = []; for (const entry of ranked) { const o = entry.object; const text = hsLabelText(o); const point = hsProjectPoint(o.position); if (!text || !point?.valid || !point.inFrame) continue; const focus = entry.distance <= 0.001 || o.id === holoGraphViewportState.focusId; const el = document.createElement("div"); el.textContent = text.length > 72 ? `${text.slice(0, 69)}...` : text; Object.assign(el.style, { position: "absolute", left: `${point.screenX}px`, top: `${point.screenY}px`, transform: "translate(-50%, -120%)", maxWidth: "280px", padding: focus ? "4px 7px" : "3px 6px", border: focus ? "2px solid rgba(250,204,21,0.98)" : "1px solid rgba(255,255,255,0.68)", borderRadius: "3px", background: focus ? "rgba(15,23,42,0.94)" : "rgba(2,6,23,0.86)", color: focus ? "#fef9c3" : "#f8fafc", fontSize: focus ? "13px" : "12px", fontWeight: focus ? "700" : "600", lineHeight: "1.2", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis", textShadow: "0 1px 2px #000" }); nodes.push(el); } const focusObj = holoGraphViewportState.focusId ? holoGraphObjects.find((o) => o.id === holoGraphViewportState.focusId && o.visible) : null; if (focusObj) { const panel = document.createElement("div"); Object.assign(panel.style, { position: "absolute", left: "12px", top: "12px", maxWidth: "560px", padding: "8px 10px", border: "2px solid rgba(250,204,21,0.98)", borderRadius: "4px", background: "rgba(15,23,42,0.96)", color: "#fef9c3", fontSize: "13px", fontWeight: "700", lineHeight: "1.35", textShadow: "0 1px 2px #000", boxShadow: "0 10px 30px rgba(0,0,0,0.34)" }); const near = holoGraphObjects.filter((o) => o.visible && o !== focusObj).map((o) => ({ object: o, distance: hsLen(hsSub(o.position, focusObj.position)) })).sort((a, b) => a.distance - b.distance).slice(0, 5); const rows = [{ kind: "target", object: focusObj }, ...near.map((entry) => ({ kind: "near", object: entry.object }))]; for (const row of rows) { const line = document.createElement("div"); const text = `${row.kind} ${hsLabelText(row.object)}`; line.textContent = text.length > 96 ? `${text.slice(0, 93)}...` : text; panel.appendChild(line); } nodes.push(panel); } holoGraphLabelLayer.replaceChildren(...nodes); }'
951
+ );
952
+ this.emit("function hsApplyLabelPolicy(policy) { holoGraphViewportState.labelPolicy = hsNormalizeLabelPolicy(policy); hsRenderLabels(); }");
953
+ this.emit("function hsApplyFilter(filter) { holoGraphViewportState.filter = filter; for (const o of holoGraphObjects) { o.visible = hsMatchesFilter(o, filter); hsWriteModel(o); } }");
954
+ this.emit("function hsApplyColorMode(mode) { holoGraphViewportState.colorMode = mode; for (const o of holoGraphObjects) hsWriteMaterial(o, hsColorForMode(o, mode)); }");
955
+ this.emit(
956
+ 'function hsApplyStructureStyle(style) { const center = hsGraphCenter(); const n = Math.max(1, holoGraphObjects.length); const radius = Math.max(20, Math.sqrt(n) * 18); holoGraphViewportState.structureStyle = style; holoGraphObjects.forEach((o, i) => { if (style === "compact") { o.position = hsAdd(center, hsMul(hsSub(o.basePosition, center), 0.45)); } else if (style === "radial") { const a = (i / n) * Math.PI * 2; o.position = [center[0] + Math.cos(a) * radius, center[1] + (o.basePosition[1] - center[1]) * 0.18, center[2] + Math.sin(a) * radius]; } else { o.position = [...o.basePosition]; } hsWriteModel(o); }); }'
957
+ );
958
+ this.emit(
959
+ "function hsFocusObject(payload) { const obj = hsResolveObject(payload); if (!obj) return false; holoGraphViewportState.focusId = obj.id; const target = [...obj.position]; const away = hsNorm(hsSub(hsVec3(cameraPos), hsVec3(cameraTarget))); const distance = Math.max(8, hsCameraDistance() * 0.45); hsSetCamera(hsAdd(target, hsMul(away, distance)), target); return true; }"
960
+ );
961
+ this.emit(
962
+ 'function hsViewportSnapshot() { const scene = hsDescribeScene({ limit: 8 }); return { camera: { position: Array.from(cameraPos), target: Array.from(cameraTarget), distance: hsCameraDistance() }, projectionBridge: "renderer-native", canvas: scene.canvas, actionCount: holoGraphViewportState.actionCount, lastAction: holoGraphViewportState.lastAction, filter: holoGraphViewportState.filter, colorMode: holoGraphViewportState.colorMode, structureStyle: holoGraphViewportState.structureStyle, labelPolicy: holoGraphViewportState.labelPolicy, focusId: holoGraphViewportState.focusId, objectCount: scene.objectCount, visibleObjects: scene.visibleObjects, sceneSummary: { shapes: scene.shapes, roles: scene.roles, hueBuckets: scene.hueBuckets, files: scene.files }, sampleObjects: scene.objects }; }'
963
+ );
964
+ this.emit("function hsApplyViewportAction(action, payload = {}) {");
965
+ this.indent();
966
+ this.emit('const type = typeof action === "string" ? action : String(action?.type || action?.action || "");');
967
+ this.emit('const data = typeof action === "object" && action !== null ? { ...action, ...payload } : payload || {};');
968
+ this.emit("const before = hsViewportSnapshot();");
969
+ this.emit("const basis = hsCameraBasis();");
970
+ this.emit("const distance = hsCameraDistance();");
971
+ this.emit("const pan = Math.max(1, distance * 0.08);");
972
+ this.emit("let ok = true;");
973
+ this.emit('if (type === "pan_left") hsSetCamera(hsAdd(hsVec3(cameraPos), hsMul(basis.right, -pan)), hsAdd(hsVec3(cameraTarget), hsMul(basis.right, -pan)));');
974
+ this.emit('else if (type === "pan_right") hsSetCamera(hsAdd(hsVec3(cameraPos), hsMul(basis.right, pan)), hsAdd(hsVec3(cameraTarget), hsMul(basis.right, pan)));');
975
+ this.emit('else if (type === "pan_up") hsSetCamera(hsAdd(hsVec3(cameraPos), hsMul(basis.up, pan)), hsAdd(hsVec3(cameraTarget), hsMul(basis.up, pan)));');
976
+ this.emit('else if (type === "pan_down") hsSetCamera(hsAdd(hsVec3(cameraPos), hsMul(basis.up, -pan)), hsAdd(hsVec3(cameraTarget), hsMul(basis.up, -pan)));');
977
+ this.emit('else if (type === "zoom_in") hsSetCamera(hsAdd(hsVec3(cameraPos), hsMul(basis.forward, distance * 0.22)), hsVec3(cameraTarget));');
978
+ this.emit('else if (type === "zoom_out") hsSetCamera(hsAdd(hsVec3(cameraPos), hsMul(basis.forward, -distance * 0.25)), hsVec3(cameraTarget));');
979
+ this.emit('else if (type === "zoom_to_fit" || type === "reset_view") { holoGraphViewportState.focusId = null; hsSetCamera(Array.from(holoGraphInitialCameraPos), Array.from(holoGraphInitialCameraTarget)); }');
980
+ this.emit('else if (type === "focus_anchor" || type === "focus_node") ok = hsFocusObject(data);');
981
+ this.emit('else if (type === "filter_call") hsApplyFilter("call");');
982
+ this.emit('else if (type === "filter_import") hsApplyFilter("import");');
983
+ this.emit('else if (type === "filter_all") hsApplyFilter("all");');
984
+ this.emit('else if (type === "set_color_mode") hsApplyColorMode(String(data.mode || data.colorMode || "semantic"));');
985
+ this.emit('else if (type === "set_structure_style") hsApplyStructureStyle(String(data.style || data.structureStyle || "flow"));');
986
+ this.emit('else if (type === "set_label_policy") hsApplyLabelPolicy(data.policy || data.labelPolicy || "none");');
987
+ this.emit("else ok = false;");
988
+ this.emit("if (!ok) return { ok: false, action: type, before, after: hsViewportSnapshot() };");
989
+ this.emit("holoGraphViewportState.actionCount++;");
990
+ this.emit("holoGraphViewportState.lastAction = type;");
991
+ this.emit("document.body.dataset.holoscriptWebgpuLastAction = type;");
992
+ this.emit("return { ok: true, action: type, before, after: hsViewportSnapshot() };");
993
+ this.dedent();
994
+ this.emit("}");
995
+ this.emit("globalThis.holoscriptWebgpuViewport = { applyAction: hsApplyViewportAction, getState: hsViewportSnapshot, describeScene: hsDescribeScene, inspectObject: hsInspectObject, projectObject: hsProjectObject, projectPoint: hsProjectPoint };");
996
+ this.emit("globalThis.HoloGraphViewport = globalThis.holoscriptWebgpuViewport;");
997
+ this.emit('document.body.dataset.holoscriptWebgpuViewport = "ready";');
998
+ this.emit('document.body.dataset.holoscriptWebgpuInspector = "ready";');
999
+ this.emit('document.body.dataset.holoscriptWebgpuLabels = "none";');
1000
+ this.emit("hsSetCamera(Array.from(cameraPos), Array.from(cameraTarget));");
1001
+ this.emit("");
1002
+ }
858
1003
  emitRenderLoop(composition) {
859
1004
  this.emit("// === Render Loop ===");
860
1005
  this.emit("let frameCount = 0;");
@@ -863,6 +1008,8 @@ var init_WebGPUCompiler = __esm({
863
1008
  this.indent();
864
1009
  this.emit("frameCount++;");
865
1010
  this.emit("const time = (performance.now() - t0) / 1000.0;");
1011
+ this.emit("device.queue.writeBuffer(vpUniform, 0, buildViewProjection());");
1012
+ this.emit("hsRenderLabels();");
866
1013
  this.emit("const enc = device.createCommandEncoder();");
867
1014
  const gpuObjs = (composition.objects || []).filter(
868
1015
  (o) => o.traits?.some(
@@ -1005,6 +1152,19 @@ var init_WebGPUCompiler = __esm({
1005
1152
  findObjProp(obj, key) {
1006
1153
  return obj.properties?.find((p) => p.key === key)?.value;
1007
1154
  }
1155
+ extractObjectProperties(obj) {
1156
+ const properties = {};
1157
+ for (const prop of obj.properties ?? []) {
1158
+ if (!prop.key) continue;
1159
+ const value = prop.value;
1160
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || Array.isArray(value) && value.every(
1161
+ (item) => typeof item === "string" || typeof item === "number" || typeof item === "boolean"
1162
+ )) {
1163
+ properties[prop.key] = value;
1164
+ }
1165
+ }
1166
+ return properties;
1167
+ }
1008
1168
  parseColor(value) {
1009
1169
  if (typeof value === "string" && value.startsWith("#")) {
1010
1170
  const h = value.slice(1);
@@ -1058,5 +1218,5 @@ var init_WebGPUCompiler = __esm({
1058
1218
  });
1059
1219
 
1060
1220
  export { WebGPUCompiler, WebGPUCompiler_exports, init_WebGPUCompiler };
1061
- //# sourceMappingURL=chunk-KEYG7HGY.js.map
1062
- //# sourceMappingURL=chunk-KEYG7HGY.js.map
1221
+ //# sourceMappingURL=chunk-ONPVM4IV.js.map
1222
+ //# sourceMappingURL=chunk-ONPVM4IV.js.map
@@ -10,7 +10,7 @@ var chunkNQN5LFN4_cjs = require('./chunk-NQN5LFN4.cjs');
10
10
  var chunkVTEXJOSD_cjs = require('./chunk-VTEXJOSD.cjs');
11
11
  var chunkLMB555QB_cjs = require('./chunk-LMB555QB.cjs');
12
12
  var chunkGZPUA2TL_cjs = require('./chunk-GZPUA2TL.cjs');
13
- var chunkW2GA3EQB_cjs = require('./chunk-W2GA3EQB.cjs');
13
+ var chunkTC7JEO6R_cjs = require('./chunk-TC7JEO6R.cjs');
14
14
  var chunkRRQIAJLQ_cjs = require('./chunk-RRQIAJLQ.cjs');
15
15
  var chunkP7JEKJTZ_cjs = require('./chunk-P7JEKJTZ.cjs');
16
16
  var chunkIS7NTKY5_cjs = require('./chunk-IS7NTKY5.cjs');
@@ -1600,12 +1600,22 @@ var init_LlamaServerCompiler = chunkZHPMP447_cjs.__esm({
1600
1600
  const normalized = trimmed.replace(/\\/g, "/");
1601
1601
  if (/^llama-server(?:\.exe)?$/i.test(trimmed)) {
1602
1602
  throw new Error(
1603
- "LlamaServerCompiler requires a HOLO-patched llama.cpp build binary; use build/bin/llama-server(.exe), not a bare PATH lookup."
1603
+ "LlamaServerCompiler requires a HOLO-patched llama.cpp build binary; use build-holo/bin/.../llama-server(.exe), not a bare PATH lookup."
1604
1604
  );
1605
1605
  }
1606
1606
  if (/\/?\.docker\/bin\/inference\/llama-server(?:\.exe)?$/i.test(normalized)) {
1607
1607
  throw new Error(
1608
- "LlamaServerCompiler rejects the prebuilt .docker/bin/inference llama-server binary because HOLO patching it is a silent no-op; use the rebuilt build/bin/llama-server(.exe)."
1608
+ "LlamaServerCompiler rejects the prebuilt .docker/bin/inference llama-server binary because HOLO patching it is a silent no-op; use the rebuilt build-holo/bin/.../llama-server(.exe)."
1609
+ );
1610
+ }
1611
+ if (/\/llama\.cpp\/build\/bin\/(?:release\/)?llama-server(?:\.exe)?$/i.test(normalized)) {
1612
+ throw new Error(
1613
+ "LlamaServerCompiler rejects the legacy llama.cpp build/bin llama-server path; use the HOLO-patched build-holo/bin/.../llama-server(.exe)."
1614
+ );
1615
+ }
1616
+ if (/\/ollama\/.*\/llama-server(?:\.exe)?$/i.test(normalized)) {
1617
+ throw new Error(
1618
+ "LlamaServerCompiler rejects Ollama-owned llama-server binaries for HoloLlama serving; use the HOLO-patched llama.cpp build-holo binary."
1609
1619
  );
1610
1620
  }
1611
1621
  }
@@ -6066,7 +6076,7 @@ function registerBuiltinDialects() {
6066
6076
  supportedTraits: ["physics", "particles", "fluid", "material", "compute"],
6067
6077
  riskTier: "standard",
6068
6078
  factory: (opts) => {
6069
- const { WebGPUCompiler } = (chunkW2GA3EQB_cjs.init_WebGPUCompiler(), chunkZHPMP447_cjs.__toCommonJS(chunkW2GA3EQB_cjs.WebGPUCompiler_exports));
6079
+ const { WebGPUCompiler } = (chunkTC7JEO6R_cjs.init_WebGPUCompiler(), chunkZHPMP447_cjs.__toCommonJS(chunkTC7JEO6R_cjs.WebGPUCompiler_exports));
6070
6080
  return new WebGPUCompiler(opts);
6071
6081
  },
6072
6082
  outputExtensions: [".wgsl", ".ts"]
@@ -8615,12 +8625,19 @@ function digest(value) {
8615
8625
  var POINT_PROVENANCE_CODE = {
8616
8626
  observed: 0,
8617
8627
  interpolated: 1,
8618
- "generative-extended": 2
8628
+ "generative-extended": 2,
8629
+ // Appended (never renumber existing codes — persisted buffers depend on them).
8630
+ "nlos-inferred": 3
8619
8631
  };
8620
8632
  var POINT_PROVENANCE_CLASS_BY_CODE = [
8621
8633
  "observed",
8634
+ // 0
8622
8635
  "interpolated",
8623
- "generative-extended"
8636
+ // 1
8637
+ "generative-extended",
8638
+ // 2
8639
+ "nlos-inferred"
8640
+ // 3
8624
8641
  ];
8625
8642
  function provenanceClassToCode(cls) {
8626
8643
  return POINT_PROVENANCE_CODE[cls];
@@ -8631,17 +8648,20 @@ function provenanceCodeToClass(code) {
8631
8648
  function provenanceHistogram(codes) {
8632
8649
  let observed = 0;
8633
8650
  let interpolated = 0;
8651
+ let nlosInferred = 0;
8634
8652
  let generativeExtended = 0;
8635
8653
  for (let i = 0; i < codes.length; i++) {
8636
8654
  const c = codes[i];
8637
8655
  if (c === 0) observed++;
8638
8656
  else if (c === 1) interpolated++;
8657
+ else if (c === 3) nlosInferred++;
8639
8658
  else generativeExtended++;
8640
8659
  }
8641
8660
  const total = codes.length;
8642
8661
  return {
8643
8662
  observed,
8644
8663
  interpolated,
8664
+ "nlos-inferred": nlosInferred,
8645
8665
  "generative-extended": generativeExtended,
8646
8666
  total,
8647
8667
  observedFraction: total > 0 ? observed / total : 0
@@ -8653,7 +8673,7 @@ function uniformProvenance(count, cls) {
8653
8673
  return arr;
8654
8674
  }
8655
8675
  var HOLOMAP_CAPTURE_DEFAULT_PROVENANCE = "observed";
8656
- var PROVENANCE_RECEIPT_VERSION = "provenance-receipt-v1";
8676
+ var PROVENANCE_RECEIPT_VERSION = "provenance-receipt-v2";
8657
8677
  function sha256Hex(bytes) {
8658
8678
  return crypto.createHash("sha256").update(bytes).digest("hex");
8659
8679
  }
@@ -8667,6 +8687,7 @@ function buildProvenanceReceipt(provenanceCodes, deliveredBytes, source) {
8667
8687
  counts: {
8668
8688
  observed: histogram.observed,
8669
8689
  interpolated: histogram.interpolated,
8690
+ "nlos-inferred": histogram["nlos-inferred"],
8670
8691
  "generative-extended": histogram["generative-extended"],
8671
8692
  total: histogram.total
8672
8693
  },
@@ -13472,7 +13493,7 @@ var CompilerBridge = class {
13472
13493
  if (this.initialized) return;
13473
13494
  try {
13474
13495
  const [parserModule, compilerModule] = await Promise.all([
13475
- import('./HoloScriptPlusParser-RNUCHOAJ.cjs'),
13496
+ import('./HoloScriptPlusParser-RFNHRMPE.cjs'),
13476
13497
  import('./SceneIRCompiler-KWUFHZ4O.cjs')
13477
13498
  ]);
13478
13499
  this.modules = {
@@ -14191,5 +14212,5 @@ exports.selectModalityForAll = selectModalityForAll;
14191
14212
  exports.spatialPartition = spatialPartition;
14192
14213
  exports.streamWorldTiles = streamWorldTiles;
14193
14214
  exports.uniformProvenance = uniformProvenance;
14194
- //# sourceMappingURL=chunk-RMOEL2GD.cjs.map
14195
- //# sourceMappingURL=chunk-RMOEL2GD.cjs.map
14215
+ //# sourceMappingURL=chunk-PXVAPGTR.cjs.map
14216
+ //# sourceMappingURL=chunk-PXVAPGTR.cjs.map
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkOIBRWLPY_cjs = require('./chunk-OIBRWLPY.cjs');
4
4
  var chunkYP5CHEYU_cjs = require('./chunk-YP5CHEYU.cjs');
5
- var chunkOMNHTCS4_cjs = require('./chunk-OMNHTCS4.cjs');
5
+ var chunkLHUDAJQT_cjs = require('./chunk-LHUDAJQT.cjs');
6
6
  var chunkEI3J6LTW_cjs = require('./chunk-EI3J6LTW.cjs');
7
7
  var chunkNTQRFOPP_cjs = require('./chunk-NTQRFOPP.cjs');
8
8
  var crypto = require('crypto');
@@ -2969,7 +2969,7 @@ var HoloScriptPlusParser = class _HoloScriptPlusParser {
2969
2969
  }
2970
2970
  return this.parseTraitSumTail(directive2);
2971
2971
  }
2972
- if (chunkOMNHTCS4_cjs.LIFECYCLE_HOOKS.includes(name)) {
2972
+ if (chunkLHUDAJQT_cjs.LIFECYCLE_HOOKS.includes(name)) {
2973
2973
  const params = [];
2974
2974
  if (this.check("LPAREN")) {
2975
2975
  this.advance();
@@ -2991,7 +2991,7 @@ var HoloScriptPlusParser = class _HoloScriptPlusParser {
2991
2991
  let body = "";
2992
2992
  if (this.check("ARROW")) {
2993
2993
  this.advance();
2994
- body = this.parseInlineExpression();
2994
+ body = this.check("LBRACE") ? this.parseCodeBlock() : this.parseInlineExpression();
2995
2995
  } else if (this.check("LBRACE")) {
2996
2996
  body = this.parseCodeBlock();
2997
2997
  }
@@ -3285,7 +3285,7 @@ var HoloScriptPlusParser = class _HoloScriptPlusParser {
3285
3285
  return { type: "hololand_event", event: eventName, params };
3286
3286
  }
3287
3287
  }
3288
- if (chunkOMNHTCS4_cjs.STRUCTURAL_DIRECTIVES.includes(name)) {
3288
+ if (chunkLHUDAJQT_cjs.STRUCTURAL_DIRECTIVES.includes(name)) {
3289
3289
  let nodeName;
3290
3290
  if (this.check("STRING")) {
3291
3291
  nodeName = this.advance().value;
@@ -3315,6 +3315,10 @@ var HoloScriptPlusParser = class _HoloScriptPlusParser {
3315
3315
  config.body = this.parseCodeBlock();
3316
3316
  }
3317
3317
  }
3318
+ if (this.check("ARROW")) {
3319
+ this.advance();
3320
+ config.body = this.check("LBRACE") ? this.parseCodeBlock() : this.parseInlineExpression();
3321
+ }
3318
3322
  const directive = { type: "trait", name, config };
3319
3323
  if (configStyle === "block") {
3320
3324
  this.markBlockConfigDirective(directive, nameToken);
@@ -6285,5 +6289,5 @@ exports.getSourceContext = getSourceContext;
6285
6289
  exports.globalParseCache = globalParseCache;
6286
6290
  exports.parse = parse;
6287
6291
  exports.parseIncrementalChunks = parseIncrementalChunks;
6288
- //# sourceMappingURL=chunk-656IAS7B.cjs.map
6289
- //# sourceMappingURL=chunk-656IAS7B.cjs.map
6292
+ //# sourceMappingURL=chunk-Q4K2GEMW.cjs.map
6293
+ //# sourceMappingURL=chunk-Q4K2GEMW.cjs.map