jssm 5.162.2 → 5.162.3
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 +2 -2
- package/dist/cdn/instance.js +1 -1
- 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 +2 -2
- package/dist/deno/jssm.d.ts +14 -13
- package/dist/deno/jssm.js +1 -1
- package/dist/deno/jssm_compiler.d.ts +1 -1
- package/dist/deno/jssm_types.d.ts +17 -17
- package/dist/deno/jssm_viz.d.ts +1 -1
- package/dist/fence/fence.js +11 -11
- 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/jssm.es5.d.cts +30 -29
- package/jssm.es6.d.ts +30 -29
- package/jssm.fence.d.ts +29 -28
- package/jssm_viz.es5.d.cts +30 -29
- package/jssm_viz.es6.d.ts +30 -29
- package/package.json +1 -1
|
@@ -263,7 +263,7 @@ declare function membership_distance(registry: JssmGroupRegistry, state: string,
|
|
|
263
263
|
* Compile a machine's JSON intermediate representation to a config object. If
|
|
264
264
|
* you're using this (probably don't,) you're probably also using
|
|
265
265
|
* {@link parse} to get the IR, and the object constructor
|
|
266
|
-
* {@link Machine.
|
|
266
|
+
* {@link Machine.constructor} to turn the config object into a workable machine.
|
|
267
267
|
*
|
|
268
268
|
* ```typescript
|
|
269
269
|
* import { parse, compile, Machine } from 'jssm';
|
|
@@ -56,7 +56,7 @@ type JssmArrowDirection = 'left' | 'right' | 'both';
|
|
|
56
56
|
/**
|
|
57
57
|
* Semantic category of an arrow's transition. `'legal'` is a normal
|
|
58
58
|
* transition, `'main'` is part of the machine's primary path, `'forced'`
|
|
59
|
-
* may only be taken via {@link Machine.force_transition}, and `'none'`
|
|
59
|
+
* may only be taken via {@link jssm!Machine.force_transition}, and `'none'`
|
|
60
60
|
* means no transition exists in that direction.
|
|
61
61
|
*/
|
|
62
62
|
type JssmArrowKind = 'none' | 'legal' | 'main' | 'forced';
|
|
@@ -122,8 +122,8 @@ declare const FslThemes: readonly ["default", "ocean", "modern", "plain", "bold"
|
|
|
122
122
|
*/
|
|
123
123
|
type FslTheme = typeof FslThemes[number];
|
|
124
124
|
/**
|
|
125
|
-
* Persistable snapshot of a Machine produced by {@link Machine.serialize}
|
|
126
|
-
* and consumed by {@link deserialize}. Carries the current state, the
|
|
125
|
+
* Persistable snapshot of a Machine produced by {@link jssm!Machine.serialize}
|
|
126
|
+
* and consumed by {@link jssm!deserialize}. Carries the current state, the
|
|
127
127
|
* associated machine data, the recent history (subject to the configured
|
|
128
128
|
* capacity), and metadata to detect version-skew on rehydration.
|
|
129
129
|
*
|
|
@@ -339,7 +339,7 @@ type JssmGenericState = {
|
|
|
339
339
|
complete: boolean;
|
|
340
340
|
};
|
|
341
341
|
/**
|
|
342
|
-
* The full internal bookkeeping snapshot of a {@link Machine}, exposed for
|
|
342
|
+
* The full internal bookkeeping snapshot of a {@link jssm!Machine}, exposed for
|
|
343
343
|
* advanced introspection. Contains the current state, the state map, the
|
|
344
344
|
* edge map and reverse-action map, and the original edge list. The
|
|
345
345
|
* `internal_state_impl_version` field exists so that consumers can detect
|
|
@@ -411,7 +411,7 @@ type JssmStateDeclarationRule = {
|
|
|
411
411
|
/**
|
|
412
412
|
* The fully-condensed declaration for a single state, including its raw
|
|
413
413
|
* rule list (`declarations`) and the well-known styling fields jssm-viz
|
|
414
|
-
* understands. Returned by {@link Machine.state_declaration}.
|
|
414
|
+
* understands. Returned by {@link jssm!Machine.state_declaration}.
|
|
415
415
|
*/
|
|
416
416
|
type JssmStateDeclaration = {
|
|
417
417
|
declarations: Array<JssmStateDeclarationRule>;
|
|
@@ -610,7 +610,7 @@ type JssmBaseTheme = {
|
|
|
610
610
|
*/
|
|
611
611
|
type JssmTheme = Partial<JssmBaseTheme>;
|
|
612
612
|
/**
|
|
613
|
-
* Full configuration object accepted by the {@link Machine} constructor and
|
|
613
|
+
* Full configuration object accepted by the {@link jssm!Machine} constructor and
|
|
614
614
|
* by {@link from}. Carries the transition list and the optional knobs
|
|
615
615
|
* governing layout, theming, history, start/end states, property
|
|
616
616
|
* definitions, machine metadata (author, license, version, ...) and the
|
|
@@ -633,14 +633,14 @@ type JssmEditorConfig = {
|
|
|
633
633
|
};
|
|
634
634
|
/** Which stochastic view a run batch produces. */
|
|
635
635
|
type JssmStochasticMode = 'montecarlo' | 'steady_state';
|
|
636
|
-
/** Options for {@link Machine.stochastic_summary} / {@link Machine.stochastic_runs}. */
|
|
636
|
+
/** Options for {@link jssm!Machine.stochastic_summary} / {@link jssm!Machine.stochastic_runs}. */
|
|
637
637
|
type JssmStochasticOptions = {
|
|
638
638
|
mode?: JssmStochasticMode;
|
|
639
639
|
runs?: number;
|
|
640
640
|
max_steps?: number;
|
|
641
641
|
seed?: number;
|
|
642
642
|
};
|
|
643
|
-
/** One walk's result, yielded by {@link Machine.stochastic_runs}. */
|
|
643
|
+
/** One walk's result, yielded by {@link jssm!Machine.stochastic_runs}. */
|
|
644
644
|
type JssmStochasticRun = {
|
|
645
645
|
states: Array<string>;
|
|
646
646
|
edges: Array<string>;
|
|
@@ -672,7 +672,7 @@ type JssmGenericConfig<StateType, DataType> = {
|
|
|
672
672
|
history?: number;
|
|
673
673
|
/**
|
|
674
674
|
* Maximum depth of the boundary-hook action cascade before the machine
|
|
675
|
-
* throws a {@link JssmError} rather than risking a stack overflow or hang.
|
|
675
|
+
* throws a {@link jssm_error!JssmError} rather than risking a stack overflow or hang.
|
|
676
676
|
*
|
|
677
677
|
* Each time a boundary action fires a transition that itself crosses a
|
|
678
678
|
* boundary, the depth counter increments. A cascade exceeding this limit is
|
|
@@ -826,7 +826,7 @@ type JssmCompileSeStart<StateType, DataType> = {
|
|
|
826
826
|
type JssmParseTree<StateType, mDT> = Array<JssmCompileSeStart<StateType, mDT>>;
|
|
827
827
|
/**
|
|
828
828
|
* Signature of an FSL parse function: takes a source string and returns a
|
|
829
|
-
*
|
|
829
|
+
* `JssmParseTree`. Used to type the parser export so consumers can
|
|
830
830
|
* swap in alternative parser implementations.
|
|
831
831
|
*/
|
|
832
832
|
type JssmParseFunctionType<StateType, mDT> = (string: any) => JssmParseTree<StateType, mDT>;
|
|
@@ -1027,7 +1027,7 @@ type HookRegistryEntry = {
|
|
|
1027
1027
|
target: HookTarget;
|
|
1028
1028
|
};
|
|
1029
1029
|
/**
|
|
1030
|
-
* Query for {@link Machine.has_hook} / {@link Machine.hooks_on}. A bare
|
|
1030
|
+
* Query for {@link jssm!Machine.has_hook} / {@link jssm!Machine.hooks_on}. A bare
|
|
1031
1031
|
* string is read as a state name; an `{ from, to, action? }` object is read
|
|
1032
1032
|
* as an edge (optionally a named edge); an `{ action }` object is read as a
|
|
1033
1033
|
* named action; a `{ group }` object is read as a named state group. This
|
|
@@ -1111,7 +1111,7 @@ type EverythingHookHandler<mDT> = (hook_context: EverythingHookContext<mDT>) =>
|
|
|
1111
1111
|
*/
|
|
1112
1112
|
type PostEverythingHookHandler<mDT> = (hook_context: EverythingHookContext<mDT>) => void;
|
|
1113
1113
|
/**
|
|
1114
|
-
* Extra diagnostic information attached to a {@link JssmError} when it
|
|
1114
|
+
* Extra diagnostic information attached to a {@link jssm_error!JssmError} when it
|
|
1115
1115
|
* carries machine-relative context — most often the state name a caller
|
|
1116
1116
|
* asked about when the error was raised.
|
|
1117
1117
|
*/
|
|
@@ -1133,7 +1133,7 @@ type JssmHistory<mDT> = circular_buffer<[StateType, mDT]>;
|
|
|
1133
1133
|
*/
|
|
1134
1134
|
type JssmRng = () => number;
|
|
1135
1135
|
/**
|
|
1136
|
-
* All event names that {@link Machine.on} accepts. These are observation
|
|
1136
|
+
* All event names that {@link jssm!Machine.on} accepts. These are observation
|
|
1137
1137
|
* events fired by the machine in addition to (not in place of) the hook
|
|
1138
1138
|
* system. Hooks intercept; events observe.
|
|
1139
1139
|
*
|
|
@@ -1274,7 +1274,7 @@ type JssmHookLifecycleEventDetail<mDT> = {
|
|
|
1274
1274
|
};
|
|
1275
1275
|
/**
|
|
1276
1276
|
* Mapped type from {@link JssmEventName} to the corresponding detail
|
|
1277
|
-
* payload. Drives the discriminated-union typing of {@link Machine.on},
|
|
1277
|
+
* payload. Drives the discriminated-union typing of {@link jssm!Machine.on},
|
|
1278
1278
|
* so `e.action` and friends only exist where they're meaningful.
|
|
1279
1279
|
*/
|
|
1280
1280
|
type JssmEventDetailMap<mDT> = {
|
|
@@ -1293,7 +1293,7 @@ type JssmEventDetailMap<mDT> = {
|
|
|
1293
1293
|
'hook-removal': JssmHookLifecycleEventDetail<mDT>;
|
|
1294
1294
|
};
|
|
1295
1295
|
/**
|
|
1296
|
-
* Filter accepted by {@link Machine.on} / {@link Machine.once} for an
|
|
1296
|
+
* Filter accepted by {@link jssm!Machine.on} / {@link jssm!Machine.once} for an
|
|
1297
1297
|
* individual event name. Only events whose detail key matches every
|
|
1298
1298
|
* filter entry fire the handler. Events that don't list a filter key in
|
|
1299
1299
|
* v1 take no filter properties.
|
|
@@ -1321,7 +1321,7 @@ type JssmEventFilterMap<mDT> = {
|
|
|
1321
1321
|
'hook-removal': Record<string, never>;
|
|
1322
1322
|
};
|
|
1323
1323
|
/**
|
|
1324
|
-
* Per-event filter object (as passed to {@link Machine.on}). Use
|
|
1324
|
+
* Per-event filter object (as passed to {@link jssm!Machine.on}). Use
|
|
1325
1325
|
* `JssmEventDetailMap<mDT>[Ev]` to find the matching detail type.
|
|
1326
1326
|
* @typeParam mDT The type of the machine data member.
|
|
1327
1327
|
* @typeParam Ev The event name.
|
|
@@ -1335,7 +1335,7 @@ type JssmEventFilter<mDT, Ev extends JssmEventName> = JssmEventFilterMap<mDT>[Ev
|
|
|
1335
1335
|
*/
|
|
1336
1336
|
type JssmEventHandler<mDT, Ev extends JssmEventName> = (detail: JssmEventDetailMap<mDT>[Ev]) => void;
|
|
1337
1337
|
/**
|
|
1338
|
-
* Function returned by {@link Machine.on} and {@link Machine.once} that
|
|
1338
|
+
* Function returned by {@link jssm!Machine.on} and {@link jssm!Machine.once} that
|
|
1339
1339
|
* removes the subscription. Calling it more than once is a no-op.
|
|
1340
1340
|
*/
|
|
1341
1341
|
type JssmUnsubscribe = () => void;
|
package/dist/deno/jssm_viz.d.ts
CHANGED
|
@@ -494,7 +494,7 @@ declare function chips_for_render_mode<T>(u_jssm: jssm.Machine<T>, l_states: str
|
|
|
494
494
|
* the state's display text plus any group chips the node builder appends, with
|
|
495
495
|
* DOT's `\"` escaping undone (SVG carries the literal character). A label that
|
|
496
496
|
* wraps across lines becomes several `<text>` elements; this returns the lines
|
|
497
|
-
* joined by `\n`, exactly how
|
|
497
|
+
* joined by `\n`, exactly how `extract_state_fills` reads them back — so
|
|
498
498
|
* the derived key and the extracted key meet at the same string.
|
|
499
499
|
*
|
|
500
500
|
* This is the single source of truth the static fence renderer keys its
|
package/dist/fence/fence.js
CHANGED
|
@@ -22766,7 +22766,7 @@ function fold_graph_config(aliases, explicit_block) {
|
|
|
22766
22766
|
* Compile a machine's JSON intermediate representation to a config object. If
|
|
22767
22767
|
* you're using this (probably don't,) you're probably also using
|
|
22768
22768
|
* {@link parse} to get the IR, and the object constructor
|
|
22769
|
-
* {@link Machine.
|
|
22769
|
+
* {@link Machine.constructor} to turn the config object into a workable machine.
|
|
22770
22770
|
*
|
|
22771
22771
|
* ```typescript
|
|
22772
22772
|
* import { parse, compile, Machine } from 'jssm';
|
|
@@ -23790,7 +23790,7 @@ function fslSemanticSpans(text) {
|
|
|
23790
23790
|
* Useful for runtime diagnostics and for embedding in serialized machine
|
|
23791
23791
|
* snapshots so that deserializers can detect version-skew.
|
|
23792
23792
|
*/
|
|
23793
|
-
const version = "5.162.
|
|
23793
|
+
const version = "5.162.3";
|
|
23794
23794
|
|
|
23795
23795
|
/**
|
|
23796
23796
|
* The FSL Markdown fence convention parser — pure, host-agnostic logic that
|
|
@@ -25167,7 +25167,7 @@ class Machine {
|
|
|
25167
25167
|
* Serialize the current machine, including all defining state but not the
|
|
25168
25168
|
* machine string, to a structure. This means you will need the machine
|
|
25169
25169
|
* string to recreate (to not waste repeated space;) if you want the machine
|
|
25170
|
-
* string embedded, call
|
|
25170
|
+
* string embedded, call `serialize_with_string` instead.
|
|
25171
25171
|
*
|
|
25172
25172
|
* @typeParam mDT The type of the machine data member; usually omitted
|
|
25173
25173
|
*
|
|
@@ -25694,7 +25694,7 @@ class Machine {
|
|
|
25694
25694
|
* List all entrances attached to the current state. Please note that the
|
|
25695
25695
|
* order of the list is not defined. This list includes both unforced and
|
|
25696
25696
|
* forced entrances; if this isn't desired, consider
|
|
25697
|
-
*
|
|
25697
|
+
* `list_unforced_entrances` or `list_forced_entrances` as
|
|
25698
25698
|
* appropriate.
|
|
25699
25699
|
*
|
|
25700
25700
|
* ```typescript
|
|
@@ -25720,8 +25720,8 @@ class Machine {
|
|
|
25720
25720
|
*
|
|
25721
25721
|
* List all exits attached to the current state. Please note that the order
|
|
25722
25722
|
* of the list is not defined. This list includes both unforced and forced
|
|
25723
|
-
* exits; if this isn't desired, consider
|
|
25724
|
-
*
|
|
25723
|
+
* exits; if this isn't desired, consider `list_unforced_exits` or
|
|
25724
|
+
* `list_forced_exits` as appropriate.
|
|
25725
25725
|
*
|
|
25726
25726
|
* ```typescript
|
|
25727
25727
|
* import { sm } from 'jssm';
|
|
@@ -28589,7 +28589,7 @@ class Machine {
|
|
|
28589
28589
|
* state's declaration into a fresh {@link JssmStateConfig} — the tier-5
|
|
28590
28590
|
* "`state foo : { … }`" contribution of the config cascade. A state with no
|
|
28591
28591
|
* declaration yields an all-`undefined` config (which contributes nothing
|
|
28592
|
-
* once folded with
|
|
28592
|
+
* once folded with `merge_state_config`).
|
|
28593
28593
|
*
|
|
28594
28594
|
* @param state The state whose per-state declared style is wanted.
|
|
28595
28595
|
*
|
|
@@ -28658,7 +28658,7 @@ class Machine {
|
|
|
28658
28658
|
* overlay (tier 6) is NOT applied here; it is layered on top by
|
|
28659
28659
|
* {@link resolve_state_config} so it wins over per-state config.
|
|
28660
28660
|
*
|
|
28661
|
-
* Tiers, folded least-specific → most-specific with
|
|
28661
|
+
* Tiers, folded least-specific → most-specific with `merge_state_config`
|
|
28662
28662
|
* (later wins, never throwing on a cross-tier key collision):
|
|
28663
28663
|
*
|
|
28664
28664
|
* 1. theme defaults — `base_theme.state`, then each selected theme's
|
|
@@ -28753,7 +28753,7 @@ class Machine {
|
|
|
28753
28753
|
* successor to the ad-hoc layer merge {@link style_for} used to perform.
|
|
28754
28754
|
*
|
|
28755
28755
|
* For any state OTHER than the current one, this returns the memoized static
|
|
28756
|
-
* resolution (tiers 1–5; see
|
|
28756
|
+
* resolution (tiers 1–5; see `_compose_state_config`) — theme →
|
|
28757
28757
|
* `default_state_config` → per-kind defaults → depth-ordered group metadata →
|
|
28758
28758
|
* per-state config. The cache is keyed by state and never invalidated, since
|
|
28759
28759
|
* those tiers do not depend on which state is current.
|
|
@@ -28763,7 +28763,7 @@ class Machine {
|
|
|
28763
28763
|
* layers: the active-state THEME layers fold in just below the per-state
|
|
28764
28764
|
* config (tier 3-active), and the user `active_state : { … }` overlay folds
|
|
28765
28765
|
* in LAST (tier 6), on top of everything, so it wins over per-state config.
|
|
28766
|
-
* Every fold uses
|
|
28766
|
+
* Every fold uses `merge_state_config`, so a key set at a lower tier is
|
|
28767
28767
|
* overridden — never rejected — by a higher one.
|
|
28768
28768
|
*
|
|
28769
28769
|
* ```typescript
|
|
@@ -30405,7 +30405,7 @@ function chips_for_render_mode(u_jssm, l_states, mode) {
|
|
|
30405
30405
|
* the state's display text plus any group chips the node builder appends, with
|
|
30406
30406
|
* DOT's `\"` escaping undone (SVG carries the literal character). A label that
|
|
30407
30407
|
* wraps across lines becomes several `<text>` elements; this returns the lines
|
|
30408
|
-
* joined by `\n`, exactly how
|
|
30408
|
+
* joined by `\n`, exactly how `extract_state_fills` reads them back — so
|
|
30409
30409
|
* the derived key and the extracted key meet at the same string.
|
|
30410
30410
|
*
|
|
30411
30411
|
* This is the single source of truth the static fence renderer keys its
|