libpetri 1.5.1 → 1.8.0
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/dist/debug/index.d.ts +237 -15
- package/dist/debug/index.js +236 -45
- package/dist/debug/index.js.map +1 -1
- package/dist/doclet/index.d.ts +1 -1
- package/dist/{event-store-Y8q_wapJ.d.ts → event-store-BnyHh3TF.d.ts} +1 -1
- package/dist/export/index.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +28 -6
- package/dist/index.js.map +1 -1
- package/dist/{petri-net-C3Jy5HCt.d.ts → petri-net-D-GN9g_D.d.ts} +31 -4
- package/dist/verification/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,15 @@ interface Token<T> {
|
|
|
8
8
|
readonly value: T;
|
|
9
9
|
/** Epoch milliseconds when the token was created. */
|
|
10
10
|
readonly createdAt: number;
|
|
11
|
+
/**
|
|
12
|
+
* JSON-friendly projection of the token value, populated by
|
|
13
|
+
* {@link SessionArchiveReader} when hydrating a v3 archive so replay
|
|
14
|
+
* consumers see the same structured shape the writer emitted. Live tokens
|
|
15
|
+
* (produced by {@link tokenOf} / {@link tokenAt}) leave this `undefined`;
|
|
16
|
+
* the runtime ignores it. See [EVT-025](../../../spec/08-events-observability.md)
|
|
17
|
+
* AC5. (libpetri 1.8.0+)
|
|
18
|
+
*/
|
|
19
|
+
readonly structured?: unknown;
|
|
11
20
|
}
|
|
12
21
|
/** Creates a token with the given value and current timestamp. */
|
|
13
22
|
declare function tokenOf<T>(value: T): Token<T>;
|
|
@@ -364,10 +373,28 @@ declare class TransitionContext {
|
|
|
364
373
|
/** Returns declared read places (context, not consumed). */
|
|
365
374
|
readPlaces(): ReadonlySet<Place<any>>;
|
|
366
375
|
private requireRead;
|
|
367
|
-
/**
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
376
|
+
/**
|
|
377
|
+
* Add one or more output values to the same place in a single call.
|
|
378
|
+
*
|
|
379
|
+
* Validates the place once, then appends each value to the output
|
|
380
|
+
* collector. Calling with zero values is a no-op.
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ctx.output(outPlace, 'a', 'b', 'c');
|
|
384
|
+
* ctx.output(outPlace, ...someArray);
|
|
385
|
+
*
|
|
386
|
+
* @throws if place not declared as output.
|
|
387
|
+
*/
|
|
388
|
+
output<T>(place: Place<T>, ...values: T[]): this;
|
|
389
|
+
/**
|
|
390
|
+
* Add one or more pre-built output tokens to the same place in a single call.
|
|
391
|
+
*
|
|
392
|
+
* Validates the place once, then appends each token. Calling with zero
|
|
393
|
+
* tokens is a no-op.
|
|
394
|
+
*
|
|
395
|
+
* @throws if place not declared as output.
|
|
396
|
+
*/
|
|
397
|
+
outputToken<T>(place: Place<T>, ...tokens: Token<T>[]): this;
|
|
371
398
|
/** Returns declared output places. */
|
|
372
399
|
outputPlaces(): ReadonlySet<Place<any>>;
|
|
373
400
|
private requireOutput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Place, b as Transition, a as PetriNet, E as EnvironmentPlace } from '../petri-net-
|
|
1
|
+
import { P as Place, b as Transition, a as PetriNet, E as EnvironmentPlace } from '../petri-net-D-GN9g_D.js';
|
|
2
2
|
import { Expr, init, Bool, FuncDecl } from 'z3-solver';
|
|
3
3
|
|
|
4
4
|
/**
|