jssm 5.155.0 → 5.155.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/README.md +7 -7
- package/custom-elements.json +14 -1
- package/dist/cdn/instance.js +65 -7
- package/dist/cdn/viz.js +1 -1
- package/dist/cli/fsl-export-system-prompt.cjs +1 -1
- package/dist/cli/fsl-render.cjs +1 -1
- package/dist/cli/fsl.cjs +1 -1
- package/dist/cli/lib.cjs +1 -1
- package/dist/cli/lib.mjs +1 -1
- package/dist/deno/README.md +7 -7
- package/dist/deno/jssm.js +1 -1
- package/dist/jssm.es5.cjs +1 -1
- package/dist/jssm.es5.iife.js +1 -1
- package/dist/jssm.es6.mjs +1 -1
- package/dist/jssm_viz.cjs +1 -1
- package/dist/jssm_viz.iife.cjs +1 -1
- package/dist/jssm_viz.mjs +1 -1
- package/dist/wc/instance.js +64 -6
- package/dist/wc/widgets.js +20 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,10 +18,10 @@ Please edit the file it's derived from, instead: `./src/md/readme_base.md`
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
* Generated for version 5.155.
|
|
21
|
+
* Generated for version 5.155.1 at 6/28/2026, 7:52:33 PM
|
|
22
22
|
|
|
23
23
|
-->
|
|
24
|
-
# jssm 5.155.
|
|
24
|
+
# jssm 5.155.1
|
|
25
25
|
|
|
26
26
|
[**Try the live editor**](https://stonecypher.github.io/jssm-viz-demo/graph_explorer.html) ·
|
|
27
27
|
[Documentation](https://stonecypher.github.io/jssm/docs/) ·
|
|
@@ -312,7 +312,7 @@ That decision shows up everywhere downstream:
|
|
|
312
312
|
or run `npm run benny` against your own machine.
|
|
313
313
|
|
|
314
314
|
- **More thoroughly tested than any other JavaScript state-machine
|
|
315
|
-
library.** 7,
|
|
315
|
+
library.** 7,815 tests at 100.0% line coverage
|
|
316
316
|
([report](https://coveralls.io/github/StoneCypher/jssm)), plus
|
|
317
317
|
fuzz testing via `fast-check`, with parser test data across ten natural
|
|
318
318
|
languages and Emoji.
|
|
@@ -445,11 +445,11 @@ If your contribution is missing here, please open an issue.
|
|
|
445
445
|
|
|
446
446
|
<br/>
|
|
447
447
|
|
|
448
|
-
***7,
|
|
448
|
+
***7,815 tests***, run 82,857 times.
|
|
449
449
|
|
|
450
|
-
- 7,
|
|
451
|
-
- 758 fuzz tests with 54.
|
|
452
|
-
- 9,
|
|
450
|
+
- 7,057 specs with 100.0% coverage
|
|
451
|
+
- 758 fuzz tests with 54.7% coverage
|
|
452
|
+
- 9,686 TypeScript lines - 0.8 tests per line, 8.6 generated tests per line
|
|
453
453
|
|
|
454
454
|
[](https://github.com/StoneCypher/jssm/actions)
|
|
455
455
|
[](https://www.npmjs.com/package/jssm)
|
package/custom-elements.json
CHANGED
|
@@ -3107,6 +3107,11 @@
|
|
|
3107
3107
|
],
|
|
3108
3108
|
"description": "DEFLATE `bytes` (raw, headerless) via the platform `CompressionStream`."
|
|
3109
3109
|
},
|
|
3110
|
+
{
|
|
3111
|
+
"kind": "variable",
|
|
3112
|
+
"name": "MAX_PERMALINK_INFLATE_BYTES",
|
|
3113
|
+
"description": "Hard ceiling on the inflated size of a permalink, in bytes. A permalink rides\r\nin a URL an attacker can hand a victim, and inflate_raw runs on it\r\nautomatically on page load, so an uncapped inflate is a decompression-bomb\r\nvector (a tiny `#m=…` could expand to hundreds of MB and OOM the tab). This is\r\ngenerous for real FSL (text — even a vast machine is well under a megabyte)."
|
|
3114
|
+
},
|
|
3110
3115
|
{
|
|
3111
3116
|
"kind": "function",
|
|
3112
3117
|
"name": "inflate_raw",
|
|
@@ -3123,7 +3128,7 @@
|
|
|
3123
3128
|
}
|
|
3124
3129
|
}
|
|
3125
3130
|
],
|
|
3126
|
-
"description": "Inverse of deflate_raw."
|
|
3131
|
+
"description": "Inverse of deflate_raw, reading the stream in chunks and aborting once\r\nthe inflated output would exceed MAX_PERMALINK_INFLATE_BYTES (a\r\ndecompression-bomb guard — see that constant)."
|
|
3127
3132
|
},
|
|
3128
3133
|
{
|
|
3129
3134
|
"kind": "function",
|
|
@@ -3331,6 +3336,14 @@
|
|
|
3331
3336
|
"module": "src/ts/wc/fsl_permalink.ts"
|
|
3332
3337
|
}
|
|
3333
3338
|
},
|
|
3339
|
+
{
|
|
3340
|
+
"kind": "js",
|
|
3341
|
+
"name": "MAX_PERMALINK_INFLATE_BYTES",
|
|
3342
|
+
"declaration": {
|
|
3343
|
+
"name": "MAX_PERMALINK_INFLATE_BYTES",
|
|
3344
|
+
"module": "src/ts/wc/fsl_permalink.ts"
|
|
3345
|
+
}
|
|
3346
|
+
},
|
|
3334
3347
|
{
|
|
3335
3348
|
"kind": "js",
|
|
3336
3349
|
"name": "inflate_raw",
|
package/dist/cdn/instance.js
CHANGED
|
@@ -23563,7 +23563,7 @@ var constants = /*#__PURE__*/Object.freeze({
|
|
|
23563
23563
|
* Useful for runtime diagnostics and for embedding in serialized machine
|
|
23564
23564
|
* snapshots so that deserializers can detect version-skew.
|
|
23565
23565
|
*/
|
|
23566
|
-
const version = "5.155.
|
|
23566
|
+
const version = "5.155.1";
|
|
23567
23567
|
|
|
23568
23568
|
// whargarbl lots of these return arrays could/should be sets
|
|
23569
23569
|
const { state_name_chars, state_name_first_chars, action_label_chars } = constants;
|
|
@@ -29436,7 +29436,19 @@ async function deflate_raw(bytes) {
|
|
|
29436
29436
|
return new Uint8Array(await new Response(stream.readable).arrayBuffer());
|
|
29437
29437
|
}
|
|
29438
29438
|
/**
|
|
29439
|
-
*
|
|
29439
|
+
* Hard ceiling on the inflated size of a permalink, in bytes. A permalink rides
|
|
29440
|
+
* in a URL an attacker can hand a victim, and {@link inflate_raw} runs on it
|
|
29441
|
+
* automatically on page load, so an uncapped inflate is a decompression-bomb
|
|
29442
|
+
* vector (a tiny `#m=…` could expand to hundreds of MB and OOM the tab). This is
|
|
29443
|
+
* generous for real FSL (text — even a vast machine is well under a megabyte).
|
|
29444
|
+
*/
|
|
29445
|
+
const MAX_PERMALINK_INFLATE_BYTES = 5 * 1024 * 1024;
|
|
29446
|
+
/**
|
|
29447
|
+
* Inverse of {@link deflate_raw}, reading the stream in chunks and aborting once
|
|
29448
|
+
* the inflated output would exceed {@link MAX_PERMALINK_INFLATE_BYTES} (a
|
|
29449
|
+
* decompression-bomb guard — see that constant).
|
|
29450
|
+
*
|
|
29451
|
+
* @throws RangeError when the inflated output exceeds the cap.
|
|
29440
29452
|
*
|
|
29441
29453
|
* @example
|
|
29442
29454
|
* new TextDecoder().decode(await inflate_raw(await deflate_raw(new TextEncoder().encode("hi")))); // "hi"
|
|
@@ -29446,7 +29458,30 @@ async function inflate_raw(bytes) {
|
|
|
29446
29458
|
const writer = stream.writable.getWriter();
|
|
29447
29459
|
void writer.write(bytes);
|
|
29448
29460
|
void writer.close();
|
|
29449
|
-
|
|
29461
|
+
// Read incrementally; stopping past the cap leaves the stream half-drained, so
|
|
29462
|
+
// backpressure halts further inflation and the abandoned stream is GC'd. We do
|
|
29463
|
+
// not cancel (which would abort the writable and leak an unhandled rejection).
|
|
29464
|
+
const reader = stream.readable.getReader();
|
|
29465
|
+
const chunks = [];
|
|
29466
|
+
let total = 0;
|
|
29467
|
+
for (;;) {
|
|
29468
|
+
const { done, value } = await reader.read();
|
|
29469
|
+
if (done) {
|
|
29470
|
+
break;
|
|
29471
|
+
}
|
|
29472
|
+
total += value.length;
|
|
29473
|
+
if (total > MAX_PERMALINK_INFLATE_BYTES) {
|
|
29474
|
+
throw new RangeError(`permalink inflate exceeded ${MAX_PERMALINK_INFLATE_BYTES} bytes`);
|
|
29475
|
+
}
|
|
29476
|
+
chunks.push(value);
|
|
29477
|
+
}
|
|
29478
|
+
const out = new Uint8Array(total);
|
|
29479
|
+
let offset = 0;
|
|
29480
|
+
for (const chunk of chunks) {
|
|
29481
|
+
out.set(chunk, offset);
|
|
29482
|
+
offset += chunk.length;
|
|
29483
|
+
}
|
|
29484
|
+
return out;
|
|
29450
29485
|
}
|
|
29451
29486
|
/**
|
|
29452
29487
|
* Encode FSL to a `<scheme><payload>` segment value (the part after `key=`).
|
|
@@ -29475,14 +29510,28 @@ async function decode_machine(segment) {
|
|
|
29475
29510
|
const plain = scheme === '1' ? await inflate_raw(bytes) : bytes;
|
|
29476
29511
|
return new TextDecoder().decode(plain);
|
|
29477
29512
|
}
|
|
29478
|
-
/**
|
|
29513
|
+
/** `decodeURIComponent` that returns its input untouched on a malformed escape,
|
|
29514
|
+
* so a hand-mangled fragment never throws out of {@link read_fragment_param}. */
|
|
29515
|
+
function safe_decode(text) {
|
|
29516
|
+
try {
|
|
29517
|
+
return decodeURIComponent(text);
|
|
29518
|
+
}
|
|
29519
|
+
catch (_a) {
|
|
29520
|
+
return text;
|
|
29521
|
+
}
|
|
29522
|
+
}
|
|
29523
|
+
/**
|
|
29524
|
+
* Split a fragment (leading `#` optional) into `[key, value]` pairs, dropping
|
|
29525
|
+
* empties. Keys are percent-decoded (they are percent-encoded on write by
|
|
29526
|
+
* {@link set_fragment_param}); values are the URL-safe base64 payload as-is.
|
|
29527
|
+
*/
|
|
29479
29528
|
function fragment_pairs(hash) {
|
|
29480
29529
|
const body = hash.startsWith('#') ? hash.slice(1) : hash;
|
|
29481
29530
|
return body.split('&').filter(Boolean).map(seg => {
|
|
29482
29531
|
const eq = seg.indexOf('=');
|
|
29483
29532
|
return eq === -1
|
|
29484
|
-
? [seg, '']
|
|
29485
|
-
: [seg.slice(0, eq), seg.slice(eq + 1)];
|
|
29533
|
+
? [safe_decode(seg), '']
|
|
29534
|
+
: [safe_decode(seg.slice(0, eq)), seg.slice(eq + 1)];
|
|
29486
29535
|
});
|
|
29487
29536
|
}
|
|
29488
29537
|
/**
|
|
@@ -29513,7 +29562,9 @@ function set_fragment_param(hash, key, value) {
|
|
|
29513
29562
|
else {
|
|
29514
29563
|
pairs[at] = [key, value];
|
|
29515
29564
|
}
|
|
29516
|
-
|
|
29565
|
+
// Percent-encode the key so an `id`/`uhash` containing `=`, `&`, or `#` cannot
|
|
29566
|
+
// break segmentation or collide with a sibling. Values are URL-safe base64.
|
|
29567
|
+
return pairs.map(([k, v]) => `${encodeURIComponent(k)}=${v}`).join('&');
|
|
29517
29568
|
}
|
|
29518
29569
|
/**
|
|
29519
29570
|
* The fragment key an element owns: its `uhash` attribute if set, else its
|
|
@@ -29581,6 +29632,13 @@ class FslPermalinkSync {
|
|
|
29581
29632
|
}
|
|
29582
29633
|
try {
|
|
29583
29634
|
const fsl = await decode_machine(segment);
|
|
29635
|
+
// The decode is async; if the host was disconnected while it ran, drop the
|
|
29636
|
+
// result rather than mutating a detached element (and triggering a stray
|
|
29637
|
+
// rebuild on a later reconnect). A reconnect runs hostConnected → _restore
|
|
29638
|
+
// afresh.
|
|
29639
|
+
if (!this.host.isConnected) {
|
|
29640
|
+
return;
|
|
29641
|
+
}
|
|
29584
29642
|
this._last = segment;
|
|
29585
29643
|
this.host.fsl = fsl;
|
|
29586
29644
|
}
|
package/dist/cdn/viz.js
CHANGED
|
@@ -23588,7 +23588,7 @@ var constants = /*#__PURE__*/Object.freeze({
|
|
|
23588
23588
|
* Useful for runtime diagnostics and for embedding in serialized machine
|
|
23589
23589
|
* snapshots so that deserializers can detect version-skew.
|
|
23590
23590
|
*/
|
|
23591
|
-
const version = "5.155.
|
|
23591
|
+
const version = "5.155.1";
|
|
23592
23592
|
|
|
23593
23593
|
// whargarbl lots of these return arrays could/should be sets
|
|
23594
23594
|
const { state_name_chars, state_name_first_chars, action_label_chars } = constants;
|