jssm 5.162.11 → 5.162.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.162.11 at 7/12/2026, 8:54:54 AM
21
+ * Generated for version 5.162.13 at 7/12/2026, 12:27:54 PM
22
22
 
23
23
  -->
24
- # jssm 5.162.11
24
+ # jssm 5.162.13
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/) ·
@@ -333,7 +333,7 @@ That decision shows up everywhere downstream:
333
333
  or run `npm run benny` against your own machine.
334
334
 
335
335
  - **More thoroughly tested than any other JavaScript state-machine
336
- library.** 8,623 tests at 100.0% line coverage
336
+ library.** 8,681 tests at 100.0% line coverage
337
337
  ([report](https://coveralls.io/github/StoneCypher/jssm)), plus
338
338
  fuzz testing via `fast-check`, with parser test data across ten natural
339
339
  languages and Emoji.
@@ -350,6 +350,7 @@ That decision shows up everywhere downstream:
350
350
  - [Tutorial: a four-state traffic light](https://github.com/StoneCypher/jssm/blob/main/src/doc_md/Tutorial_TrafficLight.md) - short walkthrough that introduces the three arrow types
351
351
  - [Tutorial: building an ATM state machine](https://github.com/StoneCypher/jssm/blob/main/src/doc_md/Tutorial_ATM.md) - longer walkthrough that builds a real-world machine in nine incremental steps
352
352
  - [Language reference](https://github.com/StoneCypher/jssm/blob/main/src/doc_md/LanguageReference.md) - DSL reference for people already comfortable with state machines
353
+ - [Styling nodes and graphs](https://github.com/StoneCypher/jssm/blob/main/src/doc_md/Styling.md) - the built-in named color themes and how to select them from FSL source, code, Markdown fences, the CLI, and web components
353
354
  - [Catalog of example machines](https://github.com/StoneCypher/jssm/blob/main/src/doc_md/ExampleMachines.md) - comparison table of worked examples (light switch, traffic light, intersection, vending machine, more)
354
355
  - [Generated API reference](https://stonecypher.github.io/jssm/docs/) - full surface, generated from the TypeScript source
355
356
 
@@ -467,11 +468,11 @@ If your contribution is missing here, please open an issue.
467
468
 
468
469
  <br/>
469
470
 
470
- ***8,623 tests***, run 97,921 times.
471
+ ***8,681 tests***, run 98,078 times.
471
472
 
472
- - 7,721 specs with 100.0% coverage
473
- - 902 fuzz tests with 56.6% coverage
474
- - 10,907 TypeScript lines - 0.8 tests per line, 9.0 generated tests per line
473
+ - 7,778 specs with 100.0% coverage
474
+ - 903 fuzz tests with 56.3% coverage
475
+ - 11,033 TypeScript lines - 0.8 tests per line, 8.9 generated tests per line
475
476
 
476
477
  [![Actions Status](https://github.com/StoneCypher/jssm/workflows/Node%20CI/badge.svg)](https://github.com/StoneCypher/jssm/actions)
477
478
  [![NPM version](https://img.shields.io/npm/v/jssm.svg)](https://www.npmjs.com/package/jssm)
@@ -16,13 +16,25 @@ export interface FenceDimension {
16
16
  value: number;
17
17
  unit: FenceDimensionUnit;
18
18
  }
19
- /** The fully-parsed, validated description of one FSL Markdown fence block. */
19
+ /**
20
+ * The fully-parsed, validated description of one FSL Markdown fence block.
21
+ *
22
+ * Sizing semantics: `width`/`height` (from `width=`/`height=` tokens) are
23
+ * *exact* dimensions — the host renders the block at that size.
24
+ * `max_width`/`max_height` (from `max-width=`/`max-height=` tokens) are
25
+ * *upper bounds* on natural sizing — the block renders at its natural size
26
+ * but is capped on that axis. When both an exact and a max token are given
27
+ * for the same axis, the exact dimension wins and the cap is moot. All four
28
+ * are `null` when their token is absent.
29
+ */
20
30
  export interface FenceDescriptor {
21
31
  parts: FencePart[];
22
32
  ide: boolean;
23
33
  format: FenceImageFormat;
24
34
  width: FenceDimension | null;
25
35
  height: FenceDimension | null;
36
+ max_width: FenceDimension | null;
37
+ max_height: FenceDimension | null;
26
38
  interactive: boolean;
27
39
  notes: string[];
28
40
  }
@@ -40,12 +52,17 @@ export declare function fsl_fence_lang(info: string): 'fsl' | 'jssm' | null;
40
52
  /**
41
53
  * Parse a fence info string into a {@link FenceDescriptor}. The first token is
42
54
  * the (already-validated) language and is ignored; remaining tokens are
43
- * classified as parts, image formats, the `ide` macro, or `width`/`height`
44
- * options. Unrecognized or conflicting tokens are dropped and recorded in
55
+ * classified as parts, image formats, the `ide` macro, or the dimension
56
+ * options `width`/`height` (exact size) and `max-width`/`max-height`
57
+ * (upper bounds on natural size — see {@link FenceDescriptor} for the
58
+ * precedence rule when both appear on one axis). All four dimension tokens
59
+ * share one value syntax: a bare number (pixels), `<n>px`, or `<n>%`.
60
+ * Unrecognized or conflicting tokens are dropped and recorded in
45
61
  * `notes` rather than throwing, so a host can render forward-compatibly.
46
62
  * @param info The full fence info string, e.g. `'fsl image code width=300'`.
47
63
  * @returns The validated descriptor; `notes` lists anything ignored or overridden.
48
64
  * @example parse_fence_info('fsl').parts // => ['image', 'code']
49
65
  * @example parse_fence_info('fsl code image').parts // => ['code', 'image']
66
+ * @example parse_fence_info('fsl image max-width=300 max-height=50%').max_width // => { value: 300, unit: 'px' }
50
67
  */
51
68
  export declare function parse_fence_info(info: string): FenceDescriptor;
@@ -1104,6 +1104,12 @@ declare class Machine<mDT> {
1104
1104
  * {@link Machine.transition}, so it fires no hooks, mutates no machine
1105
1105
  * state, and touches no `data`. A state with no probabilistic exits
1106
1106
  * (a terminal, or a forced-only `~>` state) ends the walk.
1107
+ *
1108
+ * Terminality is checked before the first transition and after every
1109
+ * transition. A terminal start therefore completes with length zero even
1110
+ * when `max_steps` is zero, and a terminal reached on the final permitted
1111
+ * transition is completed rather than step-capped.
1112
+ *
1107
1113
  * @param start - State to begin the walk from.
1108
1114
  * @param max_steps - Maximum transitions before the walk is step-capped.
1109
1115
  * @param exit_memo - Per-run-set cache of {@link Machine.probable_exits_for}
@@ -1126,7 +1132,9 @@ declare class Machine<mDT> {
1126
1132
  * current state, each ending at a terminal or after `max_steps`. In
1127
1133
  * `steady_state` mode yields exactly one walk of `max_steps` steps. This
1128
1134
  * is the lazy engine behind {@link Machine.stochastic_summary}; the
1129
- * fsl-stochastic panel drives it across animation frames.
1135
+ * fsl-stochastic panel drives it across animation frames. A walk already
1136
+ * at a terminal is reported as terminated with length zero, including when
1137
+ * `max_steps` is zero.
1130
1138
  *
1131
1139
  * Passing `seed` reseeds the machine for reproducible runs. Unlike
1132
1140
  * {@link Machine.stochastic_summary}, the generator does NOT restore the
@@ -1149,6 +1157,10 @@ declare class Machine<mDT> {
1149
1157
  * per-run `path_lengths`, `terminal_reached`, and `capped`; `steady_state`
1150
1158
  * mode runs one long walk and omits those fields.
1151
1159
  *
1160
+ * Monte-Carlo runs count as `terminal_reached` when they start at a
1161
+ * terminal or reach one on the final permitted transition. Terminal
1162
+ * starts contribute zero to `path_lengths`, even when `max_steps` is zero.
1163
+ *
1152
1164
  * Timing (`after`) decorations and data-guard conditions are not modeled
1153
1165
  * by this sampler; it walks the probabilistic graph topology.
1154
1166
  * @param opts - {@link JssmStochasticOptions}. `runs` defaults to the
@@ -2755,6 +2767,7 @@ export { transfer_state_properties, Machine, deserialize, compareVersions, sm, f
2755
2767
  export { fsl_fence_lang, parse_fence_info } from './fsl_markdown_fence';
2756
2768
  export type { FencePart, FenceImageFormat, FenceDimensionUnit, FenceDimension, FenceDescriptor } from './fsl_markdown_fence';
2757
2769
  export { FslDirections } from './jssm_types.js';
2770
+ export type { JssmParseOptions } from './jssm_types.js';
2758
2771
  export { arrow_direction, arrow_left_kind, arrow_right_kind } from './jssm_arrow.js';
2759
2772
  export { compile, wrap_parse as parse, make } from './jssm_compiler.js';
2760
2773
  export { unique, find_repeated, weighted_sample_select, weighted_histo_key, sleep, seq, weighted_rand_select, histograph, gen_splitmix32 } from './jssm_util.js';