@descix/frqtl-web 0.6.1-p2.1 → 0.6.1-p3.2
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 +11 -10
- package/LICENSE.md +1 -1
- package/README.md +5 -5
- package/dist/dist-manifest.json +14 -12
- package/dist/frqtl/objects/RecipeContext.js +21 -41
- package/dist/frqtl/parts/GraphingDetectorWall.js +1 -1
- package/dist/frqtl/parts/Wall.js +96 -9
- package/dist/frqtl-web.min.js +36 -36
- package/dist/notebooks/notebooks.json +1 -1
- package/dist/sdk.html +3 -2
- package/dist/shim/engine/router.js +44 -18
- package/dist/shim/engine/site-graph.js +146 -6
- package/dist/shim/host/device.js +38 -0
- package/dist/shim/project/index.js +13 -3
- package/dist/shim/project/parts-spelling.js +77 -0
- package/dist/shim/project/record-format.js +96 -4
- package/dist/shim/registry/studio-landing.js +14 -11
- package/llms.txt +8 -8
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -5,7 +5,7 @@ in the browser. Physics comes out of local per-pixel rules — a frame moves one
|
|
|
5
5
|
occupancy, momentum — rather than force equations or wave PDEs. Double-slit fringes, wave interference
|
|
6
6
|
and blackbody spectra are computed live from the automaton, not replayed.
|
|
7
7
|
|
|
8
|
-
`0.6.1-
|
|
8
|
+
`0.6.1-p3.2` (npm dist-tag `next`). The node twin is `@descix/frqtl-node` (the same modules,
|
|
9
9
|
plus `bootNode` and the hosted eyes).
|
|
10
10
|
|
|
11
11
|
## Install
|
|
@@ -14,11 +14,11 @@ plus `bootNode` and the hosted eyes).
|
|
|
14
14
|
## See it run immediately
|
|
15
15
|
Open this URL, or embed it in a claude.ai artifact iframe (self-contained):
|
|
16
16
|
|
|
17
|
-
https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-
|
|
17
|
+
https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-p3.2/dist/artifact/double-slit.html
|
|
18
18
|
|
|
19
19
|
and the one-file form (a `<script>` tag, global `FRQTL`) booting a 3D sun:
|
|
20
20
|
|
|
21
|
-
https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-
|
|
21
|
+
https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-p3.2/dist/artifact/sun.html
|
|
22
22
|
|
|
23
23
|
## A scene is a sketch
|
|
24
24
|
A scene is an ES module whose default export is `buildExperiment(exp)`. Its first statement is the
|
|
@@ -44,8 +44,8 @@ refused by name), and `await recipeContext.setDeclared(name, patch)` changes one
|
|
|
44
44
|
`parts/<NewKind>.js` (class renamed, imports rewritten to package specifiers), points the entry at it and re-runs in place.
|
|
45
45
|
`runner.declared` rows read `inParts` and `module`.
|
|
46
46
|
|
|
47
|
-
Read a real one before writing your own: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-
|
|
48
|
-
rung is a file under `dist/frqtl/scenes/`), and a part: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-
|
|
47
|
+
Read a real one before writing your own: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-p3.2/dist/frqtl/scenes/double-slit.js` (every walk-through
|
|
48
|
+
rung is a file under `dist/frqtl/scenes/`), and a part: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-p3.2/dist/frqtl/parts/DetectorWall.js`.
|
|
49
49
|
|
|
50
50
|
## Boot it — the two doors (`@descix/frqtl-web/boot`)
|
|
51
51
|
bootScene(mount, buildExperiment, { renderer: 'p5' | 'three', seed, onTick, render })
|
|
@@ -70,12 +70,13 @@ imports `./boot`, `./registry`, `./project`, `./host-view` or `./site-graph` by
|
|
|
70
70
|
row, so read the manifest from the same root: `new URL('dist-manifest.json', root)`. A page that holds only its map
|
|
71
71
|
recovers the root through `FRQTL_WEB_HOST_SPECIFIERS`: `imports[row.specifier]` minus `row.libPath`.
|
|
72
72
|
The root is an absolute URL or starts with `/`, `./` or `../`. A sketch held as text boots as `bootProject(mount, sketchProject(text))`.
|
|
73
|
-
Or skip the map: `<script src="https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-
|
|
73
|
+
Or skip the map: `<script src="https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-p3.2/dist/frqtl-web.min.js"></script>` then `FRQTL.bootScene(…)`,
|
|
74
74
|
`FRQTL.Wall`, …
|
|
75
75
|
|
|
76
76
|
String kinds: `exp.addObject('Wall', props)` resolves the kind in the SCENE's realm (the frame the scene
|
|
77
77
|
runs in). A host that drives a scene in an iframe passes the string through that frame's `recipeContext`;
|
|
78
|
-
it never
|
|
78
|
+
it never resolves a kind in its own document, whose classes (`./parts` and `./project` register the published
|
|
79
|
+
parts there too) are not the frame's.
|
|
79
80
|
|
|
80
81
|
## Exports
|
|
81
82
|
| subpath | what |
|
|
@@ -83,11 +84,11 @@ it never imports the registry into its own document, where no kind is registered
|
|
|
83
84
|
| `.` | the parts (`Wall`, `SphereEmitter`, `Tunnel`, `FrqtlVision`, …), `bootScene`, `bootProject`, `engine`, `engineState`, `FrqtlCapture`, `RenderStages`, `FieldBuilder`, `CaptureEnvelope`, `validateRendererProvider` |
|
|
84
85
|
| `./boot` | `bootScene`, `bootProject` (in node it throws naming `@descix/frqtl-node`) |
|
|
85
86
|
| `./parts`, `./parts/*` | the parts barrel; one part = one file |
|
|
86
|
-
| `./project` | `FRQTL_WEB_SPECIFIERS`, `libPathOf`, `importMapFor`, `pageImportMapFor`, `FRQTL_WEB_HOST_SPECIFIERS`, `linkProject`, `sketchProject`, `SKETCH_ENTRY`, `projectIdentity`, `MANIFEST_FILE`, `MANIFEST_KEYS`, `normalizeManifest`, `parseManifest`, `serializeManifest`, `manifestFor`, `RECORD_FILES`, `RECORD_KEYS`, `CHANGE_KEYS`, `OPS`, `BY`, `CLIP_SECONDS`, `CLIP_NAME`, `clipName`, `jsonText`, `recordFolderFaults` |
|
|
87
|
+
| `./project` | `FRQTL_WEB_SPECIFIERS`, `libPathOf`, `importMapFor`, `pageImportMapFor`, `FRQTL_WEB_HOST_SPECIFIERS`, `linkProject`, `sketchProject`, `SKETCH_ENTRY`, `projectIdentity`, `MANIFEST_FILE`, `MANIFEST_KEYS`, `normalizeManifest`, `parseManifest`, `serializeManifest`, `manifestFor`, `RECORD_FILES`, `RECORD_KEYS`, `CHANGE_KEYS`, `OPS`, `BY`, `CLIP_SECONDS`, `CLIP_NAME`, `clipName`, `jsonText`, `rowFaults`, `recordFolderFaults`, `applyRows` (stands alone: no other import is needed) |
|
|
87
88
|
| `./registry` | the walk-through rungs, the showcase roster, the scene list (`sceneGroups`), `projectOf(id, { mode })` → `{ manifest, files, renderState }`, a showcase tile's link (`showcaseHref(row)` relative to the serving site, `showcaseUrl(row)` absolute on `SHOWCASE_SITE.origin`; `row` is an element of the same imported `EXHIBITS`, and the link carries the row's effective mode on a multi-mode rung), and how STUDIO resolved the link it opened with (`STUDIO_LANDING_ATTR` on `<html>`, a `STUDIO_LANDING_OUTCOMES` id) |
|
|
88
89
|
| `./kinds` | `registerKind`, `kindNamed`, `kindOf` (the parent's row, frozen), `registeredKinds` — a composed fork registers its renamed class |
|
|
89
90
|
| `./host-view` | `declareHostView`, `HOST_VIEW_OUTCOMES`, `CONTRACT_VIOLATIONS`, `HOST_SDK_SCRIPT` — the DeSciX host-view declarer an app calls once, under its own policy |
|
|
90
|
-
| `./site-graph` | `SITE_GRAPH_DIR`, `SITE_BUILD_ATTR`, `SITE_BUILD_ID_RE`, `STATIC_APP_PAGE`, `HOST_PROVIDED_ATTR` — the static site's shape (graph directory, build-stamp attribute, build id pattern, IDE entry page, the attribute declaring a file host-provided), for a reader of a served site (both packages) |
|
|
91
|
+
| `./site-graph` | `SITE_GRAPH_DIR`, `SITE_BUILD_ATTR`, `SITE_BUILD_ID_RE`, `siteBuildStampOf`, `STATIC_APP_PAGE`, `HOST_PROVIDED_ATTR`, `SITE_PLACEMENTS`, `SITE_ENTRY_PAGES`, `isSiteEntry`, `siteGraphFaults` — the static site's shape (graph directory, build-stamp attribute, build id pattern and its reader, IDE entry page, the attribute declaring a file host-provided, the graph directory of each placed package, the entry pages) and the rule that a served graph is the placed releases' bytes, for a reader of a served site (both packages) |
|
|
91
92
|
| `./shim/controls/registry.js`, `./shim/render/sun-look.js`, `./compat/renderer/display-slot.js`, `./compat/renderer/orbit-bag.js`, `./objects/setup/_collisionMatrixLanes.js`, `./compat/engine.js` | the six non-part modules a scene may import (the rows of `FRQTL_WEB_SPECIFIERS`) |
|
|
92
93
|
| `./objects/objects/tagger.js`, `./objects/schema/index.js`, `./shim/render/heat-colormap.js`, `./objects/schema/valueNormalizer.js`, `./objects/objects/Box.js`, `./objects/objects/QuantumEmitter.js`, `./shim/expr/ast-schema.js`, `./objects/objects/actionCompiler.js`, `./objects/v1-replacements.js`, `./objects/objects/slitLinerScatter.js`, `./objects/setup/setupSphereEmitter3D.js`, `./objects/objects/directedRedirectProgram.js`, `./compat/renderer/lo-drawn-center.js`, `./objects/setup/setupTunnelPointExit.js`, `./objects/constants/WallBehaviors.js`, `./objects/objects/absorbRadiation.js`, `./objects/geometry/SlabFace.js` | the 17 part-internal modules a forked part file imports (the `tier: 'part-internal'` rows of `FRQTL_WEB_SPECIFIERS`): not a scene API — the linker admits them only from a `parts/*.js` file — and they move with the parts |
|
|
93
94
|
| `./dist-manifest.json` | sha256 of every dist file (check a self-hosted copy against it) |
|
|
@@ -126,6 +127,6 @@ Everything is a Frame (recursive); there is no separate "particle" class.
|
|
|
126
127
|
- The published build is WASM-only on the engine side (compiled surface).
|
|
127
128
|
|
|
128
129
|
## Curated notebooks
|
|
129
|
-
Index: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-
|
|
130
|
+
Index: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.1-p3.2/dist/notebooks/notebooks.json`
|
|
130
131
|
|
|
131
132
|
## No account, credits, or tokens are needed for anything above.
|
package/LICENSE.md
CHANGED
|
@@ -389,7 +389,7 @@ For GUIs, use an "About box" with similar information.
|
|
|
389
389
|
|
|
390
390
|
**The Original License is not displaced.** Nothing in this Agreement relieves You of any obligation the Original License imposes on Pre-existing Material. By way of example, if Pre-existing Material is licensed under the Mozilla Public License, its file-level copyleft, notice and source-availability obligations continue to bind You for that material; this Agreement neither absolves You of them nor extends them to Covered Works.
|
|
391
391
|
|
|
392
|
-
**This Agreement is not displaced.** No Original License shall be read to invalidate, override, relicense or extend its terms to any Covered Work or Community IP. If You combine, link or otherwise mix a Covered Work with Pre-existing Material whose Original License would, by its terms, purport to govern the combination or require the Covered Work to be licensed under that Original License (by way of example, the GNU General Public License), You are in breach of this Agreement from the moment of the combination: Your license under this Agreement terminates as to that combination under Clause 7, You lose the protections this Agreement affords Members with respect to it, and the Original License shall not be read to apply to the Covered Work or Community IP, whose terms remain those of this Agreement.
|
|
392
|
+
**This Agreement is not displaced.** No Original License shall be read to invalidate, override, relicense or extend its terms to any Covered Work or Community IP. If You combine, link or otherwise mix a Covered Work with Pre-existing Material whose Original License would, by its terms, purport to govern the combination or require the Covered Work to be licensed under that Original License (by way of example, the GNU General Public License), You are in breach of this Agreement from the moment of the combination: Your license under this Agreement terminates as to that combination under Clause 7 of the DCSL (Section 3.1), You lose the protections this Agreement affords Members with respect to it, and the Original License shall not be read to apply to the Covered Work or Community IP, whose terms remain those of this Agreement.
|
|
393
393
|
|
|
394
394
|
**Marking.** An adopter that places this Agreement in a collection containing Pre-existing Material shall place it within, or clearly identify, the directories or files it covers, so that no Pre-existing Material is represented as licensed under this Agreement.
|
|
395
395
|
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ comes out of local per-pixel rules — a frame moves one pixel per tick, single
|
|
|
5
5
|
rather than force equations. Interference, blackbody spectra and atom-like binding emerge from the
|
|
6
6
|
automaton.
|
|
7
7
|
|
|
8
|
-
`0.6.1-
|
|
8
|
+
`0.6.1-p3.2` (npm dist-tag `next`). The node twin is `@descix/frqtl-node` — the same
|
|
9
9
|
modules, built from the same source.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
@@ -124,8 +124,8 @@ differ from `mode`: `declareHostView` throws a TypeError when they are the same
|
|
|
124
124
|
`HOST_SDK_SCRIPT` beside its page.
|
|
125
125
|
|
|
126
126
|
String kinds — `exp.addObject('Wall', props)` — resolve in the SCENE's realm. A host driving a scene in
|
|
127
|
-
an iframe passes the string through that frame's `recipeContext`; it never
|
|
128
|
-
|
|
127
|
+
an iframe passes the string through that frame's `recipeContext`; it never resolves a kind in its own
|
|
128
|
+
document, whose classes (`./parts` and `./project` register the published parts there too) are not the frame's.
|
|
129
129
|
|
|
130
130
|
## Exports
|
|
131
131
|
|
|
@@ -134,11 +134,11 @@ into its own document, where no kind is registered.
|
|
|
134
134
|
| `.` | the parts, `bootScene`, `bootProject`, `engine`, `engineState`, `FrqtlCapture`, `RenderStages`, `FieldBuilder`, `CaptureEnvelope`, `validateRendererProvider` |
|
|
135
135
|
| `./boot` | `bootScene`, `bootProject` (in node it throws, naming `@descix/frqtl-node`) |
|
|
136
136
|
| `./parts`, `./parts/*` | the parts barrel; one part = one file |
|
|
137
|
-
| `./project` | `FRQTL_WEB_SPECIFIERS`, `libPathOf`, `importMapFor`, `pageImportMapFor`, `FRQTL_WEB_HOST_SPECIFIERS`, `linkProject`, `sketchProject`, `SKETCH_ENTRY`, `projectIdentity`, `MANIFEST_FILE`, `MANIFEST_KEYS`, `normalizeManifest`, `parseManifest`, `serializeManifest`, `manifestFor`, `RECORD_FILES`, `RECORD_KEYS`, `CHANGE_KEYS`, `OPS`, `BY`, `CLIP_SECONDS`, `CLIP_NAME`, `clipName`, `jsonText`, `recordFolderFaults` |
|
|
137
|
+
| `./project` | `FRQTL_WEB_SPECIFIERS`, `libPathOf`, `importMapFor`, `pageImportMapFor`, `FRQTL_WEB_HOST_SPECIFIERS`, `linkProject`, `sketchProject`, `SKETCH_ENTRY`, `projectIdentity`, `MANIFEST_FILE`, `MANIFEST_KEYS`, `normalizeManifest`, `parseManifest`, `serializeManifest`, `manifestFor`, `RECORD_FILES`, `RECORD_KEYS`, `CHANGE_KEYS`, `OPS`, `BY`, `CLIP_SECONDS`, `CLIP_NAME`, `clipName`, `jsonText`, `rowFaults`, `recordFolderFaults`, `applyRows` (stands alone: no other import is needed) |
|
|
138
138
|
| `./registry` | the walk-through rungs, the showcase roster, the scene list (`sceneGroups`), `projectOf`, a showcase tile's link (`showcaseHref(row)` relative to the serving site, `showcaseUrl(row)` absolute on `SHOWCASE_SITE.origin`; `row` is an element of the same imported `EXHIBITS`, and the link carries the row's effective mode on a multi-mode rung), and how STUDIO resolved the link it opened with (`STUDIO_LANDING_ATTR` on `<html>`, a `STUDIO_LANDING_OUTCOMES` id) |
|
|
139
139
|
| `./kinds` | `registerKind`, `kindNamed`, `kindOf`, `registeredKinds` — the kind registry a composed fork registers in |
|
|
140
140
|
| `./host-view` | `declareHostView`, `HOST_VIEW_OUTCOMES`, `CONTRACT_VIOLATIONS`, `HOST_SDK_SCRIPT` — the DeSciX host-view declarer an app calls under its own policy (below) |
|
|
141
|
-
| `./site-graph` | `SITE_GRAPH_DIR`, `SITE_BUILD_ATTR`, `SITE_BUILD_ID_RE`, `STATIC_APP_PAGE`, `HOST_PROVIDED_ATTR` — the static site's shape (graph directory, build-stamp attribute, build id pattern, IDE entry page, the attribute declaring a file host-provided), for a reader of a served site (both packages) |
|
|
141
|
+
| `./site-graph` | `SITE_GRAPH_DIR`, `SITE_BUILD_ATTR`, `SITE_BUILD_ID_RE`, `siteBuildStampOf`, `STATIC_APP_PAGE`, `HOST_PROVIDED_ATTR`, `SITE_PLACEMENTS`, `SITE_ENTRY_PAGES`, `isSiteEntry`, `siteGraphFaults` — the static site's shape (graph directory, build-stamp attribute, build id pattern and its reader, IDE entry page, the attribute declaring a file host-provided, the graph directory of each placed package, the entry pages) and the rule that a served graph is the placed releases' bytes, for a reader of a served site (both packages) |
|
|
142
142
|
| `./shim/controls/registry.js`, `./shim/render/sun-look.js`, `./compat/renderer/display-slot.js`, `./compat/renderer/orbit-bag.js`, `./objects/setup/_collisionMatrixLanes.js`, `./compat/engine.js` | the six non-part modules a scene may import (the rows of `FRQTL_WEB_SPECIFIERS`) |
|
|
143
143
|
| `./objects/objects/tagger.js`, `./objects/schema/index.js`, `./shim/render/heat-colormap.js`, `./objects/schema/valueNormalizer.js`, `./objects/objects/Box.js`, `./objects/objects/QuantumEmitter.js`, `./shim/expr/ast-schema.js`, `./objects/objects/actionCompiler.js`, `./objects/v1-replacements.js`, `./objects/objects/slitLinerScatter.js`, `./objects/setup/setupSphereEmitter3D.js`, `./objects/objects/directedRedirectProgram.js`, `./compat/renderer/lo-drawn-center.js`, `./objects/setup/setupTunnelPointExit.js`, `./objects/constants/WallBehaviors.js`, `./objects/objects/absorbRadiation.js`, `./objects/geometry/SlabFace.js` | the 17 part-internal modules a forked part file imports (the `tier: 'part-internal'` rows of `FRQTL_WEB_SPECIFIERS`): not a scene API — the linker admits them only from a `parts/*.js` file — and they move with the parts |
|
|
144
144
|
| `./dist-manifest.json` | sha256 of every dist file |
|
package/dist/dist-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descix/frqtl-web",
|
|
3
|
-
"version": "0.6.1-
|
|
3
|
+
"version": "0.6.1-p3.2",
|
|
4
4
|
"files": {
|
|
5
5
|
"artifact/double-slit.html": "25d93abfd0961a5e063429395801160a599fbb8e92c774a3128d5b0ba4ac415a",
|
|
6
6
|
"artifact/sun.html": "4ec3515a3a94553bb862a7894ecd43757004fd8087ba60ce97622a410b615383",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"experiments/empty/index.html": "063a8a4b23c4242d67a20a442235c798f18fdea1a3a8aebb29872a88030c2e30",
|
|
11
11
|
"fat/pkg-web/egpt_wasm.js": "4e9c3f04fcfe7b0a481dadd9a87f9bf76c6f34741ff1cdf57fecc2e76c56b8e5",
|
|
12
12
|
"fat/pkg-web/egpt_wasm_bg.wasm": "e204498ac7439c294653476c0d214345713e6170819281b27bbbcba217a5a5e9",
|
|
13
|
-
"frqtl-web.min.js": "
|
|
13
|
+
"frqtl-web.min.js": "6ba64b954074e1dbb5677e317c9bf00b9914374a66f6c4853e87c5839ace91f7",
|
|
14
14
|
"frqtl/assets/vendor/acorn.LICENSE": "76a876cf886ff9be2a8b5e2e86514fed06223c8c9f0c1e9ee9606e93841e00b7",
|
|
15
15
|
"frqtl/assets/vendor/acorn.PINNED.json": "52d5c4cf628a586aec54f780ab6b8d22ae7c22cfb290d0d86c2f589f3106b101",
|
|
16
16
|
"frqtl/assets/vendor/acorn.mjs": "efb0124a960b34d53f9928c4926bfcfd300bb6a3d7ab64ee949b3a8bed1c7e5f",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"frqtl/experiments/_shared/retired-globals.js": "966764b68e011fbf4183b74df8ade57596ec8114694f29d005784d7fe619df6b",
|
|
178
178
|
"frqtl/objects/FrqtlApp.js": "e3232b09eb576427df2a52393a5603b4c084d6edba5667b03afb161fd6d76b9b",
|
|
179
179
|
"frqtl/objects/ObjectFactory.js": "a8f050ce61b7ab9c9b4f81e9eeaebf05c3cc0b532c741ce93d6e952489772b11",
|
|
180
|
-
"frqtl/objects/RecipeContext.js": "
|
|
180
|
+
"frqtl/objects/RecipeContext.js": "4d53e1d8a48f4567aeb882abac6f46cd649a51a3af4b543a6bec7ce74e77d7a8",
|
|
181
181
|
"frqtl/objects/collectors/DataCollector.js": "8736d6cb77eec36ce2adcf2bc3b0d2436eeb70a73b77182ff053efdc6ca071df",
|
|
182
182
|
"frqtl/objects/constants/WallBehaviors.js": "a05c6e06923962e2cc2cf7204131e5d20bf83c5c8e85fbb13867872040345e40",
|
|
183
183
|
"frqtl/objects/geometry/SlabFace.js": "847921b124d3bc1692e88c363c087d392a1baa7c652a3a61e381d0f8a8342e57",
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
"frqtl/parts/FrqtlControlOverlay.js": "f862b1529265224aa96878b56b0c1c6e65683ba3fd6b517df86e17e92147f9c4",
|
|
251
251
|
"frqtl/parts/FrqtlControlsPanel.js": "792d03dea218bdc335ba7e04362be620edbfa331bed9de087d61942299728cc1",
|
|
252
252
|
"frqtl/parts/FrqtlVision.js": "118d0874249fa55783b196fd01297b3347951267a4add93381433a72c46e8622",
|
|
253
|
-
"frqtl/parts/GraphingDetectorWall.js": "
|
|
253
|
+
"frqtl/parts/GraphingDetectorWall.js": "a2fef24c2ef00416792c4b46a09c9544601e45e84593fa2287d2311f27a1bcee",
|
|
254
254
|
"frqtl/parts/LargeObject.js": "d6cae738b30965f3eba4be4399fb4410f17afc3267b51e3ad9e1ba7423e17922",
|
|
255
255
|
"frqtl/parts/LightColor.js": "8637e5a09bbad3a4fdd2034ccb44dfc1fda743e29b12b4c685a64b9e1df28daa",
|
|
256
256
|
"frqtl/parts/LiveChart.js": "8bd0b862d2f7a4e818ae9cfc47e5e0f56eb97ea0a00fb836bba3f2374c12a1ce",
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
"frqtl/parts/SphereEmitter.js": "645664f5a20924b777d9b4ad6fef6338e7de251d62c7f8a4c93e6b0f97b47d4a",
|
|
264
264
|
"frqtl/parts/Trace.js": "f9d91bb9435bc5fabfd7bfdbfbf3f3ae34e2338090251d9e9d6c11abc2ed25fb",
|
|
265
265
|
"frqtl/parts/Tunnel.js": "66bfca3d3d88ebf9a8cb7aa248b92cfc7d78a278449830b03e6b2700a21df891",
|
|
266
|
-
"frqtl/parts/Wall.js": "
|
|
266
|
+
"frqtl/parts/Wall.js": "34f8e4f5143925b42e42561eb54e93b0c1244debeb5c07a914beba3e8c4c75fd",
|
|
267
267
|
"frqtl/parts/index.js": "70b8e227e09663889f4c7942d385f843d977579765723f829880fd6e9868ac53",
|
|
268
268
|
"frqtl/scenes/absorbing-wall-3d.js": "722bb433142833f03150052b95039686aba0d9db510a5ff13fad95b5f17e0cf8",
|
|
269
269
|
"frqtl/scenes/absorbing-wall.js": "0a47ca64e56481841339cd5882cf0e54ec7c14d87a4306d016ead1ff26591197",
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
"notebooks/iso-number-theory-four-views.html": "55f8655078a8bd4c35c22531177a7a035661183683d6bb193b60e52298233baa",
|
|
336
336
|
"notebooks/iso-pi-log-fraction-loop.html": "17112759c5328001009b95f239f35532d8d2ac66742bc5af06f38da71323392a",
|
|
337
337
|
"notebooks/matrix.html": "d52d62a45fcdb2a9754664e280f4c97f4590ec35046b4997b4700afbbd941025",
|
|
338
|
-
"notebooks/notebooks.json": "
|
|
338
|
+
"notebooks/notebooks.json": "d9e9c21ae1dd87e28183d3aed64af58be200143ba0ac45d5159a82f57ed6d89d",
|
|
339
339
|
"notebooks/polynomials.html": "c990a386756b7e83a565e1246549a1241fa9757e07a30a724c73d691be2a53ce",
|
|
340
340
|
"notebooks/prime-composite.html": "57469ba011c1a1082a614647acde985340fb8d5286fedc6fb0fd76f56d0e26e9",
|
|
341
341
|
"notebooks/rational-core.html": "62817c4f3d8aa7c9aa7b26e7adca54c3a648539de74daf5fdfa2a9ebb9327522",
|
|
@@ -347,7 +347,7 @@
|
|
|
347
347
|
"notebooks/stats.html": "360db52d77ef46c690e7c865a7ce672d5032b916a0a0796f6070d5f17b03132b",
|
|
348
348
|
"notebooks/transcendentals.html": "1dfc5d40f0e3e6cccc785fb73d73ef82e24048d7affd10143370779ef2032b8c",
|
|
349
349
|
"notebooks/view-vendored-d3.html": "debeeef830f8c328b3b6e13b0b8fe26021ba55802b89d8dbe78b8a0c6c002eac",
|
|
350
|
-
"sdk.html": "
|
|
350
|
+
"sdk.html": "781acc2102e912379f48203d6bbf3592d65a159f9eed27f928c719bfe9232a6e",
|
|
351
351
|
"shim/bundle/index.js": "edc501a039ce47102657604df71fbc17ba3e4760ca087055351231c7469f5c50",
|
|
352
352
|
"shim/bundle/indexHtml.js": "2c4fbc502bb33fce93596cee19e143a58bb63c18d0b18ea597f81610e3a9a027",
|
|
353
353
|
"shim/bundle/zip.js": "00f7b5fb5f36ff40a59d86758c503d9d7fb43949c1b5a4f2e7367c43d92786f9",
|
|
@@ -357,12 +357,13 @@
|
|
|
357
357
|
"shim/engine/artifact-shell.js": "f23c327500f8174b12d464868f6ec9c1701e7a9a5faa1c43a2ddafc3191dc38c",
|
|
358
358
|
"shim/engine/boot-phases.js": "c6e12e12824bcf6f1a289f46e41c898a5416c80c131594525145aae9a3eefbfa",
|
|
359
359
|
"shim/engine/engine-stack-boot.js": "0abf57dcff2ca2bb025c787a17875d49d54d9218ac08c78cb9c678dbb6118d08",
|
|
360
|
-
"shim/engine/router.js": "
|
|
361
|
-
"shim/engine/site-graph.js": "
|
|
360
|
+
"shim/engine/router.js": "1c8bed954aecfcd06d1344051d8489f0f040967f9d0879ec7e7a0d1e58045d2c",
|
|
361
|
+
"shim/engine/site-graph.js": "b0d2569c67516d08bba17a152d5d3bfa0b036666eda7f11df74b4d68854e1b93",
|
|
362
362
|
"shim/experiment-frame/index.js": "5a0219aaa225d8f808c405b08623ce85ada37d83fb4f55f983db3303e431e47f",
|
|
363
363
|
"shim/expr/ast-schema.js": "4f1133b887639bbd86fab976292323bf4a955cdc873ff7ca8e8a8eb3b416923f",
|
|
364
364
|
"shim/field-descriptor/index.js": "6647d57d1523519114adc0a5cb66335ec5121c39ab294b9c97bdfb9e5d7f61e0",
|
|
365
365
|
"shim/frame-data/index.js": "df6957b0b4a8e0ee0035bc970647b90089b421ae7f05911cc047d48457164be6",
|
|
366
|
+
"shim/host/device.js": "85470e7c787398cb91516b724e884ac50104d56330ba7ff876308b6fb4b7b532",
|
|
366
367
|
"shim/host/host-view.js": "feec2f5fdc318e75cd01768c24891f85d2694a269696fcfffd9567d31983cf43",
|
|
367
368
|
"shim/host/index.js": "fade4b171218965570aa2e67e841920ebb3d972ff15e1cfa0394fd3fa123d82c",
|
|
368
369
|
"shim/index.js": "96165c6161ffddbace0be0cde0b3a83943298531537dd2cc9c6e281b8274ff19",
|
|
@@ -388,13 +389,14 @@
|
|
|
388
389
|
"shim/page-params/index.js": "c58732b8127da8c2b4ecfd922bf46a6c9a5e9ab7017f41c095a6ec937011f0fa",
|
|
389
390
|
"shim/project/fork.js": "07555f24c7e6d1bbe723853bc09ad570b9cd36cef248a07e98e7398d41ac70da",
|
|
390
391
|
"shim/project/identity.js": "8d3e0bb9df75eecf7d11a1ea7948ff66c559973a891574d0b208c9e8f8faf504",
|
|
391
|
-
"shim/project/index.js": "
|
|
392
|
+
"shim/project/index.js": "5121dd4c18aeea190d2a998fa7a13f86cb36b13cf043f8c549963c1ae51ba26e",
|
|
392
393
|
"shim/project/link.js": "0e3fc878bc45d9916baacd7cf129687ec6e82efd4f6f5036e4697180b3d0f87a",
|
|
393
394
|
"shim/project/manifest.js": "442267af07ae1b977ff6aeaca49d98ce82b77f548cfdd1ed0f258b3429d75f31",
|
|
394
395
|
"shim/project/parts-module.js": "b08e0149f086640692e1b2ff8e0d7ae0379c2bc934a0891418de5c2b8c0e8e60",
|
|
396
|
+
"shim/project/parts-spelling.js": "4cc7b8a2f0aa1f3ad4c1c3cf15f74b2860a94ae2214dbef78d31c85ff8916cfe",
|
|
395
397
|
"shim/project/parts-writer.js": "121fa67261d6f366190c9ac4961fceed2f26ca7f35cf3fbffc767829afc69978",
|
|
396
398
|
"shim/project/read-text.js": "b89bd70e3a271e1f42c8ce9427a20cdd9a4c4c9c31b64c49ff1f56b095620136",
|
|
397
|
-
"shim/project/record-format.js": "
|
|
399
|
+
"shim/project/record-format.js": "87d5cc2eae8ff600db1db58a0e0047819f7c9839ff702acdedc366c7647eb0ef",
|
|
398
400
|
"shim/project/specifiers.js": "288e5e06e53b873449190f6f85855177a72e52623bd11eef016acafb8095d829",
|
|
399
401
|
"shim/registry/copy-gate.js": "cfbf52669c849b8837b326f2743458f1ead0720cad51a6c6d409c9bd6c7f9495",
|
|
400
402
|
"shim/registry/exhibits.js": "e137951429929dae6c38e996546b66dd19b575ee4f0aafbddf28096c847a27fc",
|
|
@@ -402,7 +404,7 @@
|
|
|
402
404
|
"shim/registry/scene-roster.js": "318fe373f71b1c58d05425693f2fad4bd5368f6095b65817c6d637430a0bfb73",
|
|
403
405
|
"shim/registry/scene-source.js": "c9c4b48c24d4b1ebee1549a7891a1ba708909b94b9403ce28eefbd902cacf49f",
|
|
404
406
|
"shim/registry/showcase-link.js": "daf5c1426aeb3c578bace5e0edea9ba2538cd82336d2cdc944e5fed6decd7551",
|
|
405
|
-
"shim/registry/studio-landing.js": "
|
|
407
|
+
"shim/registry/studio-landing.js": "bd81ad9333332de4a29b3121f963edd354450c75c97f4f43170a98c2dcceb7f3",
|
|
406
408
|
"shim/registry/walkthrough.js": "8f8b6f59e9e81c67c9c62f8fb271eee2e4d6e1fba6e116b227a2f1e3f9930230",
|
|
407
409
|
"shim/render-state/apply.js": "94a9e60cb1722c9a82aa00f2f161fd65e6f438147333856a786e42a4ad5b7064",
|
|
408
410
|
"shim/render-state/index.js": "72a6a3dcd8037893cb8fbd7ef32b126770e7efaec70847f8e4f2915ddb690b43",
|
|
@@ -74,6 +74,7 @@ import { ObjectSchema } from './schema/index.js';
|
|
|
74
74
|
import { kindOf } from './kinds.js';
|
|
75
75
|
import { linkProject } from '../../shim/project/link.js';
|
|
76
76
|
import { patchParts, PARTS_EXPORT, entryKeys, entryLiteral } from '../../shim/project/parts-writer.js';
|
|
77
|
+
import { spellRect, spellCenter, captureCenter } from '../../shim/project/parts-spelling.js';
|
|
77
78
|
import { moduleOfKind, PARTS_SPECIFIER } from '../../shim/project/parts-module.js';
|
|
78
79
|
import { forkPartText, FORK_REFUSED } from '../../shim/project/fork.js';
|
|
79
80
|
import { readText } from '../../shim/project/read-text.js';
|
|
@@ -347,47 +348,22 @@ import { Record, openRecordOf } from './record/Record.js';
|
|
|
347
348
|
var _JSON = function (v) { return JSON.stringify(v); };
|
|
348
349
|
|
|
349
350
|
/**
|
|
350
|
-
* Spell a touched
|
|
351
|
-
*
|
|
352
|
-
*
|
|
353
|
-
* 6-tuple stands. A 4-tuple equal to the baseline's is not written (no literalizing an untouched expression).
|
|
354
|
-
* Mutates and returns `props`.
|
|
351
|
+
* Spell a touched value in the entry's OWN form, reading the form off the held TEXT: the rule is
|
|
352
|
+
* lib/shim/project/parts-spelling.js spellRect / spellCenter (applyRows asks the same rule of a parts block).
|
|
353
|
+
* Each mutates and returns `props`.
|
|
355
354
|
*/
|
|
356
355
|
function _spell(text, name, kind, props, baseline) {
|
|
357
|
-
|
|
358
|
-
if (!derived.length) { return props; }
|
|
359
|
-
var spelled = entryKeys(text, name);
|
|
360
|
-
var R4 = ObjectSchema.RECT_TUPLE[4], R6 = ObjectSchema.RECT_TUPLE[6];
|
|
361
|
-
Object.keys(props).forEach(function (f) {
|
|
362
|
-
var v = props[f];
|
|
363
|
-
var rows = derived.filter(function (d) { return d.field === f && d.tuple === 6 && spelled.indexOf(d.name) !== -1; });
|
|
364
|
-
if (!rows.length || !Array.isArray(v) || v.length !== 6) { return; }
|
|
365
|
-
var b = Array.isArray(baseline[f]) && baseline[f].length === 6 ? baseline[f] : null;
|
|
366
|
-
var four = R4.map(function (k) { return v[R6.indexOf(k)]; });
|
|
367
|
-
if (b && _JSON(four) === _JSON(R4.map(function (k) { return b[R6.indexOf(k)]; }))) { delete props[f]; }
|
|
368
|
-
else { props[f] = four; }
|
|
369
|
-
rows.forEach(function (d) {
|
|
370
|
-
var nv = v[R6.indexOf(d.key)];
|
|
371
|
-
if (!b || nv !== b[R6.indexOf(d.key)]) { props[d.name] = nv; }
|
|
372
|
-
});
|
|
373
|
-
});
|
|
374
|
-
return props;
|
|
356
|
+
return spellRect(props, { kind: kind, baseline: baseline, entryKeys: function () { return entryKeys(text, name); } });
|
|
375
357
|
}
|
|
376
358
|
|
|
377
|
-
/**
|
|
378
|
-
* Spell a touched `center` in the entry's OWN arity: two numbers when the entry
|
|
379
|
-
* spells two (a literal, or an array expression — entryLiteral's `length`) and the live z is 0; otherwise the
|
|
380
|
-
* live [x, y, z] (an entry spelled three, a 3D hand off z 0, an entry whose center is not an array). The
|
|
381
|
-
* read-back (_verifyWritten) guards every case. Mutates and returns `props`.
|
|
382
|
-
*/
|
|
383
359
|
function _spellCenter(text, name, props) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
360
|
+
return spellCenter(props, {
|
|
361
|
+
entryKeys: function () { return entryKeys(text, name); },
|
|
362
|
+
centerLength: function () {
|
|
363
|
+
var r = entryLiteral(text, name, 'center');
|
|
364
|
+
return r.literal ? (Array.isArray(r.value) ? r.value.length : null) : (r.length === undefined ? null : r.length);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
391
367
|
}
|
|
392
368
|
|
|
393
369
|
/**
|
|
@@ -403,8 +379,8 @@ import { Record, openRecordOf } from './record/Record.js';
|
|
|
403
379
|
Object.keys(written).forEach(function (k) {
|
|
404
380
|
var r = entryLiteral(text, name, k);
|
|
405
381
|
decl[k] = r.literal ? r.value : undefined;
|
|
406
|
-
// A two-number center declares z 0
|
|
407
|
-
if (k === 'center' && Array.isArray(decl[k]) && decl[k].length === 2) { decl[k] = decl[k]
|
|
382
|
+
// A two-number center declares z 0: read it in its capture form through the one inverse.
|
|
383
|
+
if (k === 'center' && Array.isArray(decl[k]) && decl[k].length === 2) { decl[k] = captureCenter(decl[k]); }
|
|
408
384
|
});
|
|
409
385
|
function refuse(k, declared, liveV) {
|
|
410
386
|
refused.push({ op: 'set', name: name, key: k, reason: 'the written text declares ' + _JSON(declared) + ' but the live object is ' +
|
|
@@ -651,8 +627,9 @@ import { Record, openRecordOf } from './record/Record.js';
|
|
|
651
627
|
* `center` patch sets where the entry STARTS. The loop's run state is kept. REFUSES (throws) while a hand
|
|
652
628
|
* made since the last toSketch is unwritten (write it first: await exp.toSketch()), and a `name` patch (the
|
|
653
629
|
* key is the name). `from` and `to` are the patched keys' capture (ObjectSchema.captureProps) before and after the
|
|
654
|
-
* re-run — one form on both sides (a z-slab wall's rect is 6 numbers even when the patch typed 4)
|
|
655
|
-
*
|
|
630
|
+
* re-run — one form on both sides (a z-slab wall's rect is 6 numbers even when the patch typed 4). The patch is
|
|
631
|
+
* written in the entry's own spelling (a rect beside `z`/`depth` as 4 numbers plus those keys; a `center` in the
|
|
632
|
+
* arity the entry spells, three numbers when z is not 0), as a hand's is. With a Record open, its `setDeclared` row carries the same `from`/`to`, written after the re-run.
|
|
656
633
|
*/
|
|
657
634
|
RecipeContext.prototype.setDeclared = async function (name, patch, opts) {
|
|
658
635
|
_requireWorld(this);
|
|
@@ -696,7 +673,10 @@ import { Record, openRecordOf } from './record/Record.js';
|
|
|
696
673
|
from[k] = live[k] === undefined ? null : live[k];
|
|
697
674
|
});
|
|
698
675
|
var entry = this._project.entry;
|
|
676
|
+
// The patch is written in the entry's own spelling, as a hand's is (toSketch's order: rect, then center).
|
|
699
677
|
var spelled = _spell(this._project.files[entry], name, kind, _plain(patch), live);
|
|
678
|
+
if (Array.isArray(spelled.center)) { spelled.center = captureCenter(spelled.center); }
|
|
679
|
+
_spellCenter(this._project.files[entry], name, spelled);
|
|
700
680
|
var r = patchParts(this._project.files[entry], [{ op: 'set', name: name, props: spelled }], { entry: entry });
|
|
701
681
|
if (r.refused.length) {
|
|
702
682
|
throw new Error('[RecipeContext.setDeclared] the sketch text refused the patch: ' +
|
|
@@ -716,7 +696,7 @@ import { Record, openRecordOf } from './record/Record.js';
|
|
|
716
696
|
runner.cameraControl.setOrbit(pose);
|
|
717
697
|
kept.push('cameraPose');
|
|
718
698
|
}
|
|
719
|
-
// `to` is what the re-run declared, in the capture form `from` is in (the
|
|
699
|
+
// `to` is what the re-run declared, in the capture form `from` is in (the text holds the entry's spelling).
|
|
720
700
|
var rebuilt = null;
|
|
721
701
|
this._parts.forEach(function (row, o) { if (row.key === name) { rebuilt = o; } });
|
|
722
702
|
if (!rebuilt) {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* colour washed under the bins, so an un-hit face still reads as a plate and
|
|
37
37
|
* intensity rises monotonically from empty through every bin.
|
|
38
38
|
*
|
|
39
|
-
* Readouts: `getCollisionHistogram()` / `resetHistogram()` / `
|
|
39
|
+
* Readouts: `getCollisionHistogram()` / `resetHistogram()` / `getArrivals()` —
|
|
40
40
|
* inherited from `Wall`, UNCHANGED. `heatCanvas()` returns the ferry canvas.
|
|
41
41
|
*
|
|
42
42
|
* ── ESTIMATION BEFORE RUNNING: when will this plate have counted anything? ───
|
package/dist/frqtl/parts/Wall.js
CHANGED
|
@@ -774,14 +774,26 @@ import { wallBehaviorV2ValuesMap as _wallBehaviorV2ValuesMap, bounceDirectionVal
|
|
|
774
774
|
return out;
|
|
775
775
|
};
|
|
776
776
|
|
|
777
|
+
/** Does the op-program this wall's LargeObject is RUNNING remove the frame it triggers
|
|
778
|
+
* on (`set 0.is_alive = …`)? Read off the program itself — the one statement of what
|
|
779
|
+
* the wall does — never a hand list of behavior names (today: destroy and absorb). On
|
|
780
|
+
* such a wall a frame's listing in `tickData.objects[handle].frames` is not one
|
|
781
|
+
* arrival: the engine collects every frame in the mb_w-padded search rect
|
|
782
|
+
* (ENGINE_CONTRACT §5.1), so a frame is listed alive through its approach ticks and
|
|
783
|
+
* once more on its kill tick. */
|
|
784
|
+
function _runningProgramRemoves(wall) {
|
|
785
|
+
var prog = wall.lo && wall.lo.program;
|
|
786
|
+
return !!(prog && Array.isArray(prog.ops) &&
|
|
787
|
+
prog.ops.some(function (op) { return op && op.set === '0.is_alive'; }));
|
|
788
|
+
}
|
|
789
|
+
|
|
777
790
|
/**
|
|
778
|
-
*
|
|
779
|
-
*
|
|
780
|
-
*
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
*
|
|
784
|
-
* thermostat's activeQuanta read).
|
|
791
|
+
* ZONE-OCCUPANCY readout (loop-polish B): the number of frames THIS wall's
|
|
792
|
+
* engine collect pass listed on the sampled tick — every frame in its search rect
|
|
793
|
+
* (the rect padded by the dimension's mb_w). For a FULL-AREA background wall
|
|
794
|
+
* (collisionBehavior 'nothing' + the count hook) that listing IS the current live
|
|
795
|
+
* population inside the wall — the ONE canonical "how many live" authority (the
|
|
796
|
+
* emission-cap gate and the LiveChart `liveCount` projector read it).
|
|
785
797
|
*
|
|
786
798
|
* Layer 1 (API): dual-lane, mirroring the LiveChart PROJECTOR_SPEC shape —
|
|
787
799
|
* getLiveCount(tickData) — SAMPLE lane (per tick): read
|
|
@@ -794,12 +806,23 @@ import { wallBehaviorV2ValuesMap as _wallBehaviorV2ValuesMap, bounceDirectionVal
|
|
|
794
806
|
* COUNT increment only (bench LO7); counting never moves, kills, or recolors a
|
|
795
807
|
* frame (SU1).
|
|
796
808
|
*
|
|
797
|
-
*
|
|
798
|
-
*
|
|
809
|
+
* Guards: THROWS on a REMOVING wall (destroy / absorb) — there the listing reads
|
|
810
|
+
* (1 + approach-halo ticks) x arrivals, never the arrivals; `getArrivals` is the
|
|
811
|
+
* reader. THROWS on a wall without the count hook (no collected-frames buffer → it
|
|
812
|
+
* would silently report 0 forever).
|
|
799
813
|
* @param {Object} [tickData] — the universe.doTick() result (sample lane).
|
|
800
814
|
* @returns {number}
|
|
801
815
|
*/
|
|
802
816
|
Wall.prototype.getLiveCount = function (tickData) {
|
|
817
|
+
if (_runningProgramRemoves(this)) {
|
|
818
|
+
throw new Error(
|
|
819
|
+
'[Wall.getLiveCount] this wall REMOVES what it hits (collisionBehavior "' +
|
|
820
|
+
this.collisionBehavior + '") — getLiveCount is the zone-occupancy reader of a ' +
|
|
821
|
+
'non-removing wall, and on a removing wall it would count each frame once per ' +
|
|
822
|
+
'approach tick plus once on its kill tick. Read arrivals with ' +
|
|
823
|
+
'wall.getArrivals(tickData) → { total, delta } (the engine\'s own per-wall count).'
|
|
824
|
+
);
|
|
825
|
+
}
|
|
803
826
|
var counts = Array.isArray(this.hooks) && this.hooks.indexOf('count') !== -1;
|
|
804
827
|
if (!counts) {
|
|
805
828
|
throw new Error(
|
|
@@ -818,6 +841,70 @@ import { wallBehaviorV2ValuesMap as _wallBehaviorV2ValuesMap, bounceDirectionVal
|
|
|
818
841
|
return this._liveCount || 0;
|
|
819
842
|
};
|
|
820
843
|
|
|
844
|
+
/**
|
|
845
|
+
* ARRIVALS readout: how many frames have triggered THIS wall's collision program —
|
|
846
|
+
* read from the engine's own per-wall counter, `tickData.objects[handle].count`, the
|
|
847
|
+
* contract's one read authority for an LO count (ENGINE_CONTRACT §4.3). The `count`
|
|
848
|
+
* hook compiles `set 1.count = 1.count + 1` behind the trigger, so the engine counts
|
|
849
|
+
* one per trigger event; on a removing wall (destroy / absorb) each trigger is the
|
|
850
|
+
* frame's removal, so the count IS the arrivals. Never derived from the collected
|
|
851
|
+
* frame listing (that is the padded search-rect census — see getLiveCount).
|
|
852
|
+
*
|
|
853
|
+
* Layer 1 (API): dual-lane, the same shape as getLiveCount —
|
|
854
|
+
* getArrivals(tickData) — SAMPLE lane: read the engine count and return
|
|
855
|
+
* `{ total, delta }`: `total` = cumulative arrivals since the wall registered,
|
|
856
|
+
* `delta` = the change since the previously sampled TickData (this tick's
|
|
857
|
+
* arrivals when sampled every tick). IDEMPOTENT per TickData — sampling the same
|
|
858
|
+
* TickData twice returns the same `{ total, delta }`.
|
|
859
|
+
* getArrivals() — READ lane: the last sample (`{ total: 0, delta: 0 }` before the
|
|
860
|
+
* first tick).
|
|
861
|
+
*
|
|
862
|
+
* Layer 2 (physics): zero physics — a pure reader of a counter the compiled program
|
|
863
|
+
* already maintains (bench LO7); reading it moves nothing (SU1).
|
|
864
|
+
*
|
|
865
|
+
* Guards: THROWS on a wall without the count hook (the engine counter never moves →
|
|
866
|
+
* it would silently report 0 forever), and on a TickData that is not the one this
|
|
867
|
+
* wall's universe last produced (`universe._lastTickData`, the object `doTick()` returned
|
|
868
|
+
* and every tick listener receives). LO handles restart at 0 in every universe, so a
|
|
869
|
+
* TickData from another world indexes a different wall's count at the same handle; and
|
|
870
|
+
* an earlier TickData of this world would yield a wrong delta.
|
|
871
|
+
* @param {Object} [tickData] — the universe.doTick() result (sample lane).
|
|
872
|
+
* @returns {{ total: number, delta: number }}
|
|
873
|
+
*/
|
|
874
|
+
Wall.prototype.getArrivals = function (tickData) {
|
|
875
|
+
var counts = Array.isArray(this.hooks) && this.hooks.indexOf('count') !== -1;
|
|
876
|
+
if (!counts) {
|
|
877
|
+
throw new Error(
|
|
878
|
+
'[Wall.getArrivals] this wall does not COUNT (collisionBehavior "' +
|
|
879
|
+
this.collisionBehavior + '", hooks ' + JSON.stringify(this.hooks || []) +
|
|
880
|
+
') — the engine increments a wall\'s count only through the `count` hook; ' +
|
|
881
|
+
'add hooks: [\'count\'] (preset \'detector-screen\' = destroy + count).'
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
if (!this._arrivals) { this._arrivals = { td: null, total: 0, delta: 0 }; }
|
|
885
|
+
var a = this._arrivals;
|
|
886
|
+
if (tickData != null && tickData !== a.td) {
|
|
887
|
+
if (tickData !== this.universe._lastTickData) {
|
|
888
|
+
throw new Error('[Wall.getArrivals] "' + this.name + '": this is not the TickData its ' +
|
|
889
|
+
'own universe last produced (universe._lastTickData) — it is another world\'s, ' +
|
|
890
|
+
'where handle ' + this.lo.handle + ' is a different wall, or an earlier tick of ' +
|
|
891
|
+
'this one. Sample the TickData this wall\'s universe.doTick() just returned. (FAIL-LOUD.)');
|
|
892
|
+
}
|
|
893
|
+
var handle = this.lo.handle;
|
|
894
|
+
var oc = tickData.objects && tickData.objects[handle];
|
|
895
|
+
if (!oc || typeof oc.count !== 'number') {
|
|
896
|
+
throw new Error('[Wall.getArrivals] "' + this.name + '": this world\'s TickData carries no ' +
|
|
897
|
+
'objects[' + handle + '].count — every registered LargeObject is marshalled each ' +
|
|
898
|
+
'tick, so the wall is not registered here. (FAIL-LOUD.)');
|
|
899
|
+
}
|
|
900
|
+
var total = oc.count;
|
|
901
|
+
a.delta = total - a.total;
|
|
902
|
+
a.total = total;
|
|
903
|
+
a.td = tickData;
|
|
904
|
+
}
|
|
905
|
+
return { total: a.total, delta: a.delta };
|
|
906
|
+
};
|
|
907
|
+
|
|
821
908
|
/**
|
|
822
909
|
* ABSORB v2 readout: the wall's live { stored, absorbedTotal, radiatedTotal } (the
|
|
823
910
|
* REAL backing-frame mass ledger). Throws on a non-absorb wall. Call between ticks.
|