@descix/frqtl-web 0.6.0-p1.1 → 0.6.0-p4.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 +16 -11
- package/README.md +27 -9
- package/dist/dist-manifest.json +30 -28
- package/dist/experiments/empty/index.html +4 -4
- package/dist/frqtl/experiments/_shared/doors.js +17 -12
- package/dist/frqtl/objects/FrqtlApp.js +28 -1
- package/dist/frqtl/objects/RecipeContext.js +178 -12
- package/dist/frqtl/objects/instruments/hosted-eyes.js +200 -29
- package/dist/frqtl/objects/record/Record.js +326 -0
- package/dist/frqtl/objects/record/open-record.js +22 -0
- package/dist/frqtl/parts/FrqtlVision.js +21 -6
- package/dist/frqtl-web.min.js +53 -49
- package/dist/sdk.html +1 -1
- package/dist/shim/bundle/index.js +112 -96
- package/dist/shim/bundle/indexHtml.js +66 -39
- package/dist/shim/engine/router.js +2 -2
- package/dist/shim/index.js +1 -1
- package/dist/shim/notebook/format.js +1 -1
- package/dist/shim/notebook/store.js +2 -3
- package/dist/shim/project/index.js +16 -3
- package/dist/shim/project/link.js +181 -43
- package/dist/shim/project/manifest.js +151 -0
- package/dist/shim/project/parts-writer.js +9 -5
- package/dist/shim/project/record-format.js +345 -0
- package/dist/shim/project/specifiers.js +1 -1
- package/dist/shim/registry/index.js +1 -1
- package/dist/shim/registry/scene-source.js +44 -30
- package/dist/shim/registry/walkthrough.js +4 -3
- package/dist/shim/storage/codec-chains.js +88 -0
- package/dist/shim/storage/folders.js +205 -0
- package/dist/shim/storage/index.js +64 -8
- package/dist/shim/storage/make-namespace-store.js +5 -5
- package/llms.txt +10 -9
- package/package.json +2 -2
- package/dist/shim/bundle/frqnb.js +0 -112
- package/dist/shim/bundle/manifest.js +0 -95
- package/dist/shim/storage/modules.js +0 -249
- package/dist/shim/storage/projects.js +0 -150
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
|
-
Pre-release `0.6.0-
|
|
8
|
+
Pre-release `0.6.0-p4.1` (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.0-
|
|
17
|
+
https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-p4.1/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.0-
|
|
21
|
+
https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-p4.1/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
|
|
@@ -42,8 +42,8 @@ changes, refused }` (only touched values change; a new kind brings one import li
|
|
|
42
42
|
refused by name), and `await recipeContext.setDeclared(name, patch)` changes one entry and re-runs in place
|
|
43
43
|
(seed and camera kept). `runner.declared` rows read `inParts` and `module`.
|
|
44
44
|
|
|
45
|
-
Read a real one before writing your own: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-
|
|
46
|
-
rung is a file under `dist/frqtl/scenes/`), and a part: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-
|
|
45
|
+
Read a real one before writing your own: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-p4.1/dist/frqtl/scenes/double-slit.js` (every walk-through
|
|
46
|
+
rung is a file under `dist/frqtl/scenes/`), and a part: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-p4.1/dist/frqtl/parts/DetectorWall.js`.
|
|
47
47
|
|
|
48
48
|
## Boot it — the two doors (`@descix/frqtl-web/boot`)
|
|
49
49
|
bootScene(mount, buildExperiment, { renderer: 'p5' | 'three', seed, onTick, render })
|
|
@@ -51,9 +51,13 @@ rung is a file under `dist/frqtl/scenes/`), and a part: `https://cdn.jsdelivr.ne
|
|
|
51
51
|
bootProject(mount, { files: { 'sketch.js': text, 'parts/MyEmitter.js': text }, entry: 'sketch.js' }, { renderState, seed, onTick })
|
|
52
52
|
→ { runner, recipeContext, display, retainedRenderRows }
|
|
53
53
|
bootProject(mount, { url: '<served folder>/', entry: 'sketch.js' }, opts)
|
|
54
|
+
bootProject(mount, { files: { 'frqtl.json': text, 'sketch.js': text } }, opts) frqtl.json names the entry
|
|
54
55
|
|
|
55
56
|
A project's files import each other by relative specifiers (`./parts/MyEmitter.js`) and the package by
|
|
56
|
-
`@descix/frqtl-web/...`; an import that names no project file,
|
|
57
|
+
`@descix/frqtl-web/...`; an import that names no project file, an import of a non-module file (not `.js` /
|
|
58
|
+
`.mjs`), an unreached module file, or a cycle, is refused naming the file. `frqtl.json` (`./project`
|
|
59
|
+
`manifestFor` / `serializeManifest` / `parseManifest`, keys `MANIFEST_KEYS`) names the entry; a README rides
|
|
60
|
+
along unhashed. `linkProject` returns `{ buildExperiment, module, manifest, files, urls, project }`.
|
|
57
61
|
One boot per document (a second throws naming the re-scene door). Every load failure paints an overlay
|
|
58
62
|
in the mount and rejects. The runner's SceneRecord carries the project's identity (`projectIdentity`,
|
|
59
63
|
`./project`) as `sourceSha256`.
|
|
@@ -61,9 +65,10 @@ in the mount and rejects. The runner's SceneRecord carries the project's identit
|
|
|
61
65
|
A page with no build step needs an import map; render it from the package's own table:
|
|
62
66
|
`importMapFor('<the dist root URL>/')` (`./project`) — every `@descix/frqtl-web/...` row at its file; a host page that
|
|
63
67
|
imports `./boot`, `./registry` or `./project` by specifier renders `pageImportMapFor(...)` instead; it has no manifest
|
|
64
|
-
row, so read the manifest from the same root: `new URL('dist-manifest.json', root)`.
|
|
68
|
+
row, so read the manifest from the same root: `new URL('dist-manifest.json', root)`. A page that holds only its map
|
|
69
|
+
recovers the root through `FRQTL_WEB_HOST_SPECIFIERS`: `imports[row.specifier]` minus `row.libPath`.
|
|
65
70
|
The root is an absolute URL or starts with `/`, `./` or `../`. A sketch held as text boots as `bootProject(mount, sketchProject(text))`.
|
|
66
|
-
Or skip the map: `<script src="https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-
|
|
71
|
+
Or skip the map: `<script src="https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-p4.1/dist/frqtl-web.min.js"></script>` then `FRQTL.bootScene(…)`,
|
|
67
72
|
`FRQTL.Wall`, …
|
|
68
73
|
|
|
69
74
|
String kinds: `exp.addObject('Wall', props)` resolves the kind in the SCENE's realm (the frame the scene
|
|
@@ -76,8 +81,8 @@ it never imports the registry into its own document, where no kind is registered
|
|
|
76
81
|
| `.` | the parts (`Wall`, `SphereEmitter`, `Tunnel`, `FrqtlVision`, …), `bootScene`, `bootProject`, `engine`, `engineState`, `FrqtlCapture`, `RenderStages`, `FieldBuilder`, `CaptureEnvelope`, `validateRendererProvider` |
|
|
77
82
|
| `./boot` | `bootScene`, `bootProject` (in node it throws naming `@descix/frqtl-node`) |
|
|
78
83
|
| `./parts`, `./parts/*` | the parts barrel; one part = one file |
|
|
79
|
-
| `./project` | `FRQTL_WEB_SPECIFIERS`, `libPathOf`, `importMapFor`, `pageImportMapFor`, `linkProject`, `sketchProject`, `SKETCH_ENTRY`, `projectIdentity` |
|
|
80
|
-
| `./registry` | the walk-through rungs, the showcase roster, the experiment registry, `
|
|
84
|
+
| `./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` |
|
|
85
|
+
| `./registry` | the walk-through rungs, the showcase roster, the experiment registry, `projectOf(id, { mode })` → `{ manifest, files, renderState }` |
|
|
81
86
|
| `./kinds` | `registerKind`, `kindNamed`, `kindOf` (the parent's row, frozen), `registeredKinds` — a composed fork registers its renamed class |
|
|
82
87
|
| `./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`) |
|
|
83
88
|
| `./dist-manifest.json` | sha256 of every dist file (check a self-hosted copy against it) |
|
|
@@ -116,6 +121,6 @@ Everything is a Frame (recursive); there is no separate "particle" class.
|
|
|
116
121
|
- The published build is WASM-only on the engine side (compiled surface).
|
|
117
122
|
|
|
118
123
|
## Curated notebooks
|
|
119
|
-
Index: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-
|
|
124
|
+
Index: `https://cdn.jsdelivr.net/npm/@descix/frqtl-web@0.6.0-p4.1/dist/notebooks/notebooks.json`
|
|
120
125
|
|
|
121
126
|
## No account, credits, or tokens are needed for anything above.
|
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
|
-
Pre-release `0.6.0-
|
|
8
|
+
Pre-release `0.6.0-p4.1` (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
|
|
@@ -32,6 +32,18 @@ import { bootProject } from '@descix/frqtl-web/boot';
|
|
|
32
32
|
await bootProject('mount', { files: { 'sketch.js': sketch, 'parts/MyEmitter.js': fork }, entry: 'sketch.js' });
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
A project folder names its entry in `frqtl.json` — `{ "name", "kind": "scene", "entry", "version"? }`, any other
|
|
36
|
+
key refused by name — so a folder boots with no `entry` (one given beside the manifest must equal it). `./project`
|
|
37
|
+
owns the file: `manifestFor({ name, entry })` and `serializeManifest(bag)` write it, `parseManifest(text)` and
|
|
38
|
+
`normalizeManifest(partial)` read it against `MANIFEST_KEYS`. How a host boots the folder (display, seed, camera,
|
|
39
|
+
render rows) is its own `renderState`, never a manifest key.
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
import { manifestFor, serializeManifest } from '@descix/frqtl-web/project';
|
|
43
|
+
const manifest = serializeManifest(manifestFor({ name: 'my-scene', entry: 'sketch.js' }));
|
|
44
|
+
await bootProject('mount', { files: { 'frqtl.json': manifest, 'sketch.js': sketch, 'README.md': notes } });
|
|
45
|
+
```
|
|
46
|
+
|
|
35
47
|
A sketch writes its movable parts as data, `export const parts = { name: [Kind, { …props }] }` (Kind an
|
|
36
48
|
imported class, the key its name), declared by one `exp.declare(parts)`:
|
|
37
49
|
|
|
@@ -54,11 +66,16 @@ changes one entry and runs the scene again in the same page, keeping its seed an
|
|
|
54
66
|
|
|
55
67
|
Project files import each other by relative specifiers and the package by a `@descix/frqtl-web/...`
|
|
56
68
|
row of `FRQTL_WEB_SPECIFIERS`. Before anything runs, `bootProject` refuses, naming the file and the
|
|
57
|
-
specifier: an import that names no project file, one that climbs out of the project, a
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
specifier: an import that names no project file, one that climbs out of the project, an import of a file
|
|
70
|
+
that is not a module (`.js` / `.mjs`), a module file the entry never imports, a package path the table does
|
|
71
|
+
not offer, a cycle, an invalid `frqtl.json`, a served file that is not UTF-8. A served folder (`{ url }`) is
|
|
72
|
+
fetched once per file, as bytes, `frqtl.json` first (a 404 there is allowed only beside `entry`). The linked
|
|
73
|
+
set is `frqtl.json` plus the module files; any other file (a README) travels with the folder, unlinked and
|
|
74
|
+
unhashed. The runner's SceneRecord carries the project's identity as `sourceSha256`: `projectIdentity({ files })`
|
|
75
|
+
over the linked set's BYTES, a BOM included. `linkProject` returns `{ buildExperiment, module, manifest, files,
|
|
76
|
+
urls, project }`: the entry's default export, its module namespace (`module.parts` is the sketch's `parts`), the
|
|
77
|
+
normalized manifest (or `null` when linked by `entry` alone), the linked bytes, each module's minted URL, and the
|
|
78
|
+
held folder as text (every file given).
|
|
62
79
|
|
|
63
80
|
A fork of a part is a project file that extends the part and registers its renamed class — it imports only
|
|
64
81
|
public specifiers, so the same file resolves in every host:
|
|
@@ -82,7 +99,8 @@ No build step: load `dist/frqtl-web.min.js` with a `<script>` tag and call `FRQT
|
|
|
82
99
|
`FrqtlPage` seam); bind parts however you like. A page that uses ES modules without a bundler renders its
|
|
83
100
|
import map from the package's own table: `importMapFor('<dist root URL>/')` (`./project`); a host page that also
|
|
84
101
|
imports `./boot`, `./registry` or `./project` by specifier renders `pageImportMapFor('<dist root URL>/')`;
|
|
85
|
-
it has no manifest row, so read the manifest from the same root: `new URL('dist-manifest.json', root)`.
|
|
102
|
+
it has no manifest row, so read the manifest from the same root: `new URL('dist-manifest.json', root)`. A page that holds only its map
|
|
103
|
+
recovers the root through `FRQTL_WEB_HOST_SPECIFIERS` (`./project`): `imports[row.specifier]` minus `row.libPath`. The root is an absolute URL or starts with `/`, `./` or `../`
|
|
86
104
|
(any other root is refused: a browser ignores its rows). `sketchProject(text)` (`./project`) is the one-file
|
|
87
105
|
project of a sketch held as text, for `bootProject(mount, sketchProject(text))`.
|
|
88
106
|
|
|
@@ -97,8 +115,8 @@ into its own document, where no kind is registered.
|
|
|
97
115
|
| `.` | the parts, `bootScene`, `bootProject`, `engine`, `engineState`, `FrqtlCapture`, `RenderStages`, `FieldBuilder`, `CaptureEnvelope`, `validateRendererProvider` |
|
|
98
116
|
| `./boot` | `bootScene`, `bootProject` (in node it throws, naming `@descix/frqtl-node`) |
|
|
99
117
|
| `./parts`, `./parts/*` | the parts barrel; one part = one file |
|
|
100
|
-
| `./project` | `FRQTL_WEB_SPECIFIERS`, `libPathOf`, `importMapFor`, `pageImportMapFor`, `linkProject`, `sketchProject`, `SKETCH_ENTRY`, `projectIdentity` |
|
|
101
|
-
| `./registry` | the walk-through rungs, the showcase roster, the experiment registry, `
|
|
118
|
+
| `./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` |
|
|
119
|
+
| `./registry` | the walk-through rungs, the showcase roster, the experiment registry, `projectOf` |
|
|
102
120
|
| `./kinds` | `registerKind`, `kindNamed`, `kindOf`, `registeredKinds` — the kind registry a composed fork registers in |
|
|
103
121
|
| `./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`) |
|
|
104
122
|
| `./dist-manifest.json` | sha256 of every dist file |
|
package/dist/dist-manifest.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descix/frqtl-web",
|
|
3
|
-
"version": "0.6.0-
|
|
3
|
+
"version": "0.6.0-p4.1",
|
|
4
4
|
"files": {
|
|
5
5
|
"artifact/double-slit.html": "23d3fb7317b8c57d09f7563b0e958f8172e15d0c5aca7a7d6d0628ea86e19f1d",
|
|
6
6
|
"artifact/sun.html": "4ec3515a3a94553bb862a7894ecd43757004fd8087ba60ce97622a410b615383",
|
|
7
7
|
"boot/node-refusal.js": "23ce7b8bb34fb86d19970b7e4275e463ae2963cf8a5c3b4ffe72bd6ff6261b47",
|
|
8
8
|
"css/bootstrap.min.css": "3c8f27e6009ccfd710a905e6dcf12d0ee3c6f2ac7da05b0572d3e0d12e736fc8",
|
|
9
9
|
"css/devsdk.css": "52b51f6d935940f5d84747fbfcf56e40e36032ce16aaf93e40534e3a08e07d7b",
|
|
10
|
-
"experiments/empty/index.html": "
|
|
10
|
+
"experiments/empty/index.html": "034925509210e27b181233c360b691d646d87ea396aba1ebd56f30532084bd56",
|
|
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": "ca6420b9caad8b45d443b0b7fb1316ba52a6e0cfcbca0e654b593f2aacfe8f90",
|
|
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",
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"frqtl/compat/vendor.js": "2393ada71cdbe750d409174e1ba9b098148796efdff746b315d706a0b32e58e8",
|
|
169
169
|
"frqtl/experiments/_shared/boot-failure.js": "1a92e85b06acdefede5613f2fac7cd4e61d2aba590820f1bfa92f6829fcbbdd4",
|
|
170
170
|
"frqtl/experiments/_shared/boot.js": "028b7ba7e06b774a1644bd792f5b0977b43fdf9586408b5a1b91c03364afe20e",
|
|
171
|
-
"frqtl/experiments/_shared/doors.js": "
|
|
171
|
+
"frqtl/experiments/_shared/doors.js": "bd50a6ff1093a8f6a9e66116713cfec64c0ce70feb9c007a69e7135de104871b",
|
|
172
172
|
"frqtl/experiments/_shared/experiment-layout.css": "a42ec88b1b732dc3ec7a94be80a55d05f65356ce72a25a8f105a9ff1acae464b",
|
|
173
173
|
"frqtl/experiments/_shared/experiment-metrics.js": "18edc5fdcbc017fcc321cc12165d0347713a3086a1f3e8c1b48132c891036a3a",
|
|
174
174
|
"frqtl/experiments/_shared/fx-experiment.js": "4a17825dbb9136d2b9ef780b15436f21355800fffc66a72c9aae05c559080662",
|
|
@@ -176,15 +176,15 @@
|
|
|
176
176
|
"frqtl/experiments/_shared/page-door.js": "b94f89d5c9d250cf232eb207c8d88e17d1c442857afc9627bf81c86905cc9a7e",
|
|
177
177
|
"frqtl/experiments/_shared/radiation-histogram.js": "a6ab62f6b50b08be50a0d2a85116b7c8b945914d48508ec4660e2ca73db33075",
|
|
178
178
|
"frqtl/experiments/_shared/retired-globals.js": "966764b68e011fbf4183b74df8ade57596ec8114694f29d005784d7fe619df6b",
|
|
179
|
-
"frqtl/objects/FrqtlApp.js": "
|
|
179
|
+
"frqtl/objects/FrqtlApp.js": "0537a6e6b71fc763e92404952263d3bef4dbf273c86d45c5609ee72e69a30a56",
|
|
180
180
|
"frqtl/objects/ObjectFactory.js": "a8f050ce61b7ab9c9b4f81e9eeaebf05c3cc0b532c741ce93d6e952489772b11",
|
|
181
|
-
"frqtl/objects/RecipeContext.js": "
|
|
181
|
+
"frqtl/objects/RecipeContext.js": "b21ca03f799a28848b190834274c061f6dde7fa7f3d17e5eac015550db90d8d7",
|
|
182
182
|
"frqtl/objects/collectors/DataCollector.js": "8736d6cb77eec36ce2adcf2bc3b0d2436eeb70a73b77182ff053efdc6ca071df",
|
|
183
183
|
"frqtl/objects/constants/WallBehaviors.js": "8a9cbdb96eadf84f1d61d215f6921124ec5dbf9e2938c09894a0aa083ddcaea0",
|
|
184
184
|
"frqtl/objects/geometry/SlabFace.js": "847921b124d3bc1692e88c363c087d392a1baa7c652a3a61e381d0f8a8342e57",
|
|
185
185
|
"frqtl/objects/instruments/capture-host.js": "ba5001afa2d8f4e438c5eacb2a5456d903401de8584d170c0b02ff3014794edd",
|
|
186
186
|
"frqtl/objects/instruments/capture.js": "53a746cb51e1c83326eebaa98083861c7ee593f2bcb2317473446a1a02b59b5c",
|
|
187
|
-
"frqtl/objects/instruments/hosted-eyes.js": "
|
|
187
|
+
"frqtl/objects/instruments/hosted-eyes.js": "0d70708546f2e5917deb0a5638a535d7822f2141d69595db406cb0e074225883",
|
|
188
188
|
"frqtl/objects/kinds-entry.js": "a7818357864dc900bd93350635016f938c3dca8dcb665a62df802ba5cd0b3c93",
|
|
189
189
|
"frqtl/objects/kinds.js": "107b166c96c93fd517f173fdbe7006d6f0b2694d5f799f7ec9d4f695313f1832",
|
|
190
190
|
"frqtl/objects/objects/Box.js": "0c08fa4753b78ef56d07aae3393a6268647b550ead58e409cff13eabc8b34b5d",
|
|
@@ -211,6 +211,8 @@
|
|
|
211
211
|
"frqtl/objects/objects/slitLinerScatter.js": "9413cc7efa2132c68d7b4d5030af28d92e8d085e127d5c8e1568d0028da2fc13",
|
|
212
212
|
"frqtl/objects/objects/sustainedSource.js": "0c324cef1583226d090b4d1014c2576ef8237f1bad47c1511bed3c3f81e04206",
|
|
213
213
|
"frqtl/objects/objects/tagger.js": "e2a5ef9ae68466afb6b157ca6d7ce03a6f126d8c91c9f9d4be6dba8e928535eb",
|
|
214
|
+
"frqtl/objects/record/Record.js": "7dce4e1ac5b5ab842fac9f6c9d754322b3696afb7b774e8c2ac018f803a780a6",
|
|
215
|
+
"frqtl/objects/record/open-record.js": "2da2abcccd3ad5bc39eb7fcfb764601cd031dd0afa9b3c9cb96b0669621827df",
|
|
214
216
|
"frqtl/objects/schema/engine-scopes.js": "1777dd3d2443df7c7d7fbcd25974bcb758606bdf3efa5c21408009167d00e3e6",
|
|
215
217
|
"frqtl/objects/schema/index.js": "74ba0b6a6e057cfd40edf2ce41fcce7206c0204e90eeee4a8db3b711f10ffd33",
|
|
216
218
|
"frqtl/objects/schema/scopes.js": "3b9c2d4f20604d6384ec625ab5e4a38085fa9696c5e443ff66b45a8f2330c5f6",
|
|
@@ -248,7 +250,7 @@
|
|
|
248
250
|
"frqtl/parts/DetectorWall.js": "49d9d9526b5e36180122617dd84b16e44624eee76fb2d547868e8cd41eeacbe0",
|
|
249
251
|
"frqtl/parts/FrqtlControlOverlay.js": "f862b1529265224aa96878b56b0c1c6e65683ba3fd6b517df86e17e92147f9c4",
|
|
250
252
|
"frqtl/parts/FrqtlControlsPanel.js": "792d03dea218bdc335ba7e04362be620edbfa331bed9de087d61942299728cc1",
|
|
251
|
-
"frqtl/parts/FrqtlVision.js": "
|
|
253
|
+
"frqtl/parts/FrqtlVision.js": "118d0874249fa55783b196fd01297b3347951267a4add93381433a72c46e8622",
|
|
252
254
|
"frqtl/parts/GraphingDetectorWall.js": "6bff06f951459a3cd327c2eb235d159520933762be0343e1925d153fc2fe6423",
|
|
253
255
|
"frqtl/parts/LargeObject.js": "637ea4c4b5052b916dace520cbb6772f1f8f2e367764ea399dab2a74fff4ed65",
|
|
254
256
|
"frqtl/parts/LightColor.js": "8637e5a09bbad3a4fdd2034ccb44dfc1fda743e29b12b4c685a64b9e1df28daa",
|
|
@@ -348,11 +350,9 @@
|
|
|
348
350
|
"notebooks/stats.html": "360db52d77ef46c690e7c865a7ce672d5032b916a0a0796f6070d5f17b03132b",
|
|
349
351
|
"notebooks/transcendentals.html": "1dfc5d40f0e3e6cccc785fb73d73ef82e24048d7affd10143370779ef2032b8c",
|
|
350
352
|
"notebooks/view-vendored-d3.html": "debeeef830f8c328b3b6e13b0b8fe26021ba55802b89d8dbe78b8a0c6c002eac",
|
|
351
|
-
"sdk.html": "
|
|
352
|
-
"shim/bundle/
|
|
353
|
-
"shim/bundle/
|
|
354
|
-
"shim/bundle/indexHtml.js": "6d3ce242c4f139b542981164fe2b1d8b1c37d9423904bc1299531f594ce4ccc6",
|
|
355
|
-
"shim/bundle/manifest.js": "796e25411d4f1d335277e954cf245352f95f324a1403062caa430142b9e8748c",
|
|
353
|
+
"sdk.html": "ceacbf1898aac473e54ac899838939496fd4f39efdd440b9b0b91e9d382bd538",
|
|
354
|
+
"shim/bundle/index.js": "ea7891e417a929e2b90dc8337750d247a355f84f7f581cf361d4bc8f473d42b5",
|
|
355
|
+
"shim/bundle/indexHtml.js": "2c4fbc502bb33fce93596cee19e143a58bb63c18d0b18ea597f81610e3a9a027",
|
|
356
356
|
"shim/bundle/zip.js": "00f7b5fb5f36ff40a59d86758c503d9d7fb43949c1b5a4f2e7367c43d92786f9",
|
|
357
357
|
"shim/bus.js": "dac2eeccd8774268c51014be4c46c00b9985fdf49ebb44355aa370e949c8c5bc",
|
|
358
358
|
"shim/controls/index.js": "2aaf1f14b104bba8b912d68fe99068a8c544770b9eac43cdf6d992c311ec8f69",
|
|
@@ -360,15 +360,15 @@
|
|
|
360
360
|
"shim/engine/artifact-shell.js": "b4c1d8bf65403caea9357fecd91172a1689baed8aad89433160d595881f16010",
|
|
361
361
|
"shim/engine/boot-phases.js": "c6e12e12824bcf6f1a289f46e41c898a5416c80c131594525145aae9a3eefbfa",
|
|
362
362
|
"shim/engine/engine-stack-boot.js": "0abf57dcff2ca2bb025c787a17875d49d54d9218ac08c78cb9c678dbb6118d08",
|
|
363
|
-
"shim/engine/router.js": "
|
|
363
|
+
"shim/engine/router.js": "a4ec678ab0e38381f761e40e8fbcb34dfea76d96df31a634f3d9f0b57d743570",
|
|
364
364
|
"shim/experiment-frame/index.js": "5a0219aaa225d8f808c405b08623ce85ada37d83fb4f55f983db3303e431e47f",
|
|
365
365
|
"shim/expr/ast-schema.js": "4f1133b887639bbd86fab976292323bf4a955cdc873ff7ca8e8a8eb3b416923f",
|
|
366
366
|
"shim/field-descriptor/index.js": "6647d57d1523519114adc0a5cb66335ec5121c39ab294b9c97bdfb9e5d7f61e0",
|
|
367
367
|
"shim/frame-data/index.js": "df6957b0b4a8e0ee0035bc970647b90089b421ae7f05911cc047d48457164be6",
|
|
368
|
-
"shim/index.js": "
|
|
368
|
+
"shim/index.js": "141c68dbce88643815415645d5f896d55770208866e5b88b07b228d6a7d117e2",
|
|
369
369
|
"shim/notebook/canvas-guard.js": "b19d3a86df3835bd617c7130cde997b6f8a8a0c140f95338b733115d5947ed7b",
|
|
370
370
|
"shim/notebook/catalog.js": "68243a154e12bf36a76598aa554119f6e3b8b5363c8452d157c8a562b9c38dc1",
|
|
371
|
-
"shim/notebook/format.js": "
|
|
371
|
+
"shim/notebook/format.js": "f8b1da9eb37da3a9609f7721426e2242f1279780ea212ea08d9f3c50bb18b578",
|
|
372
372
|
"shim/notebook/frqtl-setups-importmap.js": "df86defa90cb85675564e7bb269451684b5cc7679f2c6b1884c07c8272e8ff1c",
|
|
373
373
|
"shim/notebook/kernel.js": "65cf7e4ba12b24521143997a38cb0e7d0a8aa63f9f46868494eff7a41a887c7b",
|
|
374
374
|
"shim/notebook/knob.js": "f07e9ac9697c7178aa68e4b2f4300145f8e2d2dc41b64aa0afede7e2d68705b1",
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
"shim/notebook/realm-registry.js": "ffee52e7c93447c8b82bfc0784b51346686b4373766da298f50a759d3443ab6a",
|
|
379
379
|
"shim/notebook/realm-transport.js": "5173676a94211f85122e0581a16abba925e9c4b5900b5891911bfaec5ea02daf",
|
|
380
380
|
"shim/notebook/setup-builder.js": "abf8a7fed017776634d5ae3b595de7f00b32779590319cd48d95a6d9d0523a96",
|
|
381
|
-
"shim/notebook/store.js": "
|
|
381
|
+
"shim/notebook/store.js": "fe34d31907e7a8f303dfcc35b9c0439faf2c32fbc5c0bb4f899692c25bef9a4d",
|
|
382
382
|
"shim/notebook/vendor-importmap.js": "0c6578567980225593690e06fb4d32f0b50c47fe87a7467741a03846f6da68ed",
|
|
383
383
|
"shim/notebook/view-builder.js": "1961962be16ef526934c43193828473447f2ec9ac0144f39bc5108c327d9069a",
|
|
384
384
|
"shim/notebook/view-ctx.js": "6287aee366104bece827eecccf675540571d6db2b6833bff837be49eb60ce111",
|
|
@@ -387,17 +387,19 @@
|
|
|
387
387
|
"shim/package.json": "609158e6c5fbc237939fa3ddf7faab80ab690bdc0c8d584414a885130103c4e8",
|
|
388
388
|
"shim/page-params/index.js": "f372a85af163a492425cee2584513fa631a642cb805fa283ad122d445ebec4b3",
|
|
389
389
|
"shim/project/identity.js": "5a0dbd07bfad5c5aa6a529994a604546dbf3e6978b9529ca97ce2c57aa8e563f",
|
|
390
|
-
"shim/project/index.js": "
|
|
391
|
-
"shim/project/link.js": "
|
|
390
|
+
"shim/project/index.js": "81d1a5d84c8bd5f31de8d9849d385509a73582e2ec6db4f779b018fe1b25404f",
|
|
391
|
+
"shim/project/link.js": "1774cde446c3217afb84e19fe44205d620764c863bff89e348a0645aed451ca2",
|
|
392
|
+
"shim/project/manifest.js": "442267af07ae1b977ff6aeaca49d98ce82b77f548cfdd1ed0f258b3429d75f31",
|
|
392
393
|
"shim/project/parts-module.js": "b08e0149f086640692e1b2ff8e0d7ae0379c2bc934a0891418de5c2b8c0e8e60",
|
|
393
|
-
"shim/project/parts-writer.js": "
|
|
394
|
-
"shim/project/
|
|
394
|
+
"shim/project/parts-writer.js": "c9e9be475299ba24a81190d19260119816b9773135491a5024b55c40dd92f859",
|
|
395
|
+
"shim/project/record-format.js": "b680c3752f20535c08be832c6808fae000c2d2325f8caee57f98351043d091be",
|
|
396
|
+
"shim/project/specifiers.js": "f73a41a7ffbd16063be314973d67e5261607b56b7ef7ee7927d9eaa0d541f3cc",
|
|
395
397
|
"shim/registry/copy-gate.js": "cfbf52669c849b8837b326f2743458f1ead0720cad51a6c6d409c9bd6c7f9495",
|
|
396
398
|
"shim/registry/exhibits.js": "98736b6b0dd82b5c1436da28fe3bf8d2d3ee840af8f5256d00c23e296c3bca9a",
|
|
397
399
|
"shim/registry/experiments.js": "1d1484f144ade35ddcb94b23712df539b3b432a45130e159a6f47146de188165",
|
|
398
|
-
"shim/registry/index.js": "
|
|
399
|
-
"shim/registry/scene-source.js": "
|
|
400
|
-
"shim/registry/walkthrough.js": "
|
|
400
|
+
"shim/registry/index.js": "a3cef8c227d06ccc55735fe2989fbd07b0cf2f323d11b5bed23092fc967e88fc",
|
|
401
|
+
"shim/registry/scene-source.js": "0e873f9afa8175a318db14f0761d9379687024b1d49f69f2a0e3a22285d1029b",
|
|
402
|
+
"shim/registry/walkthrough.js": "65d74822585d271f4d74f0821fc158698bc39d7427b9bca3a61584c3c6d1a4a5",
|
|
401
403
|
"shim/render-state/apply.js": "fd0830ee4bb2668ac5b3254c29180bce9524d2ffb11bf6124e834ab8674a757a",
|
|
402
404
|
"shim/render-state/index.js": "9015405ef2ea3d88bf004a0aa3bea04eb6bdb86270d68ef5622538a9bae5fa6d",
|
|
403
405
|
"shim/render/capture-envelope.js": "2667a355169bb124fd8117e9cbf1d630085257b9f6fa537362f12d0aa649da2d",
|
|
@@ -407,11 +409,11 @@
|
|
|
407
409
|
"shim/rpc/index.js": "56af3afeed22e8d718cd2f7a8ad70db8745f54dbc139af9d71f1d73e2ca37698",
|
|
408
410
|
"shim/runtime/index.js": "cd728294c4693de3059f30f272f267b88b39c19a451edd30c75012e1bab755f5",
|
|
409
411
|
"shim/storage/boot.js": "689504e15dc075e32d08abf61c75a45b1d565c09f086b42400dae40d8186c411",
|
|
410
|
-
"shim/storage/
|
|
412
|
+
"shim/storage/codec-chains.js": "6eab30c3ab7d8bd26059f386f91f9e43a87a6a20980d36bf7271eb72b6d109c0",
|
|
413
|
+
"shim/storage/folders.js": "9d69b6fcbdc8ae6da561acd42946933ac2d453d5d0659fcaf1cfba410a47a45a",
|
|
414
|
+
"shim/storage/index.js": "0939d88bcdb0cde5b564e1fc1b03144363c9747e917e706c4cc1f55fe4ee1ace",
|
|
411
415
|
"shim/storage/local-storage-provider.js": "e14894e5d33bce961e66a2816e4b5c23b8e00534398ca9635d19de117f0f150e",
|
|
412
|
-
"shim/storage/make-namespace-store.js": "
|
|
413
|
-
"shim/storage/modules.js": "ceee32e0ea101ae49e5b0ab63007972a3f4127e9d81bbd2cf24cdb47d491623b",
|
|
414
|
-
"shim/storage/projects.js": "1c7398dedbb7a67c80acbfe0dfb08ba4f069db9a7d946266c4636212834bd671",
|
|
416
|
+
"shim/storage/make-namespace-store.js": "f88cfc65244cd7a3c3a43c173001855bb95571916a117b22f38d051823f2856f",
|
|
415
417
|
"vendor/d3-array/src/array.js": "0083c26850f97fa2735802530964aa737683402bbc560d14e0e27696b0c693bb",
|
|
416
418
|
"vendor/d3-array/src/ascending.js": "cb830a957d172fa6f6f52c67ef09a264986c3e795156930d342ed74edcea5e6b",
|
|
417
419
|
"vendor/d3-array/src/bin.js": "41f7cc39e146683c5da6ea7489903de2c5edb9bf725ca15b7cd015f603b306ac",
|
|
@@ -186,8 +186,8 @@
|
|
|
186
186
|
var exp = experiment;
|
|
187
187
|
try {
|
|
188
188
|
if (!project || typeof project !== 'object' || project.mint !== undefined || project.bare !== undefined) {
|
|
189
|
-
throw new Error('[empty] FrqtlPage.applyModuleSource(project): project is { files: { "sketch.js": text, … }
|
|
190
|
-
'entry: "sketch.js"
|
|
189
|
+
throw new Error('[empty] FrqtlPage.applyModuleSource(project): project is { files: { "frqtl.json": text, "sketch.js": text, … } } ' +
|
|
190
|
+
'(or { url }; + entry: "sketch.js" when it carries no frqtl.json) — a sketch held as one string is the one-file project. ' +
|
|
191
191
|
'This page links with its own mint. (got ' + (typeof project === 'string' ? 'a string' : typeof project) + ') (FAIL-LOUD.)');
|
|
192
192
|
}
|
|
193
193
|
exp._built = false;
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
*
|
|
216
216
|
* A public hook gets a public name: this IS the shipped, documented way to load a scene into
|
|
217
217
|
* the blank page — the ONE door every host comes through (STUDIO's author surface, the GYM's
|
|
218
|
-
* rung frame via rung-frame.js
|
|
218
|
+
* rung frame via rung-frame.js applySceneProject, the hosted eyes, the getting-started doc) — and
|
|
219
219
|
* the ONE door a host hands a renderState bag through (applyRenderState). The
|
|
220
220
|
* page itself states NO world: every scene does, in its first statement — the blank STUDIO
|
|
221
221
|
* universe is the scene file scenes/empty.js like any other. A member joins this object only
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
isReady: function () { return !!experiment; },
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
|
-
* Apply a scene / saved project — { files
|
|
229
|
+
* Apply a scene / saved project — { files } or { url } (+ entry when it carries no frqtl.json) — against this page's facade. Leaves the
|
|
230
230
|
* loop STOPPED and makes the runner the scene's co-init call built the page's runner
|
|
231
231
|
* (FrqtlPage.runner).
|
|
232
232
|
*
|
|
@@ -8,14 +8,17 @@
|
|
|
8
8
|
* default 'p5'), seed (default 42), onTick, render (one runner.setRenderOptions batch after start).
|
|
9
9
|
*
|
|
10
10
|
* bootProject(mount, project, opts?) → Promise<{ runner, recipeContext, display, retainedRenderRows }>
|
|
11
|
-
* project = { files: { 'sketch.js': text, 'parts/X.js': text, … }, entry }
|
|
11
|
+
* project = { files: { 'frqtl.json': text, 'sketch.js': text, 'parts/X.js': text, … }, entry? }
|
|
12
|
+
* | { url: '<served folder>/', entry? }
|
|
12
13
|
* — linked by THE link site through linkInPage (lib/shim/project/link.js linkProject; `mint` defaults to blobMint;
|
|
13
14
|
* a project may carry its host's `mint` / `bare`), its entry's default export built on the page.
|
|
14
|
-
* `entry` is
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* `entry` is optional when the folder's frqtl.json names it (lib/shim/project/manifest.js); beside a
|
|
16
|
+
* manifest it must equal manifest.entry; with no manifest it is REQUIRED. A one-string sketch is
|
|
17
|
+
* { files: { 'sketch.js': src }, entry: 'sketch.js' }.
|
|
18
|
+
* opts: renderState (the HOST's boot bag — its renderer/seed pick the boot, then the whole bag is applied
|
|
19
|
+
* through the boot's applyRenderState; never a fact of frqtl.json), seed (overrides renderState.seed), onTick.
|
|
20
|
+
* The runner's SceneRecord carries the project's identity (identity.js projectIdentity over the linked
|
|
21
|
+
* set, frqtl.json included) as `sourceSha256`.
|
|
19
22
|
*
|
|
20
23
|
* display — the display slot's value after the boot (compat/renderer/display-slot.js), ferried.
|
|
21
24
|
*
|
|
@@ -197,12 +200,12 @@ function claimDocument(door) {
|
|
|
197
200
|
/**
|
|
198
201
|
* THE page host's link: linkProject with the page's mint (blobMint) unless the project carries its host's own.
|
|
199
202
|
* bootProject and the empty page (FrqtlPage.applyModuleSource) both link through it.
|
|
200
|
-
* @param {{files?: Object<string,string>, url?: string, entry
|
|
201
|
-
* @returns {Promise<
|
|
203
|
+
* @param {{files?: Object<string,string>, url?: string, entry?: string, mint?: Function, bare?: Function}} project
|
|
204
|
+
* @returns {Promise<object>} linkProject's result (its contract: lib/shim/project/link.js)
|
|
202
205
|
*/
|
|
203
206
|
export function linkInPage(project) {
|
|
204
207
|
if (!project || typeof project !== 'object') {
|
|
205
|
-
return Promise.reject(new Error('[doors] linkInPage(project): project is { files
|
|
208
|
+
return Promise.reject(new Error('[doors] linkInPage(project): project is { files } or { url } (+ entry when it carries no frqtl.json) (got ' +
|
|
206
209
|
typeof project + '). (FAIL-LOUD.)'));
|
|
207
210
|
}
|
|
208
211
|
return linkProject(Object.assign({}, project, project.mint === undefined ? { mint: blobMint } : {}));
|
|
@@ -259,12 +262,14 @@ async function bootSceneClaimed(mountEl, sketch, opts) {
|
|
|
259
262
|
/**
|
|
260
263
|
* Boot a PROJECT into `mount`: link it (linkProject), build its entry's default export.
|
|
261
264
|
* @param {HTMLElement|string} mountEl
|
|
262
|
-
* @param {{files?: Object<string,string>, url?: string, entry
|
|
265
|
+
* @param {{files?: Object<string,string>, url?: string, entry?: string, mint?: Function, bare?: Function}} project
|
|
263
266
|
* @param {{renderState?: object, seed?: number, onTick?: Function}} [opts]
|
|
264
267
|
* @returns {Promise<{runner: object, recipeContext: object, display: string, retainedRenderRows: object[]}>}
|
|
265
268
|
* @example
|
|
266
269
|
* import { bootProject } from '@descix/frqtl-web/boot';
|
|
267
|
-
*
|
|
270
|
+
* import { manifestFor, serializeManifest } from '@descix/frqtl-web/project';
|
|
271
|
+
* const json = serializeManifest(manifestFor({ name: 'my-scene', entry: 'sketch.js' }));
|
|
272
|
+
* await bootProject('mount', { files: { 'frqtl.json': json, 'sketch.js': src, 'parts/MyEmitter.js': fork } });
|
|
268
273
|
*/
|
|
269
274
|
export function bootProject(mountEl, project, opts) {
|
|
270
275
|
let settle;
|
|
@@ -280,7 +285,7 @@ async function bootProjectClaimed(mountEl, project, opts) {
|
|
|
280
285
|
let identity;
|
|
281
286
|
try {
|
|
282
287
|
if (!project || typeof project !== 'object' || typeof project === 'function') {
|
|
283
|
-
throw new Error('[doors] bootProject(mount, project, opts): project is { files
|
|
288
|
+
throw new Error('[doors] bootProject(mount, project, opts): project is { files } or { url } (+ entry when it carries no frqtl.json) ' +
|
|
284
289
|
'(a sketch function boots through bootScene). (got ' + typeof project + ')');
|
|
285
290
|
}
|
|
286
291
|
refuseStray('bootProject', opts, BOOT_PROJECT_OPTS);
|
|
@@ -954,6 +954,11 @@ import { paintBootFailure } from '../experiments/_shared/boot-failure.js';
|
|
|
954
954
|
x.inParts = true;
|
|
955
955
|
};
|
|
956
956
|
|
|
957
|
+
/** beginWorld() — a (re-)inited world has not stepped: its last TickData is gone (worldTick reads 0, repaint draws nothing). */
|
|
958
|
+
FrqtlApp.prototype.beginWorld = function () {
|
|
959
|
+
this._lastTickData = null;
|
|
960
|
+
};
|
|
961
|
+
|
|
957
962
|
/** clearDeclared() — empty the registry. Called where the world re-inits (FrqtlApp.setup, and the
|
|
958
963
|
* RecipeContext co-init exp.createCanvas / exp.createScene): a fresh world has no declared objects. */
|
|
959
964
|
FrqtlApp.prototype.clearDeclared = function () {
|
|
@@ -2296,7 +2301,7 @@ import { paintBootFailure } from '../experiments/_shared/boot-failure.js';
|
|
|
2296
2301
|
this.stop();
|
|
2297
2302
|
var self = this;
|
|
2298
2303
|
function resume(result) {
|
|
2299
|
-
self.
|
|
2304
|
+
self.beginWorld();
|
|
2300
2305
|
// Always resume: "restart" means run the scene again from tick 0 — a restart
|
|
2301
2306
|
// that left the loop paused would read as a dead button.
|
|
2302
2307
|
self.start();
|
|
@@ -2572,6 +2577,28 @@ import { paintBootFailure } from '../experiments/_shared/boot-failure.js';
|
|
|
2572
2577
|
return this._tickSuspend;
|
|
2573
2578
|
};
|
|
2574
2579
|
|
|
2580
|
+
/**
|
|
2581
|
+
* runner.worldTick — READ-ONLY: the tick of THIS world: 0 before its first step, else the last delivered tick.
|
|
2582
|
+
* The 0 is a stated fact, not a default: `_lastTickData` is null until the world's first step, and beginWorld()
|
|
2583
|
+
* (the co-init and restart()) is the one writer of that null. It does NOT read `universe.tick`: the compat wrapper
|
|
2584
|
+
* keeps that field across a re-init until the next doTick, so after a restart it still answers the previous
|
|
2585
|
+
* world's tick. Every runner holds a world (its universe is built at construction), whether a sketch built it
|
|
2586
|
+
* through the replay door or a page built it by hand, so this always answers. THROWS when a delivered tick is not
|
|
2587
|
+
* a whole number ≥ 0.
|
|
2588
|
+
*/
|
|
2589
|
+
Object.defineProperty(FrqtlApp.prototype, 'worldTick', {
|
|
2590
|
+
configurable: true,
|
|
2591
|
+
get: function () {
|
|
2592
|
+
if (this._lastTickData === null) { return 0; }
|
|
2593
|
+
var t = this._lastTickData && this._lastTickData.universeData && this._lastTickData.universeData.tick;
|
|
2594
|
+
if (!(typeof t === 'number' && t >= 0 && t % 1 === 0)) {
|
|
2595
|
+
throw new Error('[FrqtlApp.worldTick] the last delivered TickData carries tick ' + String(t) +
|
|
2596
|
+
', not a whole number ≥ 0. (FAIL-LOUD.)');
|
|
2597
|
+
}
|
|
2598
|
+
return t;
|
|
2599
|
+
}
|
|
2600
|
+
});
|
|
2601
|
+
|
|
2575
2602
|
/** @returns {boolean} whether the tick clock is currently held. */
|
|
2576
2603
|
Object.defineProperty(FrqtlApp.prototype, 'ticksSuspended', {
|
|
2577
2604
|
configurable: true,
|