@descix/frqtl-node 0.0.0-stage → 0.6.0-p0.1
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/CLAUDE.md +87 -0
- package/README.md +84 -2
- package/dist/dist-manifest.json +218 -0
- package/dist/eyes/index.js +109 -0
- package/dist/fat/pkg-node/egpt_wasm.js +1277 -0
- package/dist/fat/pkg-node/egpt_wasm_bg.wasm +0 -0
- package/dist/fat/pkg-node/package.json +12 -0
- package/dist/frqtl/assets/vendor/chroma.mjs +64 -0
- package/dist/frqtl/compat/boot-node.js +34 -0
- package/dist/frqtl/compat/engine.js +127 -0
- package/dist/frqtl/compat/package-root.js +24 -0
- package/dist/frqtl/compat/providers/wasm-engine.js +2501 -0
- package/dist/frqtl/compat/providers/wasm-load-browser.js +134 -0
- package/dist/frqtl/compat/providers/wasm-load-node.js +59 -0
- package/dist/frqtl/compat/renderer/FieldBuilder.js +145 -0
- package/dist/frqtl/compat/renderer/Filters.js +163 -0
- package/dist/frqtl/compat/renderer/RenderFamily.js +85 -0
- package/dist/frqtl/compat/renderer/RenderMesh.js +100 -0
- package/dist/frqtl/compat/renderer/RenderShape.js +154 -0
- package/dist/frqtl/compat/renderer/camera2d-geometry.js +183 -0
- package/dist/frqtl/compat/renderer/captureStill-common.js +259 -0
- package/dist/frqtl/compat/renderer/display-slot.js +96 -0
- package/dist/frqtl/compat/renderer/lo-drawn-center.js +231 -0
- package/dist/frqtl/compat/renderer/orbit-bag.js +216 -0
- package/dist/frqtl/compat/renderer/providers/godrays-layer.js +213 -0
- package/dist/frqtl/compat/renderer/providers/index.js +22 -0
- package/dist/frqtl/compat/renderer/providers/p5-provider.js +861 -0
- package/dist/frqtl/compat/renderer/providers/three-camera-contract.js +160 -0
- package/dist/frqtl/compat/renderer/providers/three-camera-geometry.js +571 -0
- package/dist/frqtl/compat/renderer/providers/three-provider.js +2474 -0
- package/dist/frqtl/compat/renderer/renderCapabilities-common.js +186 -0
- package/dist/frqtl/compat/renderer/renderer-provider-contract.js +238 -0
- package/dist/frqtl/compat/renderer/unprojectStill.js +172 -0
- package/dist/frqtl/compat/vendor.js +196 -0
- package/dist/frqtl/node-entry.js +17 -0
- package/dist/frqtl/objects/FrqtlApp.js +2922 -0
- package/dist/frqtl/objects/ObjectFactory.js +297 -0
- package/dist/frqtl/objects/RecipeContext.js +322 -0
- package/dist/frqtl/objects/collectors/DataCollector.js +116 -0
- package/dist/frqtl/objects/constants/WallBehaviors.js +178 -0
- package/dist/frqtl/objects/geometry/SlabFace.js +258 -0
- package/dist/frqtl/objects/instruments/capture-host.js +453 -0
- package/dist/frqtl/objects/instruments/capture.js +711 -0
- package/dist/frqtl/objects/instruments/hosted-eyes.js +985 -0
- package/dist/frqtl/objects/kinds-entry.js +14 -0
- package/dist/frqtl/objects/kinds.js +190 -0
- package/dist/frqtl/objects/objects/Box.js +273 -0
- package/dist/frqtl/objects/objects/Bullet.js +155 -0
- package/dist/frqtl/objects/objects/CircuitGate.js +380 -0
- package/dist/frqtl/objects/objects/CircuitProbe.js +214 -0
- package/dist/frqtl/objects/objects/DirectedTunnel.js +412 -0
- package/dist/frqtl/objects/objects/EgptFractal.js +164 -0
- package/dist/frqtl/objects/objects/LightSource.js +354 -0
- package/dist/frqtl/objects/objects/QuantumEmitter.js +760 -0
- package/dist/frqtl/objects/objects/Tube.js +471 -0
- package/dist/frqtl/objects/objects/absorbRadiation.js +310 -0
- package/dist/frqtl/objects/objects/actionCompiler.js +1747 -0
- package/dist/frqtl/objects/objects/controlAction.js +89 -0
- package/dist/frqtl/objects/objects/controlBind.js +278 -0
- package/dist/frqtl/objects/objects/directedRedirectProgram.js +120 -0
- package/dist/frqtl/objects/objects/emitterProgram.js +209 -0
- package/dist/frqtl/objects/objects/frqtl-control-slider.js +197 -0
- package/dist/frqtl/objects/objects/frqtl-control-sync.js +272 -0
- package/dist/frqtl/objects/objects/frqtl-control-widgets.js +219 -0
- package/dist/frqtl/objects/objects/frqtl-control-write-queue.js +174 -0
- package/dist/frqtl/objects/objects/makeControlsForObject.js +824 -0
- package/dist/frqtl/objects/objects/makeControlsForRenderSurface.js +161 -0
- package/dist/frqtl/objects/objects/slitLinerScatter.js +263 -0
- package/dist/frqtl/objects/objects/sustainedSource.js +299 -0
- package/dist/frqtl/objects/objects/tagger.js +228 -0
- package/dist/frqtl/objects/schema/engine-scopes.js +469 -0
- package/dist/frqtl/objects/schema/index.js +256 -0
- package/dist/frqtl/objects/schema/scopes.js +457 -0
- package/dist/frqtl/objects/schema/validate-descriptor.js +49 -0
- package/dist/frqtl/objects/schema/valueNormalizer.js +366 -0
- package/dist/frqtl/objects/setup/_collisionMatrixLanes.js +66 -0
- package/dist/frqtl/objects/setup/_setupOptions.js +118 -0
- package/dist/frqtl/objects/setup/_worldInit.js +162 -0
- package/dist/frqtl/objects/setup/setupBlackbodySubstrate.js +242 -0
- package/dist/frqtl/objects/setup/setupCircuitBasic.js +447 -0
- package/dist/frqtl/objects/setup/setupCollisionMatrix.js +188 -0
- package/dist/frqtl/objects/setup/setupConeEmitter3D.js +251 -0
- package/dist/frqtl/objects/setup/setupDoubleSlit.js +327 -0
- package/dist/frqtl/objects/setup/setupDoubleSlit_Laser.js +229 -0
- package/dist/frqtl/objects/setup/setupEmpty.js +59 -0
- package/dist/frqtl/objects/setup/setupFxSmoke.js +209 -0
- package/dist/frqtl/objects/setup/setupG1Race.js +80 -0
- package/dist/frqtl/objects/setup/setupG2Sweep.js +89 -0
- package/dist/frqtl/objects/setup/setupG3Collide.js +177 -0
- package/dist/frqtl/objects/setup/setupLightSourceLab.js +280 -0
- package/dist/frqtl/objects/setup/setupOscillator.js +68 -0
- package/dist/frqtl/objects/setup/setupParticleWalk.js +93 -0
- package/dist/frqtl/objects/setup/setupParticleWalk3D.js +133 -0
- package/dist/frqtl/objects/setup/setupSphereEmitter3D.js +1259 -0
- package/dist/frqtl/objects/setup/setupTraceCircuit.js +239 -0
- package/dist/frqtl/objects/setup/setupTunnelLab.js +242 -0
- package/dist/frqtl/objects/setup/setupTunnelPointExit.js +306 -0
- package/dist/frqtl/objects/setup/setupWaveInterference.js +178 -0
- package/dist/frqtl/objects/v1-replacements.js +30 -0
- package/dist/frqtl/package-core.js +23 -0
- package/dist/frqtl/parts/CameraControls.js +643 -0
- package/dist/frqtl/parts/CameraPath.js +575 -0
- package/dist/frqtl/parts/CollisionActions.js +35 -0
- package/dist/frqtl/parts/CollisionTypes.js +31 -0
- package/dist/frqtl/parts/DetectorWall.js +496 -0
- package/dist/frqtl/parts/FrqtlControlOverlay.js +227 -0
- package/dist/frqtl/parts/FrqtlControlsPanel.js +415 -0
- package/dist/frqtl/parts/FrqtlVision.js +818 -0
- package/dist/frqtl/parts/GraphingDetectorWall.js +490 -0
- package/dist/frqtl/parts/LargeObject.js +406 -0
- package/dist/frqtl/parts/LightColor.js +255 -0
- package/dist/frqtl/parts/LiveChart.js +285 -0
- package/dist/frqtl/parts/LogicGate.js +720 -0
- package/dist/frqtl/parts/OvenBox.js +612 -0
- package/dist/frqtl/parts/PointSource.js +763 -0
- package/dist/frqtl/parts/Rectangle.js +200 -0
- package/dist/frqtl/parts/SlitLightSource.js +234 -0
- package/dist/frqtl/parts/SlitScreen.js +628 -0
- package/dist/frqtl/parts/SphereEmitter.js +946 -0
- package/dist/frqtl/parts/Trace.js +508 -0
- package/dist/frqtl/parts/Tunnel.js +1057 -0
- package/dist/frqtl/parts/Wall.js +1211 -0
- package/dist/frqtl/parts/index.js +33 -0
- package/dist/frqtl/scenes/absorbing-wall-3d.js +33 -0
- package/dist/frqtl/scenes/absorbing-wall.js +32 -0
- package/dist/frqtl/scenes/atomic-model.js +88 -0
- package/dist/frqtl/scenes/big-bang.js +46 -0
- package/dist/frqtl/scenes/blackbody.js +81 -0
- package/dist/frqtl/scenes/circuit-sat.js +127 -0
- package/dist/frqtl/scenes/collision-matrix-3d.js +107 -0
- package/dist/frqtl/scenes/counting-wall-3d.js +36 -0
- package/dist/frqtl/scenes/counting-wall.js +38 -0
- package/dist/frqtl/scenes/double-slit.js +31 -0
- package/dist/frqtl/scenes/dse-one-emitter.js +196 -0
- package/dist/frqtl/scenes/dse-one-slit.js +114 -0
- package/dist/frqtl/scenes/dse-photoelectric.js +70 -0
- package/dist/frqtl/scenes/dse-tunnel-rebuild.js +244 -0
- package/dist/frqtl/scenes/dse-two-emitters.js +196 -0
- package/dist/frqtl/scenes/dse-two-slits.js +132 -0
- package/dist/frqtl/scenes/empty.js +14 -0
- package/dist/frqtl/scenes/laser-buildup.js +49 -0
- package/dist/frqtl/scenes/mirror-3d.js +56 -0
- package/dist/frqtl/scenes/mirror-route.js +140 -0
- package/dist/frqtl/scenes/mirror.js +38 -0
- package/dist/frqtl/scenes/omni-3d.js +27 -0
- package/dist/frqtl/scenes/omni-source.js +22 -0
- package/dist/frqtl/scenes/self-interference.js +39 -0
- package/dist/frqtl/scenes/smoking-gun.js +122 -0
- package/dist/frqtl/scenes/straight-walk.js +22 -0
- package/dist/frqtl/scenes/sun.js +39 -0
- package/dist/frqtl/scenes/two-source.js +37 -0
- package/dist/frqtl/scenes/wave.js +26 -0
- package/dist/shim/bundle/frqnb.js +112 -0
- package/dist/shim/bundle/index.js +121 -0
- package/dist/shim/bundle/indexHtml.js +107 -0
- package/dist/shim/bundle/manifest.js +95 -0
- package/dist/shim/bundle/zip.js +243 -0
- package/dist/shim/bus.js +67 -0
- package/dist/shim/controls/index.js +627 -0
- package/dist/shim/controls/registry.js +274 -0
- package/dist/shim/engine/artifact-shell.js +212 -0
- package/dist/shim/engine/boot-phases.js +44 -0
- package/dist/shim/engine/engine-stack-boot.js +59 -0
- package/dist/shim/engine/router.js +692 -0
- package/dist/shim/experiment-frame/index.js +296 -0
- package/dist/shim/expr/ast-schema.js +369 -0
- package/dist/shim/field-descriptor/index.js +326 -0
- package/dist/shim/frame-data/index.js +224 -0
- package/dist/shim/index.js +67 -0
- package/dist/shim/notebook/canvas-guard.js +82 -0
- package/dist/shim/notebook/catalog.js +35 -0
- package/dist/shim/notebook/format.js +736 -0
- package/dist/shim/notebook/frqtl-setups-importmap.js +81 -0
- package/dist/shim/notebook/kernel.js +672 -0
- package/dist/shim/notebook/knob.js +151 -0
- package/dist/shim/notebook/module-resolver.js +260 -0
- package/dist/shim/notebook/notebook-knobs.js +65 -0
- package/dist/shim/notebook/produced-bindings.js +67 -0
- package/dist/shim/notebook/realm-registry.js +121 -0
- package/dist/shim/notebook/realm-transport.js +73 -0
- package/dist/shim/notebook/setup-builder.js +510 -0
- package/dist/shim/notebook/store.js +159 -0
- package/dist/shim/notebook/vendor-importmap.js +134 -0
- package/dist/shim/notebook/view-builder.js +189 -0
- package/dist/shim/notebook/view-ctx.js +100 -0
- package/dist/shim/notebook/view-handle.js +202 -0
- package/dist/shim/notebook/warmup.js +102 -0
- package/dist/shim/package.json +4 -0
- package/dist/shim/page-params/index.js +214 -0
- package/dist/shim/project/identity.js +112 -0
- package/dist/shim/project/index.js +19 -0
- package/dist/shim/project/link.js +402 -0
- package/dist/shim/project/node-specifier-hook.mjs +35 -0
- package/dist/shim/project/register-node.mjs +17 -0
- package/dist/shim/project/specifiers.js +106 -0
- package/dist/shim/registry/copy-gate.js +110 -0
- package/dist/shim/registry/exhibits.js +455 -0
- package/dist/shim/registry/experiments.js +215 -0
- package/dist/shim/registry/index.js +19 -0
- package/dist/shim/registry/scene-source.js +157 -0
- package/dist/shim/registry/walkthrough.js +807 -0
- package/dist/shim/render/capture-envelope.js +279 -0
- package/dist/shim/render/heat-colormap.js +92 -0
- package/dist/shim/render/render-stages.js +855 -0
- package/dist/shim/render/sun-look.js +33 -0
- package/dist/shim/render-state/apply.js +262 -0
- package/dist/shim/render-state/index.js +74 -0
- package/dist/shim/rpc/index.js +207 -0
- package/dist/shim/runtime/index.js +1023 -0
- package/dist/shim/storage/boot.js +69 -0
- package/dist/shim/storage/index.js +169 -0
- package/dist/shim/storage/local-storage-provider.js +230 -0
- package/dist/shim/storage/make-namespace-store.js +132 -0
- package/dist/shim/storage/modules.js +249 -0
- package/dist/shim/storage/projects.js +150 -0
- package/llms.txt +12 -0
- package/package.json +62 -4
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* Copyright 2023-2026 by Essam Abadir */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* setupParticleWalk3D — Engine-agnostic 3D particle walk experiment factory.
|
|
5
|
+
*
|
|
6
|
+
* ── Layer 1: API contract ────────────────────────────────────────────────────
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} universe
|
|
9
|
+
* The engine universe instance (JS or WASM compat shim), not yet init'd.
|
|
10
|
+
* Obtained from `window.EGPTUniverse` via FrqtlApp.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} [options]
|
|
13
|
+
* Configuration overrides.
|
|
14
|
+
*
|
|
15
|
+
* @param {number} [options.fundamentalDimension=0]
|
|
16
|
+
* Base dimension index to simulate in. Units: dimension ordinal (integer).
|
|
17
|
+
*
|
|
18
|
+
* @param {number} [options.fundamentalWaveLength=64]
|
|
19
|
+
* Desired wavelength of emitted quanta. Units: pixels.
|
|
20
|
+
* Drives the wavelengthScale multiplier: Math.max(1, floor(λ/4)).
|
|
21
|
+
*
|
|
22
|
+
* @param {number} [options.velocity=1]
|
|
23
|
+
* Rightward emission velocity component (vx). Units: pixels/tick.
|
|
24
|
+
* With activeAxes.z=true the engine's transverse yo-yo fires on both y AND z.
|
|
25
|
+
*
|
|
26
|
+
* @returns {{ emitter: QuantumEmitter, largeObjects: [] }}
|
|
27
|
+
* emitter: the QuantumEmitter instance (supports setActive(), auto_fire).
|
|
28
|
+
* largeObjects: empty array (no collision screens in this experiment).
|
|
29
|
+
*
|
|
30
|
+
* ── Layer 2: physics behavior ────────────────────────────────────────────────
|
|
31
|
+
*
|
|
32
|
+
* With activeAxes:{x:true,y:true,z:true} forwarded to universe.init(), the
|
|
33
|
+
* WASM engine arms THREE independent transverse axes. The rightward beam
|
|
34
|
+
* (vx=1) drives quanta along x; the wave-walk coin-flip fires the yo-yo kick
|
|
35
|
+
* on BOTH y AND z independently each tick (two transverse coins). This creates
|
|
36
|
+
* a beam that SPREADS in both transverse directions as it propagates —
|
|
37
|
+
* observable as growing z-spread in TickData.frameData[*].z.
|
|
38
|
+
*
|
|
39
|
+
* With only two axes (2D), the z column stays zero throughout. With three axes
|
|
40
|
+
* the z-spread grows monotonically from tick 0 as the beam fans out into 3D
|
|
41
|
+
* space. This is the realm-observable proof that the engine's 3D motion model
|
|
42
|
+
* (Invariant 1: per-axis ±1 speed limit, independent per axis) is live.
|
|
43
|
+
*
|
|
44
|
+
* The stochastic stack-up (base-walk + yo-yo on the same axis) can push a
|
|
45
|
+
* quantum ±2 px/tick on any single axis when both mechanisms fire in the same
|
|
46
|
+
* direction. This is deliberate (§6.10 isotropy oracle) — do NOT clamp it.
|
|
47
|
+
*
|
|
48
|
+
* See: FRAQTL CLAUDE.md §Engine Invariants §1; lib/frqtl/crates/egpt_engine/
|
|
49
|
+
* src/frame.rs move_frame + the §6.10 isotropy oracle.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
import { assertSetupOptions as _assertSetupOptions, requireWorldRect as _requireWorldRect } from './_setupOptions.js';
|
|
53
|
+
import { QuantumEmitter } from '../objects/QuantumEmitter.js';
|
|
54
|
+
|
|
55
|
+
// The ONE unknown-option-key validator (objects/setup/_setupOptions.js). Resolved
|
|
56
|
+
// LAZILY in the browser: the game layer defines window.assertSetupOptions before any
|
|
57
|
+
// page script runs, but reading it at eval time would bake in a load-order dependency.
|
|
58
|
+
|
|
59
|
+
// ── Imports ─────────────────────────────────────────────────────────────
|
|
60
|
+
|
|
61
|
+
// ── Setup Factory ────────────────────────────────────────────────────────
|
|
62
|
+
/**
|
|
63
|
+
* OPTIONS — this factory's own option vocabulary: EXACTLY the keys it reads.
|
|
64
|
+
* Exported as `setupParticleWalk3D.OPTIONS` so a composing caller consumes it instead of
|
|
65
|
+
* retyping it. `setup-factory-option-vocabulary.test.mjs` re-derives the
|
|
66
|
+
* read-set by static trace and fails if this list drifts from the code.
|
|
67
|
+
*/
|
|
68
|
+
var OPTIONS = [
|
|
69
|
+
'fundamentalDimension', 'fundamentalWaveLength', 'velocity',
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
function setupParticleWalk3D(universe, options) {
|
|
73
|
+
options = _assertSetupOptions('setupParticleWalk3D', options, OPTIONS);
|
|
74
|
+
|
|
75
|
+
// The world rect the co-init call wrote (EGPTUniverse.create({rect})) — the ONE size.
|
|
76
|
+
var canvas_rect = universe.universe_rect;
|
|
77
|
+
_requireWorldRect('setupParticleWalk3D universe.universe_rect', canvas_rect);
|
|
78
|
+
|
|
79
|
+
var fundamentalDimension = options.fundamentalDimension !== undefined
|
|
80
|
+
? options.fundamentalDimension : 0;
|
|
81
|
+
var desiredWaveLength = options.fundamentalWaveLength !== undefined
|
|
82
|
+
? options.fundamentalWaveLength : 64;
|
|
83
|
+
var velocity = options.velocity !== undefined ? options.velocity : 1;
|
|
84
|
+
|
|
85
|
+
var waveLengthMultiplier = Math.floor(desiredWaveLength / 4);
|
|
86
|
+
waveLengthMultiplier = Math.max(1, waveLengthMultiplier);
|
|
87
|
+
|
|
88
|
+
var vx = velocity;
|
|
89
|
+
var vy = 0;
|
|
90
|
+
|
|
91
|
+
// Init universe with full 3D active axes.
|
|
92
|
+
// activeAxes:{x,y,z} is the camelCase option shape validated by wasm-engine.js;
|
|
93
|
+
// it maps to config.active_axes = {x,y,z} forwarded to the Rust engine.
|
|
94
|
+
universe.init(fundamentalDimension, {
|
|
95
|
+
wavelengthScale: waveLengthMultiplier,
|
|
96
|
+
brownianMotion: false,
|
|
97
|
+
activeAxes: { x: true, y: true, z: true }
|
|
98
|
+
});
|
|
99
|
+
universe.minMBFillRate = 0.2;
|
|
100
|
+
|
|
101
|
+
// Emitter at canvas centre, firing rightward (vx=1, vy=0).
|
|
102
|
+
// The engine's z-axis yo-yo kicks are transverse to the beam direction —
|
|
103
|
+
// they emerge autonomously from the coin-flip walk; we do not set vz here.
|
|
104
|
+
var cx = Math.floor(canvas_rect.w / 2);
|
|
105
|
+
var cy = Math.floor(canvas_rect.h / 2);
|
|
106
|
+
var sourceHeight = 10;
|
|
107
|
+
var sourceRect = [cx, cy, 1, sourceHeight];
|
|
108
|
+
|
|
109
|
+
var emitter = new QuantumEmitter(
|
|
110
|
+
universe,
|
|
111
|
+
[sourceRect],
|
|
112
|
+
vx, vy,
|
|
113
|
+
20, // burst_size
|
|
114
|
+
1, // charge = NEGATIVE (1)
|
|
115
|
+
true, // auto_fire
|
|
116
|
+
false, // not random direction
|
|
117
|
+
Infinity, // quantum_limit
|
|
118
|
+
0, // delay
|
|
119
|
+
false // wrap = false (quanta die at canvas boundary)
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
emitter: emitter,
|
|
124
|
+
largeObjects: []
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ── Export ───────────────────────────────────────────────────────────────
|
|
129
|
+
|
|
130
|
+
setupParticleWalk3D.OPTIONS = OPTIONS;
|
|
131
|
+
|
|
132
|
+
export { setupParticleWalk3D };
|
|
133
|
+
|