@typeonce/ritmo-devtools 0.14.0 → 0.16.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/CHANGELOG.md +283 -0
- package/README.md +303 -55
- package/dist/Desync.d.ts +23 -3
- package/dist/Desync.d.ts.map +1 -1
- package/dist/Desync.js +17 -15
- package/dist/Desync.js.map +1 -1
- package/dist/Determinism.d.ts +20 -6
- package/dist/Determinism.d.ts.map +1 -1
- package/dist/Determinism.js +11 -3
- package/dist/Determinism.js.map +1 -1
- package/dist/Format.d.ts +43 -8
- package/dist/Format.d.ts.map +1 -1
- package/dist/Format.js +66 -31
- package/dist/Format.js.map +1 -1
- package/dist/Fuzz.d.ts +275 -0
- package/dist/Fuzz.d.ts.map +1 -0
- package/dist/Fuzz.js +362 -0
- package/dist/Fuzz.js.map +1 -0
- package/dist/Invariant.d.ts +9 -2
- package/dist/Invariant.d.ts.map +1 -1
- package/dist/Invariant.js.map +1 -1
- package/dist/Lint.d.ts +11 -5
- package/dist/Lint.d.ts.map +1 -1
- package/dist/Lint.js.map +1 -1
- package/dist/PlaywrightEngine.d.ts +29 -0
- package/dist/PlaywrightEngine.d.ts.map +1 -0
- package/dist/PlaywrightEngine.js +196 -0
- package/dist/PlaywrightEngine.js.map +1 -0
- package/dist/Replay.d.ts +47 -23
- package/dist/Replay.d.ts.map +1 -1
- package/dist/Replay.js +26 -30
- package/dist/Replay.js.map +1 -1
- package/dist/ReplayNodeSink.d.ts.map +1 -1
- package/dist/ReplayNodeSink.js +4 -1
- package/dist/ReplayNodeSink.js.map +1 -1
- package/dist/ReplayVitePlugin.d.ts +1 -0
- package/dist/ReplayVitePlugin.d.ts.map +1 -1
- package/dist/ReplayVitePlugin.js.map +1 -1
- package/dist/Session.d.ts +224 -18
- package/dist/Session.d.ts.map +1 -1
- package/dist/Session.js +571 -58
- package/dist/Session.js.map +1 -1
- package/dist/Verify.d.ts +150 -0
- package/dist/Verify.d.ts.map +1 -0
- package/dist/Verify.js +154 -0
- package/dist/Verify.js.map +1 -0
- package/dist/cli.js +157 -16
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/dependencyScan.d.ts +44 -0
- package/dist/internal/dependencyScan.d.ts.map +1 -0
- package/dist/internal/dependencyScan.js +313 -0
- package/dist/internal/dependencyScan.js.map +1 -0
- package/dist/internal/fuzzNetwork.d.ts +56 -0
- package/dist/internal/fuzzNetwork.d.ts.map +1 -0
- package/dist/internal/fuzzNetwork.js +96 -0
- package/dist/internal/fuzzNetwork.js.map +1 -0
- package/dist/internal/simulationCoverage.d.ts.map +1 -1
- package/dist/internal/simulationCoverage.js +2 -1
- package/dist/internal/simulationCoverage.js.map +1 -1
- package/dist/internal/skillLink.d.ts +14 -0
- package/dist/internal/skillLink.d.ts.map +1 -0
- package/dist/internal/skillLink.js +46 -0
- package/dist/internal/skillLink.js.map +1 -0
- package/dist/internal/values.d.ts +9 -1
- package/dist/internal/values.d.ts.map +1 -1
- package/dist/internal/values.js +11 -1
- package/dist/internal/values.js.map +1 -1
- package/dist/internal/verifyRunner.d.ts +19 -0
- package/dist/internal/verifyRunner.d.ts.map +1 -0
- package/dist/internal/verifyRunner.js +47 -0
- package/dist/internal/verifyRunner.js.map +1 -0
- package/dist/internal/version.d.ts +1 -1
- package/dist/internal/version.js +1 -1
- package/package.json +28 -3
- package/src/Desync.ts +40 -17
- package/src/Determinism.ts +49 -11
- package/src/Format.ts +101 -34
- package/src/Fuzz.ts +551 -0
- package/src/Invariant.ts +9 -2
- package/src/Lint.ts +11 -5
- package/src/PlaywrightEngine.ts +232 -0
- package/src/Replay.ts +100 -47
- package/src/ReplayNodeSink.ts +4 -1
- package/src/ReplayVitePlugin.ts +1 -0
- package/src/Session.ts +816 -73
- package/src/Verify.ts +276 -0
- package/src/cli.ts +150 -15
- package/src/index.ts +3 -2
- package/src/internal/dependencyScan.ts +356 -0
- package/src/internal/fuzzNetwork.ts +130 -0
- package/src/internal/simulationCoverage.ts +2 -1
- package/src/internal/skillLink.ts +53 -0
- package/src/internal/values.ts +20 -1
- package/src/internal/verifyRunner.ts +46 -0
- package/src/internal/version.ts +1 -1
- package/dist/Monitor.d.ts +0 -101
- package/dist/Monitor.d.ts.map +0 -1
- package/dist/Monitor.js +0 -602
- package/dist/Monitor.js.map +0 -1
- package/dist/internal/monitor.d.ts +0 -126
- package/dist/internal/monitor.d.ts.map +0 -1
- package/dist/internal/monitor.js +0 -279
- package/dist/internal/monitor.js.map +0 -1
- package/src/Monitor.ts +0 -713
- package/src/internal/monitor.ts +0 -370
package/dist/Monitor.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A live monitor panel for a running game in the browser: how the game is
|
|
3
|
-
* built and what it is doing, without reading its code.
|
|
4
|
-
*
|
|
5
|
-
* - **Overview**: time per schedule tick, the busiest systems, entity counts
|
|
6
|
-
* over the last seconds, state machines, and alerts (failed systems, NaN or
|
|
7
|
-
* infinite numbers written, messages discarded by skipped systems).
|
|
8
|
-
* - **Systems**: every schedule as its systems in order, grouped by run
|
|
9
|
-
* conditions, with what each reads, writes, emits, and spawns. A dot shows
|
|
10
|
-
* whether a system is working, idle, or skipped. Hover a name to light up
|
|
11
|
-
* the systems that write it (orange) and read it (blue).
|
|
12
|
-
* - **Entity**: pick an entity on screen (or by id) to follow its components
|
|
13
|
-
* live and the changes systems make to it.
|
|
14
|
-
*
|
|
15
|
-
* The monitor observes the runtime only while it is open, so a closed monitor
|
|
16
|
-
* costs nothing. While open it reduces trace events to counts and shows its
|
|
17
|
-
* own cost per tick. It needs a runtime made with `debug: { hostClock }`, and the page passed as `host`.
|
|
18
|
-
*
|
|
19
|
-
* @module Monitor
|
|
20
|
-
* @docGroup devtools
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const monitor = Monitor.attach(runtime, {
|
|
25
|
-
* host: window,
|
|
26
|
-
* schedules: { fixedUpdate: step, frame },
|
|
27
|
-
* pick: (event) => entityUnderPointer(event),
|
|
28
|
-
* locate: (entity) => screenPositionOf(entity)
|
|
29
|
-
* })
|
|
30
|
-
* // Toggle with the backslash key or the corner button.
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
import type * as Debug from "@typeonce/ritmo/Debug";
|
|
34
|
-
import type { AnyScheduleOrder, ExecutableScheduleDefinition } from "@typeonce/ritmo/Schedule";
|
|
35
|
-
import type { Schema } from "@typeonce/ritmo/Schema";
|
|
36
|
-
import { Collector, recentSchedule, recentSystem } from "./internal/monitor.ts";
|
|
37
|
-
/**
|
|
38
|
-
* The numbers behind the panel, without DOM: pass `collector.observe` to
|
|
39
|
-
* `debug.observe`, call `sample(now)` periodically, read `history`, `alerts`,
|
|
40
|
-
* spawn kinds, and the selected entity's changes. Use it for a custom UI or in
|
|
41
|
-
* tests.
|
|
42
|
-
*/
|
|
43
|
-
export { Collector, recentSchedule, recentSystem };
|
|
44
|
-
export type { Alert, CollectorOptions, EntityLine, Sample, ScheduleWindow, SpawnKind, SystemWindow } from "./internal/monitor.ts";
|
|
45
|
-
/** What the monitor needs from a runtime: its debug handle. */
|
|
46
|
-
export interface Target<S extends Schema.Any, Root> {
|
|
47
|
-
readonly debug: Debug.Handle<S, Root>;
|
|
48
|
-
}
|
|
49
|
-
/** What `attach` shows, where, and how the panel is opened. */
|
|
50
|
-
export interface Options<S extends Schema.Any, Root> {
|
|
51
|
-
/**
|
|
52
|
-
* The schedules the game ticks, by name. They name the schedules in the
|
|
53
|
-
* panel and make up the system map. Name the schedule objects actually
|
|
54
|
-
* passed to `tick`: nested schedules are flattened into them.
|
|
55
|
-
*/
|
|
56
|
-
readonly schedules: Readonly<Record<string, ExecutableScheduleDefinition<S, any, Root, any, any, AnyScheduleOrder>>>;
|
|
57
|
-
/**
|
|
58
|
-
* The page the panel lives in, passed explicitly (`window`): its
|
|
59
|
-
* `document`, timers, animation frames, keyboard events, and
|
|
60
|
-
* `performance` clock. The monitor reads no globals.
|
|
61
|
-
*/
|
|
62
|
-
readonly host: Window;
|
|
63
|
-
/** Where the panel is added. Defaults to `host.document.body`. */
|
|
64
|
-
readonly mount?: HTMLElement;
|
|
65
|
-
/** `KeyboardEvent.code` that toggles the panel. Defaults to `Backslash`. */
|
|
66
|
-
readonly key?: string;
|
|
67
|
-
/** Opens the panel right away. */
|
|
68
|
-
readonly open?: boolean;
|
|
69
|
-
/** The entity under a pointer event, for "Pick on screen". */
|
|
70
|
-
readonly pick?: (event: PointerEvent) => number | undefined;
|
|
71
|
-
/** An entity's position in client (viewport) pixels, to mark the selected entity. */
|
|
72
|
-
readonly locate?: (entity: number) => {
|
|
73
|
-
readonly x: number;
|
|
74
|
-
readonly y: number;
|
|
75
|
-
} | undefined;
|
|
76
|
-
/** Milliseconds between panel refreshes. Defaults to 250. */
|
|
77
|
-
readonly refreshMs?: number;
|
|
78
|
-
/**
|
|
79
|
-
* A replay recorder (`Replay.recorder`): adds a "Save replay" button that
|
|
80
|
-
* saves the last seconds of play with the reason "Save replay button".
|
|
81
|
-
*/
|
|
82
|
-
readonly replay?: {
|
|
83
|
-
readonly save: (reason: string) => unknown;
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
/** An attached monitor panel, from `attach`. */
|
|
87
|
-
export interface Monitor {
|
|
88
|
-
readonly open: () => void;
|
|
89
|
-
readonly close: () => void;
|
|
90
|
-
readonly toggle: () => void;
|
|
91
|
-
/** Selects an entity in the Entity tab (`undefined` clears it). */
|
|
92
|
-
readonly select: (entity: number | undefined) => void;
|
|
93
|
-
/** Removes the panel and stops observing. */
|
|
94
|
-
readonly detach: () => void;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Adds the monitor to the page. The panel starts closed unless `open` is set;
|
|
98
|
-
* toggle it with the key (`Backslash` by default) or the corner button.
|
|
99
|
-
*/
|
|
100
|
-
export declare const attach: <S extends Schema.Any, Root>(runtime: Target<S, Root>, options: Options<S, Root>) => Monitor;
|
|
101
|
-
//# sourceMappingURL=Monitor.d.ts.map
|
package/dist/Monitor.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Monitor.d.ts","sourceRoot":"","sources":["../src/Monitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAA;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAGpD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAG/E;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,CAAA;AAClD,YAAY,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEjI,+DAA+D;AAC/D,MAAM,WAAW,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,IAAI;IAChD,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;CACtC;AAED,+DAA+D;AAC/D,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,IAAI;IACjD;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;IACpH;;;;OAIG;IACH,QAAQ,CAAC,IA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