jssm 5.162.1 → 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 +3 -3
- 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 +3 -3
- package/dist/deno/jssm.d.ts +60 -59
- package/dist/deno/jssm.js +1 -1
- package/dist/deno/jssm_compiler.d.ts +5 -5
- package/dist/deno/jssm_types.d.ts +21 -21
- package/dist/deno/jssm_viz.d.ts +1 -1
- package/dist/fence/fence.js +58 -58
- 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 +82 -81
- package/jssm.es6.d.ts +82 -81
- package/jssm.fence.d.ts +72 -71
- package/jssm_viz.es5.d.cts +73 -72
- package/jssm_viz.es6.d.ts +73 -72
- package/package.json +1 -1
|
@@ -25,8 +25,8 @@ declare function nth_matching_loc<StateType, mDT>(tree: JssmParseTree<StateType,
|
|
|
25
25
|
*
|
|
26
26
|
* @internal
|
|
27
27
|
*
|
|
28
|
-
* @
|
|
29
|
-
* @
|
|
28
|
+
* @typeParam StateType The type of state names (usually `string`).
|
|
29
|
+
* @typeParam mDT The type of the machine data member; usually omitted.
|
|
30
30
|
*
|
|
31
31
|
* @param this_se - The parsed semi-edge containing kind, action, and
|
|
32
32
|
* probability metadata.
|
|
@@ -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';
|
|
@@ -329,7 +329,7 @@ declare function membership_distance(registry: JssmGroupRegistry, state: string,
|
|
|
329
329
|
* const toggle = jssm.from('up <=> down;');
|
|
330
330
|
* ```
|
|
331
331
|
*
|
|
332
|
-
* @
|
|
332
|
+
* @typeParam mDT The type of the machine data member; usually omitted
|
|
333
333
|
*
|
|
334
334
|
* @param tree The parse tree to be boiled down into a machine config. If the
|
|
335
335
|
* tree was produced with `parse(input, { locations: true })`, any
|
|
@@ -350,7 +350,7 @@ declare function compile<StateType, mDT>(tree: JssmParseTree<StateType, mDT>): J
|
|
|
350
350
|
* Not generally meant for external use. Please see {@link compile} or
|
|
351
351
|
* {@link sm}.
|
|
352
352
|
*
|
|
353
|
-
* @
|
|
353
|
+
* @typeParam mDT The type of the machine data member; usually omitted
|
|
354
354
|
*
|
|
355
355
|
* @param plan The FSL code to be evaluated and built into a machine config
|
|
356
356
|
*
|
|
@@ -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,21 +1321,21 @@ 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
|
-
* @
|
|
1327
|
-
* @
|
|
1326
|
+
* @typeParam mDT The type of the machine data member.
|
|
1327
|
+
* @typeParam Ev The event name.
|
|
1328
1328
|
*/
|
|
1329
1329
|
type JssmEventFilter<mDT, Ev extends JssmEventName> = JssmEventFilterMap<mDT>[Ev];
|
|
1330
1330
|
/**
|
|
1331
1331
|
* Per-event handler signature. Receives a detail object typed by event
|
|
1332
1332
|
* name, so `e.action` (etc.) only exist where they're meaningful.
|
|
1333
|
-
* @
|
|
1334
|
-
* @
|
|
1333
|
+
* @typeParam mDT The type of the machine data member.
|
|
1334
|
+
* @typeParam Ev The event name.
|
|
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
|