@moku-labs/game 0.15.101 → 0.15.102

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.
Files changed (35) hide show
  1. package/dist/app/page.d.mts +1 -1
  2. package/dist/app/page.mjs +1 -1
  3. package/dist/app/system.d.mts +3 -3
  4. package/dist/app.d.mts +3 -3
  5. package/dist/app.mjs +1 -1
  6. package/dist/assets.d.mts +1 -1
  7. package/dist/{commands-DFCBw6F2.d.mts → commands-C2JXDkUV.d.mts} +19 -10
  8. package/dist/control.d.mts +10 -6
  9. package/dist/control.mjs +2 -2
  10. package/dist/{define-6cjZwkJu.d.mts → define-DNF9A0ce.d.mts} +2 -2
  11. package/dist/{headless-WyPk3UrP.d.mts → headless-CEG1oR5D.d.mts} +1 -1
  12. package/dist/{index-Bz6p2alA.d.mts → index-DtbI1op8.d.mts} +3 -3
  13. package/dist/index.d.mts +4 -4
  14. package/dist/index.mjs +1 -1
  15. package/dist/inspect.d.mts +6 -6
  16. package/dist/inspect.mjs +2 -2
  17. package/dist/jsx-dev-runtime.d.mts +1 -1
  18. package/dist/jsx-runtime.d.mts +1 -1
  19. package/dist/{run-B5if0jxE.mjs → run-pCQlIaNP.mjs} +46 -3
  20. package/dist/{runtime-BDCv5mp-.d.mts → runtime-CcHPrVBm.d.mts} +1 -1
  21. package/dist/{session-D0AYRm5T.mjs → session-ClUqpGId.mjs} +138 -2
  22. package/dist/{sources-Cqqz-0-b.mjs → sources-BJyIJf_X.mjs} +1 -1
  23. package/dist/{src-DsyJR7Ds.mjs → src-CilP057R.mjs} +89 -38
  24. package/dist/testing.d.mts +4 -4
  25. package/dist/testing.mjs +1 -1
  26. package/dist/{types-Cx_-n0Ts.d.mts → types-C1B7-x7p.d.mts} +1 -1
  27. package/dist/{types-DyohsXF_.d.mts → types-C612npUH.d.mts} +2 -2
  28. package/dist/{types-Co-6A6Y8.d.mts → types-Cdzw3as5.d.mts} +2 -2
  29. package/dist/{types-BzVQAaSX.d.mts → types-Ce5W0gZe.d.mts} +45 -7
  30. package/dist/{types-Dx2qRDFg.d.mts → types-IJXSUFJa.d.mts} +4 -4
  31. package/dist/{visual-D5L3ZtuQ.d.mts → visual-BoSpJLWP.d.mts} +6 -6
  32. package/dist/visual.d.mts +1 -1
  33. package/dist/visual.mjs +2 -2
  34. package/llms.txt +4 -4
  35. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { h as StartedPage, r as GameConfig, t as AnyGameApp, u as PageOptions } from "../types-Dx2qRDFg.mjs";
1
+ import { h as StartedPage, r as GameConfig, t as AnyGameApp, u as PageOptions } from "../types-IJXSUFJa.mjs";
2
2
 
3
3
  //#region src/app/page.d.ts
4
4
  /**
package/dist/app/page.mjs CHANGED
@@ -2,7 +2,7 @@ import { i as systemSource, t as memory } from "../memory-DeD9wis6.mjs";
2
2
  import { t as applyTo } from "../drafts-BawpSaVp.mjs";
3
3
  import { i as isControl } from "../dev-BNndV-hU.mjs";
4
4
  import { n as fakeClock, t as VISUAL_CLOCK } from "../fake-hnJcJeYf.mjs";
5
- import { n as read, r as watch, t as sources } from "../sources-Cqqz-0-b.mjs";
5
+ import { n as read, r as watch, t as sources } from "../sources-BJyIJf_X.mjs";
6
6
  import { n as resolveConfig } from "../config-DVqciSkP.mjs";
7
7
  //#region src/app/boot.ts
8
8
  /** How long after the fade the timer removes a picture whose transition never ended, ms. */
@@ -1,6 +1,6 @@
1
- import { qr as PlayerStateProvider } from "../types-BzVQAaSX.mjs";
2
- import { Tt as PlatformProvider } from "../index-Bz6p2alA.mjs";
3
- import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-Dx2qRDFg.mjs";
1
+ import { qr as PlayerStateProvider } from "../types-Ce5W0gZe.mjs";
2
+ import { Tt as PlatformProvider } from "../index-DtbI1op8.mjs";
3
+ import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-IJXSUFJa.mjs";
4
4
  import { Back, Haptics, KeepAwake, Lifecycle, Store } from "@moku-labs/system";
5
5
 
6
6
  //#region src/app/system.d.ts
package/dist/app.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { Hr as Json } from "./types-BzVQAaSX.mjs";
2
- import { q as StringTable } from "./types-Cx_-n0Ts.mjs";
3
- import { _ as SystemName, a as GameHandle, c as MemoryProvider, d as PlistValue, f as SaveKind, i as GameDefinition, l as PageAgent, m as ScreenSeams, n as GameApp, o as GamePluginConfigs, p as Scenario, r as GameConfig, s as HeadlessSeams, y as WithGameState } from "./types-Dx2qRDFg.mjs";
1
+ import { Hr as Json } from "./types-Ce5W0gZe.mjs";
2
+ import { q as StringTable } from "./types-C1B7-x7p.mjs";
3
+ import { _ as SystemName, a as GameHandle, c as MemoryProvider, d as PlistValue, f as SaveKind, i as GameDefinition, l as PageAgent, m as ScreenSeams, n as GameApp, o as GamePluginConfigs, p as Scenario, r as GameConfig, s as HeadlessSeams, y as WithGameState } from "./types-IJXSUFJa.mjs";
4
4
  import { AnyPluginInstance } from "@moku-labs/core";
5
5
 
6
6
  //#region src/app/define.d.ts
package/dist/app.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as flattenFeatures, Nt as effectsPlugin, Wt as audioPlugin, Z as platformPlugin, i as screen, t as createApp } from "./src-DsyJR7Ds.mjs";
1
+ import { C as flattenFeatures, Nt as effectsPlugin, Wt as audioPlugin, Z as platformPlugin, i as screen, t as createApp } from "./src-CilP057R.mjs";
2
2
  import { t as memory } from "./memory-DeD9wis6.mjs";
3
3
  import { n as fakeClock, r as isFakeClock } from "./fake-hnJcJeYf.mjs";
4
4
  //#region src/app/define.ts
package/dist/assets.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { d as Manifest } from "./types-BzVQAaSX.mjs";
1
+ import { d as Manifest } from "./types-Ce5W0gZe.mjs";
2
2
 
3
3
  //#region src/plugins/assets/scan/cli.d.ts
4
4
  /**
@@ -1,8 +1,8 @@
1
- import { $r as StoreApi, D as DebugSwitches, In as FlowState, Nn as Bookmark, Or as Api$2, Z as Api$1, Zr as Snapshot, ft as Captured, mi as Time, ni as Api, ui as FrameRate, w as ScenesApi } from "./types-BzVQAaSX.mjs";
2
- import { U as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-Co-6A6Y8.mjs";
3
- import { L as InputApi } from "./types-Cx_-n0Ts.mjs";
4
- import { t as HeadlessApp } from "./headless-WyPk3UrP.mjs";
5
- import { i as ControlApp, r as Command } from "./types-DyohsXF_.mjs";
1
+ import { $r as StoreApi, D as DebugSwitches, In as FlowState, Nn as Bookmark, Nr as Api, Or as Api$3, Z as Api$2, Zr as Snapshot, ft as Captured, mi as Time, ni as Api$1, ui as FrameRate, w as ScenesApi } from "./types-Ce5W0gZe.mjs";
2
+ import { U as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-Cdzw3as5.mjs";
3
+ import { L as InputApi } from "./types-C1B7-x7p.mjs";
4
+ import { t as HeadlessApp } from "./headless-CEG1oR5D.mjs";
5
+ import { i as ControlApp, r as Command } from "./types-C612npUH.mjs";
6
6
 
7
7
  //#region src/plugins/flow/doors/commands.d.ts
8
8
  /**
@@ -89,15 +89,24 @@ declare const commands: Readonly<{
89
89
  readonly frames: "number";
90
90
  readonly deltaMs: "number?";
91
91
  }, Readonly<Time>, ControlApp>;
92
+ clock: Command<{
93
+ readonly advanceMs: "number";
94
+ }, {
95
+ now: number;
96
+ }, HeadlessApp & {
97
+ readonly log: import("@moku-labs/common/browser").LogApi;
98
+ } & {
99
+ readonly clock?: Api;
100
+ }>;
92
101
  pause: Command<{}, boolean, HeadlessApp & {
93
102
  readonly log: import("@moku-labs/common/browser").LogApi;
94
103
  } & {
95
- readonly lifecycle: Api;
104
+ readonly lifecycle: Api$1;
96
105
  }>;
97
106
  resume: Command<{}, boolean, HeadlessApp & {
98
107
  readonly log: import("@moku-labs/common/browser").LogApi;
99
108
  } & {
100
- readonly lifecycle: Api;
109
+ readonly lifecycle: Api$1;
101
110
  }>;
102
111
  capture: Command<{
103
112
  readonly legend: "boolean?";
@@ -107,9 +116,9 @@ declare const commands: Readonly<{
107
116
  }, Captured | undefined, HeadlessApp & {
108
117
  readonly log: import("@moku-labs/common/browser").LogApi;
109
118
  } & {
110
- readonly renderer: Api$1;
119
+ readonly renderer: Api$2;
111
120
  } & {
112
- readonly world: Api$2;
121
+ readonly world: Api$3;
113
122
  }>;
114
123
  debug: Command<{
115
124
  readonly nineSlice: "boolean?";
@@ -119,7 +128,7 @@ declare const commands: Readonly<{
119
128
  }, DebugSwitches, HeadlessApp & {
120
129
  readonly log: import("@moku-labs/common/browser").LogApi;
121
130
  } & {
122
- readonly renderer: Api$1;
131
+ readonly renderer: Api$2;
123
132
  }>;
124
133
  reducedMotion: Command<{
125
134
  readonly on: "boolean";
@@ -1,7 +1,7 @@
1
- import { t as HeadlessApp } from "./headless-WyPk3UrP.mjs";
2
- import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-DyohsXF_.mjs";
3
- import { t as commands } from "./commands-DFCBw6F2.mjs";
4
- import { t as defineCommand } from "./define-6cjZwkJu.mjs";
1
+ import { t as HeadlessApp } from "./headless-CEG1oR5D.mjs";
2
+ import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-C612npUH.mjs";
3
+ import { t as commands } from "./commands-C2JXDkUV.mjs";
4
+ import { t as defineCommand } from "./define-DNF9A0ce.mjs";
5
5
 
6
6
  //#region src/plugins/flow/doors/dev.d.ts
7
7
  /**
@@ -180,7 +180,8 @@ declare function controlReadOnly(id: string): ControlReadOnlyError;
180
180
  /**
181
181
  * Runs a command in a dev build or a debug build. A `--debug` build and the dev page run every
182
182
  * command; a `--debug=read` build runs the read and cosmetic ones only. A `cheat` or `raw`
183
- * command taints the session and is journaled before it runs, so a failing one still counts.
183
+ * command taints the session and is journaled before it runs, once its input fits its schema, so
184
+ * one that fails in its body still counts.
184
185
  *
185
186
  * @param app - The app the command acts on.
186
187
  * @param command - The command.
@@ -189,6 +190,9 @@ declare function controlReadOnly(id: string): ControlReadOnlyError;
189
190
  * @throws {Error} Outside dev builds and debug builds (every command with `--debug`; the read and
190
191
  * cosmetic ones alone with `--debug=read`), the read-only refusal of `controlReadOnly` for a
191
192
  * `route`, `cheat` or `raw` command on a `--debug=read` page, and whatever the command throws.
193
+ * @throws {TypeError} When the input has a field the schema does not name, leaves out a field
194
+ * without `?`, or holds a value of another kind (a `number` must be finite); nothing runs then.
195
+ * On a `--debug=read` page a `route` command throws "[game] The command game.tap changes the game: …".
192
196
  * @example
193
197
  * ```ts
194
198
  * // An e2e script: load the bug report, then tap Play.
@@ -196,7 +200,7 @@ declare function controlReadOnly(id: string): ControlReadOnlyError;
196
200
  * const ran = await run(app, commands.answer, { intent: "play" });
197
201
  * ran.value; // true
198
202
  * ran.state; // { path: "board/awaitIntent", frame: 14, tainted: true }
199
- * // On a --debug=read page: await run(app, commands.tap, { key: "play" }); // throws "[game] The command game.tap changes the game: …"
203
+ * await run(app, commands.scroll, { key: "strip", dy: 10 }); // throws '[game] The command game.scroll got the field "dy", which it does not take. …'
200
204
  * ```
201
205
  */
202
206
  declare function run<S extends InputSchema, O, App extends HeadlessApp>(app: App, command: Command<S, O, App>, ...input: InputArguments<S>): Promise<Ran<O>>;
package/dist/control.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  import { n as controlRefused, t as controlReadOnly } from "./dev-BNndV-hU.mjs";
2
- import { s as defineCommand } from "./session-D0AYRm5T.mjs";
3
- import { n as commands, t as run } from "./run-B5if0jxE.mjs";
2
+ import { c as defineCommand } from "./session-ClUqpGId.mjs";
3
+ import { n as commands, t as run } from "./run-pCQlIaNP.mjs";
4
4
  export { commands, controlReadOnly, controlRefused, defineCommand, run };
@@ -1,5 +1,5 @@
1
- import { t as HeadlessApp } from "./headless-WyPk3UrP.mjs";
2
- import { l as Source, r as Command, s as InputSchema } from "./types-DyohsXF_.mjs";
1
+ import { t as HeadlessApp } from "./headless-CEG1oR5D.mjs";
2
+ import { l as Source, r as Command, s as InputSchema } from "./types-C612npUH.mjs";
3
3
 
4
4
  //#region src/plugins/flow/doors/define.d.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { Hr as Json, In as FlowState, Jn as Answer, Ln as JournalEntry, ci as Api, fn as Api$1, ti as RngState, zn as RouteStep } from "./types-BzVQAaSX.mjs";
1
+ import { Hr as Json, In as FlowState, Jn as Answer, Ln as JournalEntry, ci as Api, fn as Api$1, ti as RngState, zn as RouteStep } from "./types-Ce5W0gZe.mjs";
2
2
 
3
3
  //#region src/plugins/flow/headless.d.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { $n as Ease, $r as StoreApi, An as FeaturePlugin, Bn as SceneIdOf, Br as Config$5, C as SceneSpec, Cr as QueryTerm, Dr as TagType, Er as SystemFor, F as HudPartValue, Fr as Config$2, Ft as PassKind, G as SpriteOptions, Gn as GuideOptions, H as ShapeValue, Hn as Descriptor, Hr as Json, J as TransformValue, K as SpriteValue, Kn as Hint, Kr as Patch, L as NineSliceValue, Lr as State$2, Nr as Api$1, Or as Api$6, Pn as DefineNode, Q as Config$6, Qn as DescriptionNode, S as SceneDefinition, Sr as Narrowed, T as State$7, Tr as SystemDefinition, Tt as FrameRing, Un as Effect, Ur as Root, Wn as EffectOptions, Wr as State$5, Y as sprite, Yn as Answered, Z as Api$4, _ as AnySceneProjection, _i as Events$1, _n as HudKeysOf, _r as ComponentValue, _t as ViewportSize, a as Config$1, ai as PauseReason, ar as ProjectionSpec, bn as TextFormatsOf, c as LoadBundles, ci as Api$5, di as RateChange, ei as RngApi, f as ReadyBundles, fi as State$8, fn as Api$2, gi as Config$10, gn as GameTypes, gr as ComponentType, hn as EmitterIdOf, i as BundleSpec, ii as Events, ir as ProjectionMotion, jn as FeatureTree, jr as State$9, kn as FeatureDescription, kr as Config$9, l as LoadReason, li as Config$8, m as Tier, mn as Config$3, mr as ComponentHandle, ni as Api$3, o as DefineBundles, oi as State$4, or as ReducedMotion, p as State$1, pi as ThermalReading, pn as BundlesOf, r as BundleMap, ri as Config$4, rr as NumericFields, st as State$6, t as Api, u as LoadResult, v as Config$7, vi as Require, w as ScenesApi, wn as defineFlow, wr as ResourceType, wt as FrameRecord, x as LayerMap, xn as TextStylesOf, xr as Mut, y as DefineScene, yn as State$3, z as OverlayValue } from "./types-BzVQAaSX.mjs";
2
- import { $ as Step, A as EmitterValue, B as NoiseValue, C as GradeValue, D as VignetteValue, E as ShineValue, G as Config$11, H as UniformDeclaration, I as FilterComponent, J as State$10, K as FramesValue, L as FilterSpec, M as BlurValue, N as ColorMatrixValue, O as EmitterConfig, P as DisplacementValue, Q as SfxDescriptor, R as FilterValueOf, S as FoldValue, T as RevealRoundValue, U as AnimApi, V as OutlineValue, W as AnimPlayerValue, Y as Target, Z as HapticKind, _ as State$12, a as AudioApi, b as DissolveValue, c as MusicDescriptor, d as State$11, f as VolumesFor, h as EffectsApi, j as AlphaValue, k as EmitterDefinition, l as MusicOptions, m as Config$13, n as State$13, q as MotionKeyframe, r as UiApi, s as Config$12, st as play, t as Config$14, tt as defineAnimation, vt as OverlayApi, w as RevealLineValue, x as FlashValue, y as AuraValue, z as GlowValue } from "./types-Co-6A6Y8.mjs";
3
- import { $ as Style, A as TextFormats, B as Argument, C as Point, E as TextBind, F as defineComponent, G as Part, H as I18nApi, I as Config$16, J as TextKey, K as State$14, L as InputApi, M as TextStyles, N as TextValue, Q as ResolvedStyle, R as State$15, T as TextApi, U as IntlKit, V as Config$15, W as Message, Y as TypedTr, Z as IsFlags, b as Config$17, g as IntrinsicElementsFor, h as defineTokens, j as TextStyleInput, k as TextFormatFunction, s as PopupComponent, tt as WhenFlags, v as BindField, w as State$16, x as CountdownValue, y as BindOptions } from "./types-Cx_-n0Ts.mjs";
1
+ import { $n as Ease, $r as StoreApi, An as FeaturePlugin, Bn as SceneIdOf, Br as Config$5, C as SceneSpec, Cr as QueryTerm, Dr as TagType, Er as SystemFor, F as HudPartValue, Fr as Config$2, Ft as PassKind, G as SpriteOptions, Gn as GuideOptions, H as ShapeValue, Hn as Descriptor, Hr as Json, J as TransformValue, K as SpriteValue, Kn as Hint, Kr as Patch, L as NineSliceValue, Lr as State$2, Nr as Api$1, Or as Api$6, Pn as DefineNode, Q as Config$6, Qn as DescriptionNode, S as SceneDefinition, Sr as Narrowed, T as State$7, Tr as SystemDefinition, Tt as FrameRing, Un as Effect, Ur as Root, Wn as EffectOptions, Wr as State$5, Y as sprite, Yn as Answered, Z as Api$4, _ as AnySceneProjection, _i as Events$1, _n as HudKeysOf, _r as ComponentValue, _t as ViewportSize, a as Config$1, ai as PauseReason, ar as ProjectionSpec, bn as TextFormatsOf, c as LoadBundles, ci as Api$5, di as RateChange, ei as RngApi, f as ReadyBundles, fi as State$8, fn as Api$2, gi as Config$10, gn as GameTypes, gr as ComponentType, hn as EmitterIdOf, i as BundleSpec, ii as Events, ir as ProjectionMotion, jn as FeatureTree, jr as State$9, kn as FeatureDescription, kr as Config$9, l as LoadReason, li as Config$8, m as Tier, mn as Config$3, mr as ComponentHandle, ni as Api$3, o as DefineBundles, oi as State$4, or as ReducedMotion, p as State$1, pi as ThermalReading, pn as BundlesOf, r as BundleMap, ri as Config$4, rr as NumericFields, st as State$6, t as Api, u as LoadResult, v as Config$7, vi as Require, w as ScenesApi, wn as defineFlow, wr as ResourceType, wt as FrameRecord, x as LayerMap, xn as TextStylesOf, xr as Mut, y as DefineScene, yn as State$3, z as OverlayValue } from "./types-Ce5W0gZe.mjs";
2
+ import { $ as Step, A as EmitterValue, B as NoiseValue, C as GradeValue, D as VignetteValue, E as ShineValue, G as Config$11, H as UniformDeclaration, I as FilterComponent, J as State$10, K as FramesValue, L as FilterSpec, M as BlurValue, N as ColorMatrixValue, O as EmitterConfig, P as DisplacementValue, Q as SfxDescriptor, R as FilterValueOf, S as FoldValue, T as RevealRoundValue, U as AnimApi, V as OutlineValue, W as AnimPlayerValue, Y as Target, Z as HapticKind, _ as State$12, a as AudioApi, b as DissolveValue, c as MusicDescriptor, d as State$11, f as VolumesFor, h as EffectsApi, j as AlphaValue, k as EmitterDefinition, l as MusicOptions, m as Config$13, n as State$13, q as MotionKeyframe, r as UiApi, s as Config$12, st as play, t as Config$14, tt as defineAnimation, vt as OverlayApi, w as RevealLineValue, x as FlashValue, y as AuraValue, z as GlowValue } from "./types-Cdzw3as5.mjs";
3
+ import { $ as Style, A as TextFormats, B as Argument, C as Point, E as TextBind, F as defineComponent, G as Part, H as I18nApi, I as Config$16, J as TextKey, K as State$14, L as InputApi, M as TextStyles, N as TextValue, Q as ResolvedStyle, R as State$15, T as TextApi, U as IntlKit, V as Config$15, W as Message, Y as TypedTr, Z as IsFlags, b as Config$17, g as IntrinsicElementsFor, h as defineTokens, j as TextStyleInput, k as TextFormatFunction, s as PopupComponent, tt as WhenFlags, v as BindField, w as State$16, x as CountdownValue, y as BindOptions } from "./types-C1B7-x7p.mjs";
4
4
  import { Log } from "@moku-labs/common/browser";
5
5
  import { PluginCtx } from "@moku-labs/core";
6
6
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as MonitorConfig, $t as PerfStartupLine, At as OverlayWhat, B as Parent, Bt as PerfCollectorLine, Cn as contribution, Ct as FrameReadout, Dn as to, Dt as MONITOR_SECTIONS, E as types_d_exports$13, En as slot, Et as LongFrameEntry, F as HudPartValue, Ft as PassKind, Gr as types_d_exports$10, Gt as PerfGapLine, Ht as PerfDisplay, I as NineSlice, It as PassRecord, Jt as PerfLongFrameLine, Kt as PerfHeaderLine, Lt as PerfCause, M as WhyEntry, Mr as types_d_exports$17, Mt as PERF_GAP_BUCKETS, N as Display, Nt as PERF_LOG_VERSION, On as type, Ot as MonitorSections, P as HudPart, Pt as PROBLEM_RULES, Qn as DescriptionNode, Qt as PerfSpikeLine, R as Overlay, Rr as types_d_exports$3, Rt as PerfChange, Sn as types_d_exports$6, St as FrameReadResult, Tn as exit, Tt as FrameRing, U as Sprite, Ut as PerfEventLine, V as Shape, Vt as PerfCounts, W as SpriteBlend, Wt as PerfEventName, X as AdaptiveScale, Xn as AnchorTarget, Xr as SaveUnreadableError, Xt as PerfMeasured, Y as sprite, Yt as PerfMarkLine, Zt as PerfSampleLine, an as SHADER_WHATS, bt as WhyLive, cn as WarmDetail, dn as DEMAND_REASONS, dt as ShotsConfig, en as PerfTelemetryLine, g as types_d_exports$1, hi as types_d_exports$15, in as ProblemRule, jt as PERF_CAUSES, kt as OverlayEventDetail, ln as CANVAS_RESTARTS, lt as types_d_exports$12, nn as PoolTrimDetail, on as ShaderEventDetail, ot as PoolTrim, pt as MonitorCounts, q as Transform, qt as PerfLogLine, rn as ProblemEventDetail, si as types_d_exports$9, sn as ShaderWhat, sr as SceneSwitch, tn as PerfThermalLine, un as CanvasRestart, ut as ShotsApi, wt as FrameRecord, xt as FrameColumns, yt as RetakeWhy, z as OverlayValue, zt as PerfChangeEntry } from "./types-BzVQAaSX.mjs";
2
- import { C as GradeValue, D as VignetteValue, E as ShineValue, F as FilterArea, S as FoldValue, T as RevealRoundValue, X as types_d_exports, Z as HapticKind, _t as wait, at as mark, b as DissolveValue, ct as sequence, dt as spawn, et as HAPTIC_KINDS, ft as spawned, gt as use, ht as tween, i as types_d_exports$16, it as haptic, lt as set, mt as stopSfx, nt as external, ot as parallel, p as types_d_exports$2, pt as stagger, rt as frames, st as play, tt as defineAnimation, ut as sfx, v as types_d_exports$5, w as RevealLineValue, x as FlashValue, y as AuraValue, yt as types_d_exports$4 } from "./types-Co-6A6Y8.mjs";
3
- import { A as TextFormats, D as TextFormat, F as defineComponent, O as TextFormatAnswer, P as types_d_exports$14, S as FormattedNumber, X as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, k as TextFormatFunction, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions, z as types_d_exports$8 } from "./types-Cx_-n0Ts.mjs";
4
- import { $ as PASS_KINDS, A as cubicBezier, At as i18nPlugin, B as DropTarget, Bt as Text, C as Outline, Ct as platformPlugin, D as tr, Dt as modelPlugin, E as defineStyle, Et as types_d_exports$11, F as defineScene, Ft as audioPlugin, G as Pressable, H as Hovered, Ht as defineTextFormats, I as defineBundles, It as assetsPlugin, J as TapValue, K as Pressed, L as load, Lt as animPlugin, M as AnimPlayer, Mt as effectsPlugin, N as Animation, Nt as debugPlugin, O as messageArgument, Ot as lifecyclePlugin, P as Frames, Pt as clockPlugin, Q as Traced, R as ready, Rt as projection, S as Noise, St as rendererPlugin, T as resolve, Tt as PlatformProvider, U as Pointer, Ut as defineTextStyles, V as Held, Vt as bind, W as PointerOver, Wt as label, X as Touchable, Y as Tappable, Z as Traceable, _ as Alpha, _t as worldPlugin, a as defineEmitter, at as Tree, b as Displacement, bt as textPlugin, c as Shine, ct as resource, d as Grade, dt as defineEffect, et as frameAt, f as Fold, ft as guide, g as defineFilter, gt as flattenFeatures, h as Aura, ht as defineFeature, i as screen, it as Order, j as defineMotion, jt as flowPlugin, k as messageDuration, kt as inputPlugin, l as RevealRound, lt as system, m as Dissolve, mt as schedule, n as createPlugin, nt as Layer, o as Emitter, ot as component, p as Flash, pt as hint, q as Swipeable, r as defineGame, rt as Now, s as Vignette, st as mut, t as createApp, tt as Exiting, u as RevealLine, ut as tag, v as Blur, vt as uiPlugin, w as music, wt as BackResult, x as Glow, xt as scenesPlugin, y as ColorMatrix, yt as timePlugin, z as Draggable, zt as Countdown } from "./index-Bz6p2alA.mjs";
1
+ import { $ as MonitorConfig, $t as PerfStartupLine, At as OverlayWhat, B as Parent, Bt as PerfCollectorLine, Cn as contribution, Ct as FrameReadout, Dn as to, Dt as MONITOR_SECTIONS, E as types_d_exports$13, En as slot, Et as LongFrameEntry, F as HudPartValue, Ft as PassKind, Gr as types_d_exports$10, Gt as PerfGapLine, Ht as PerfDisplay, I as NineSlice, It as PassRecord, Jt as PerfLongFrameLine, Kt as PerfHeaderLine, Lt as PerfCause, M as WhyEntry, Mr as types_d_exports$17, Mt as PERF_GAP_BUCKETS, N as Display, Nt as PERF_LOG_VERSION, On as type, Ot as MonitorSections, P as HudPart, Pt as PROBLEM_RULES, Qn as DescriptionNode, Qt as PerfSpikeLine, R as Overlay, Rr as types_d_exports$3, Rt as PerfChange, Sn as types_d_exports$6, St as FrameReadResult, Tn as exit, Tt as FrameRing, U as Sprite, Ut as PerfEventLine, V as Shape, Vt as PerfCounts, W as SpriteBlend, Wt as PerfEventName, X as AdaptiveScale, Xn as AnchorTarget, Xr as SaveUnreadableError, Xt as PerfMeasured, Y as sprite, Yt as PerfMarkLine, Zt as PerfSampleLine, an as SHADER_WHATS, bt as WhyLive, cn as WarmDetail, dn as DEMAND_REASONS, dt as ShotsConfig, en as PerfTelemetryLine, g as types_d_exports$1, hi as types_d_exports$15, in as ProblemRule, jt as PERF_CAUSES, kt as OverlayEventDetail, ln as CANVAS_RESTARTS, lt as types_d_exports$12, nn as PoolTrimDetail, on as ShaderEventDetail, ot as PoolTrim, pt as MonitorCounts, q as Transform, qt as PerfLogLine, rn as ProblemEventDetail, si as types_d_exports$9, sn as ShaderWhat, sr as SceneSwitch, tn as PerfThermalLine, un as CanvasRestart, ut as ShotsApi, wt as FrameRecord, xt as FrameColumns, yt as RetakeWhy, z as OverlayValue, zt as PerfChangeEntry } from "./types-Ce5W0gZe.mjs";
2
+ import { C as GradeValue, D as VignetteValue, E as ShineValue, F as FilterArea, S as FoldValue, T as RevealRoundValue, X as types_d_exports, Z as HapticKind, _t as wait, at as mark, b as DissolveValue, ct as sequence, dt as spawn, et as HAPTIC_KINDS, ft as spawned, gt as use, ht as tween, i as types_d_exports$16, it as haptic, lt as set, mt as stopSfx, nt as external, ot as parallel, p as types_d_exports$2, pt as stagger, rt as frames, st as play, tt as defineAnimation, ut as sfx, v as types_d_exports$5, w as RevealLineValue, x as FlashValue, y as AuraValue, yt as types_d_exports$4 } from "./types-Cdzw3as5.mjs";
3
+ import { A as TextFormats, D as TextFormat, F as defineComponent, O as TextFormatAnswer, P as types_d_exports$14, S as FormattedNumber, X as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, k as TextFormatFunction, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions, z as types_d_exports$8 } from "./types-C1B7-x7p.mjs";
4
+ import { $ as PASS_KINDS, A as cubicBezier, At as i18nPlugin, B as DropTarget, Bt as Text, C as Outline, Ct as platformPlugin, D as tr, Dt as modelPlugin, E as defineStyle, Et as types_d_exports$11, F as defineScene, Ft as audioPlugin, G as Pressable, H as Hovered, Ht as defineTextFormats, I as defineBundles, It as assetsPlugin, J as TapValue, K as Pressed, L as load, Lt as animPlugin, M as AnimPlayer, Mt as effectsPlugin, N as Animation, Nt as debugPlugin, O as messageArgument, Ot as lifecyclePlugin, P as Frames, Pt as clockPlugin, Q as Traced, R as ready, Rt as projection, S as Noise, St as rendererPlugin, T as resolve, Tt as PlatformProvider, U as Pointer, Ut as defineTextStyles, V as Held, Vt as bind, W as PointerOver, Wt as label, X as Touchable, Y as Tappable, Z as Traceable, _ as Alpha, _t as worldPlugin, a as defineEmitter, at as Tree, b as Displacement, bt as textPlugin, c as Shine, ct as resource, d as Grade, dt as defineEffect, et as frameAt, f as Fold, ft as guide, g as defineFilter, gt as flattenFeatures, h as Aura, ht as defineFeature, i as screen, it as Order, j as defineMotion, jt as flowPlugin, k as messageDuration, kt as inputPlugin, l as RevealRound, lt as system, m as Dissolve, mt as schedule, n as createPlugin, nt as Layer, o as Emitter, ot as component, p as Flash, pt as hint, q as Swipeable, r as defineGame, rt as Now, s as Vignette, st as mut, t as createApp, tt as Exiting, u as RevealLine, ut as tag, v as Blur, vt as uiPlugin, w as music, wt as BackResult, x as Glow, xt as scenesPlugin, y as ColorMatrix, yt as timePlugin, z as Draggable, zt as Countdown } from "./index-DtbI1op8.mjs";
5
5
  export { type AdaptiveScale, Alpha, type AnchorTarget, types_d_exports as Anim, AnimPlayer, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, Aura, type AuraValue, type BackResult, type BindOptions, Blur, Box, CANVAS_RESTARTS, type CanvasRestart, types_d_exports$3 as Clock, ColorMatrix, Countdown, type CountdownValue, DEMAND_REASONS, types_d_exports$4 as Debug, DebugTrigger, type DescriptionNode, Displacement, Display, Dissolve, type DissolveValue, Draggable, DropTarget, types_d_exports$5 as Effects, Emitter, Exiting, type FilterArea, Flash, type FlashValue, types_d_exports$6 as Flow, Fold, type FoldValue, type FormattedNumber, type FrameColumns, type FrameReadResult, type FrameReadout, type FrameRecord, type FrameRing, Frames, Glow, Grade, type GradeValue, HAPTIC_KINDS, type HapticKind, Held, Hovered, HudPart, type HudPartValue, types_d_exports$7 as I18n, types_d_exports$8 as Input, Layer, types_d_exports$9 as Lifecycle, LocalWrite, type LongFrameEntry, MONITOR_SECTIONS, types_d_exports$10 as Model, type MonitorConfig, type MonitorCounts, type MonitorSections, NineSlice, Noise, Now, Order, Outline, Overlay, type OverlayEventDetail, type OverlayValue, type OverlayWhat, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, type PassKind, type PassRecord, type PerfCause, type PerfChange, type PerfChangeEntry, type PerfCollectorLine, type PerfCounts, type PerfDisplay, type PerfEventLine, type PerfEventName, type PerfGapLine, type PerfHeaderLine, type PerfLogLine, type PerfLongFrameLine, type PerfMarkLine, type PerfMeasured, type PerfSampleLine, type PerfSpikeLine, type PerfStartupLine, type PerfTelemetryLine, type PerfThermalLine, types_d_exports$11 as Platform, type PlatformProvider, Pointer, PointerOver, type PoolTrim, type PoolTrimDetail, Pressable, Pressed, type ProblemEventDetail, type ProblemRule, types_d_exports$12 as Renderer, type RetakeWhy, RevealLine, type RevealLineValue, RevealRound, type RevealRoundValue, SHADER_WHATS, SaveUnreadableError, type SceneSwitch, types_d_exports$13 as Scenes, ScrollState, type ShaderEventDetail, type ShaderWhat, Shape, Shine, type ShineValue, type ShotsApi, type ShotsConfig, Sprite, type SpriteBlend, Swipeable, type TapValue, Tappable, Text, type TextFormat, type TextFormatAnswer, type TextFormatFunction, type TextFormats, types_d_exports$14 as TextTypes, types_d_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_d_exports$16 as Ui, Vignette, type VignetteValue, type WarmDetail, type WhyEntry, type WhyLive, types_d_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextFormats, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as defineAnimation, $t as frameAt, A as types_exports$16, At as i18nPlugin, B as types_exports$6, Bt as Noise, C as flattenFeatures, Ct as Pressable, D as load, Dt as Touchable, E as defineBundles, Et as Tappable, F as types_exports$11, Ft as Alpha, G as types_exports$1, Gt as scenesPlugin, H as types_exports$4, Ht as defineFilter, I as types_exports$10, It as Blur, J as resolve, Jt as AnimPlayer, K as types_exports, Kt as assetsPlugin, L as types_exports$9, Lt as ColorMatrix, M as types_exports$14, Mt as messageDuration, N as types_exports$13, Nt as effectsPlugin, O as ready, Ot as Traceable, P as types_exports$12, Pt as Emitter, Q as HAPTIC_KINDS, Qt as PASS_KINDS, R as types_exports$8, Rt as Displacement, S as defineFeature, St as PointerOver, T as music, Tt as Swipeable, U as types_exports$3, Ut as debugPlugin, V as types_exports$5, Vt as Outline, W as types_exports$2, Wt as audioPlugin, X as textPlugin, Xt as Frames, Y as defineMotion, Yt as Animation, Z as platformPlugin, Zt as rendererPlugin, _ as hint, _n as SaveUnreadableError, _t as Draggable, a as Vignette, an as SHADER_WHATS, at as play, b as defineScene, bn as clockPlugin, bt as Hovered, c as RevealLine, cn as worldPlugin, ct as sfx, d as Flash, dn as contribution, dt as stagger, en as MONITOR_SECTIONS, et as external, f as Dissolve, fn as exit, ft as stopSfx, g as guide, gn as modelPlugin, gt as inputPlugin, h as defineEffect, hn as type, ht as wait, i as screen, in as PROBLEM_RULES, it as parallel, j as types_exports$15, jt as messageArgument, k as types_exports$17, kt as Traced, l as Grade, ln as flowPlugin, lt as spawn, m as cubicBezier, mn as to, mt as use, n as createPlugin, nn as PERF_GAP_BUCKETS, nt as haptic, o as Shine, on as CANVAS_RESTARTS, ot as sequence, p as Aura, pn as slot, pt as tween, q as uiPlugin, qt as animPlugin, r as defineGame, rn as PERF_LOG_VERSION, rt as mark, s as RevealRound, sn as DEMAND_REASONS, st as set, t as createApp, tn as PERF_CAUSES, tt as frames, u as Fold, ut as spawned, v as schedule, vn as lifecyclePlugin, vt as DropTarget, w as defineEmitter, wt as Pressed, x as tr, xt as Pointer, y as projection, yn as timePlugin, yt as Held, z as types_exports$7, zt as Glow } from "./src-DsyJR7Ds.mjs";
1
+ import { $ as defineAnimation, $t as frameAt, A as types_exports$16, At as i18nPlugin, B as types_exports$6, Bt as Noise, C as flattenFeatures, Ct as Pressable, D as load, Dt as Touchable, E as defineBundles, Et as Tappable, F as types_exports$11, Ft as Alpha, G as types_exports$1, Gt as scenesPlugin, H as types_exports$4, Ht as defineFilter, I as types_exports$10, It as Blur, J as resolve, Jt as AnimPlayer, K as types_exports, Kt as assetsPlugin, L as types_exports$9, Lt as ColorMatrix, M as types_exports$14, Mt as messageDuration, N as types_exports$13, Nt as effectsPlugin, O as ready, Ot as Traceable, P as types_exports$12, Pt as Emitter, Q as HAPTIC_KINDS, Qt as PASS_KINDS, R as types_exports$8, Rt as Displacement, S as defineFeature, St as PointerOver, T as music, Tt as Swipeable, U as types_exports$3, Ut as debugPlugin, V as types_exports$5, Vt as Outline, W as types_exports$2, Wt as audioPlugin, X as textPlugin, Xt as Frames, Y as defineMotion, Yt as Animation, Z as platformPlugin, Zt as rendererPlugin, _ as hint, _n as SaveUnreadableError, _t as Draggable, a as Vignette, an as SHADER_WHATS, at as play, b as defineScene, bn as clockPlugin, bt as Hovered, c as RevealLine, cn as worldPlugin, ct as sfx, d as Flash, dn as contribution, dt as stagger, en as MONITOR_SECTIONS, et as external, f as Dissolve, fn as exit, ft as stopSfx, g as guide, gn as modelPlugin, gt as inputPlugin, h as defineEffect, hn as type, ht as wait, i as screen, in as PROBLEM_RULES, it as parallel, j as types_exports$15, jt as messageArgument, k as types_exports$17, kt as Traced, l as Grade, ln as flowPlugin, lt as spawn, m as cubicBezier, mn as to, mt as use, n as createPlugin, nn as PERF_GAP_BUCKETS, nt as haptic, o as Shine, on as CANVAS_RESTARTS, ot as sequence, p as Aura, pn as slot, pt as tween, q as uiPlugin, qt as animPlugin, r as defineGame, rn as PERF_LOG_VERSION, rt as mark, s as RevealRound, sn as DEMAND_REASONS, st as set, t as createApp, tn as PERF_CAUSES, tt as frames, u as Fold, ut as spawned, v as schedule, vn as lifecyclePlugin, vt as DropTarget, w as defineEmitter, wt as Pressed, x as tr, xt as Pointer, y as projection, yn as timePlugin, yt as Held, z as types_exports$7, zt as Glow } from "./src-CilP057R.mjs";
2
2
  import { $ as Shape, A as Countdown, F as defineTextStyles, I as label, J as HudPart, M as bind, P as defineTextFormats, Q as Parent, S as popup, T as defineStyle, X as Overlay, Y as NineSlice, _ as LocalWrite, at as Exiting, ct as Order, dt as mut, et as Sprite, ft as resource, h as DebugTrigger, ht as tag, it as sprite, j as Text, lt as Tree, ot as Layer, p as Box, pt as system, q as Display, st as Now, tt as Transform, ut as component, w as defineTokens, y as ScrollState } from "./visual-DhqD6W3v.mjs";
3
3
  import { t as defineComponent } from "./component-DGg5DqKK.mjs";
4
4
  export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Aura, Blur, Box, CANVAS_RESTARTS, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Dissolve, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, Flash, types_exports$6 as Flow, Fold, Frames, Glow, Grade, HAPTIC_KINDS, Held, Hovered, HudPart, types_exports$7 as I18n, types_exports$8 as Input, Layer, types_exports$9 as Lifecycle, LocalWrite, MONITOR_SECTIONS, types_exports$10 as Model, NineSlice, Noise, Now, Order, Outline, Overlay, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, types_exports$11 as Platform, Pointer, PointerOver, Pressable, Pressed, types_exports$12 as Renderer, RevealLine, RevealRound, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, Shape, Shine, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, Vignette, types_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextFormats, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
@@ -1,9 +1,9 @@
1
- import { Ar as Explained, Fn as FlowGraph, Ln as JournalEntry, Or as Api$1, Z as Api$2, Zr as Snapshot, br as FrameDiff, ct as Under, h as Usage, hr as ComponentSchema, mt as RenderStats, t as Api$3, vn as Position, yr as EntitySnapshot, zr as Api } from "./types-BzVQAaSX.mjs";
2
- import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-Co-6A6Y8.mjs";
3
- import { c as UiNode } from "./types-Cx_-n0Ts.mjs";
4
- import { t as HeadlessApp } from "./headless-WyPk3UrP.mjs";
5
- import { a as InputArguments, d as WatchApp, f as WatchInput, l as Source, o as InputOf, s as InputSchema, t as CheatEntry } from "./types-DyohsXF_.mjs";
6
- import { n as defineSource } from "./define-6cjZwkJu.mjs";
1
+ import { Ar as Explained, Fn as FlowGraph, Ln as JournalEntry, Or as Api$1, Z as Api$2, Zr as Snapshot, br as FrameDiff, ct as Under, h as Usage, hr as ComponentSchema, mt as RenderStats, t as Api$3, vn as Position, yr as EntitySnapshot, zr as Api } from "./types-Ce5W0gZe.mjs";
2
+ import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-Cdzw3as5.mjs";
3
+ import { c as UiNode } from "./types-C1B7-x7p.mjs";
4
+ import { t as HeadlessApp } from "./headless-CEG1oR5D.mjs";
5
+ import { a as InputArguments, d as WatchApp, f as WatchInput, l as Source, o as InputOf, s as InputSchema, t as CheatEntry } from "./types-C612npUH.mjs";
6
+ import { n as defineSource } from "./define-DNF9A0ce.mjs";
7
7
 
8
8
  //#region src/plugins/flow/doors/read.d.ts
9
9
  /**
package/dist/inspect.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as defineSource } from "./session-D0AYRm5T.mjs";
2
- import { n as read, r as watch, t as sources } from "./sources-Cqqz-0-b.mjs";
1
+ import { l as defineSource } from "./session-ClUqpGId.mjs";
2
+ import { n as read, r as watch, t as sources } from "./sources-BJyIJf_X.mjs";
3
3
  import "./inspect-la_KkjCS.mjs";
4
4
  export { defineSource, read, sources, watch };
@@ -1,2 +1,2 @@
1
- import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-BDCv5mp-.mjs";
1
+ import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-CcHPrVBm.mjs";
2
2
  export { Fragment, type JSX, jsx, jsxDEV, jsxs };
@@ -1,2 +1,2 @@
1
- import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-BDCv5mp-.mjs";
1
+ import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-CcHPrVBm.mjs";
2
2
  export { Fragment, type JSX, jsx, jsxs };
@@ -1,7 +1,7 @@
1
1
  import { a as sheetAlone, p as graphHash } from "./capture-BtS6_oWr.mjs";
2
2
  import { a as isDev, i as isControl, n as controlRefused, o as notInstalled, r as isAgent, t as controlReadOnly } from "./dev-BNndV-hU.mjs";
3
3
  import { n as reproBookmark } from "./headless-CCiUwvlp.mjs";
4
- import { a as readTarget, i as isProjectionTarget, l as inputSchema, n as isTainted, o as inputOrEmpty, r as recordCheat, s as defineCommand } from "./session-D0AYRm5T.mjs";
4
+ import { a as readTarget, c as defineCommand, i as isProjectionTarget, n as isTainted, o as checkInput, r as recordCheat, s as inputOrEmpty, u as inputSchema } from "./session-ClUqpGId.mjs";
5
5
  //#region src/plugins/anim/control.ts
6
6
  /**
7
7
  * @file anim plugin — the anim command of the `/control` door: switch reduced motion. Dev and
@@ -68,6 +68,43 @@ const muteCommand = defineCommand({
68
68
  }
69
69
  });
70
70
  //#endregion
71
+ //#region src/plugins/clock/control.ts
72
+ /**
73
+ * @file clock plugin — the clock command of the `/control` door: move the clock forward (F157).
74
+ * Dev and debug builds: the body starts with the inline control guard of a cheat command, so a
75
+ * bundler `define` of `false` drops it, and logs the `moku:dev` marker.
76
+ */
77
+ /**
78
+ * Moves the game clock forward by `advanceMs`: a moment the rules scheduled with `clock.scheduleAt`
79
+ * that is due now arrives as `elapsed`, through the graph. A visual test reaches a clock-armed
80
+ * moment with it while its fake clock stands. Changes what the game sees, so the session is
81
+ * tainted and the command journaled. Answers the clock after the move.
82
+ *
83
+ * @throws {Error} `[game] The command game.clock needs clockPlugin.` when the app has no `clockPlugin`.
84
+ * @throws {RangeError} When `advanceMs` is 0 or negative.
85
+ * @example
86
+ * ```ts
87
+ * // A board tick is armed 60 s ahead: the visual test moves the clock and checks the board after it.
88
+ * // steps: [{ clock: { advanceMs: 60_000 } }, { checkpoint: "after-tick" }]
89
+ * (await run(app, commands.clock, { advanceMs: 60_000 })).value; // { now: 1000060000 }
90
+ * ```
91
+ */
92
+ const clockCommand = defineCommand({
93
+ id: "game.clock",
94
+ title: "Move the clock",
95
+ input: inputSchema(["advanceMs", "number"]),
96
+ effect: "cheat",
97
+ run: (app, { advanceMs }) => {
98
+ if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
99
+ if (app.clock === void 0) throw notInstalled("game.clock", "clockPlugin", "command");
100
+ app.log.debug("moku:dev", {
101
+ command: "game.clock",
102
+ advanceMs
103
+ });
104
+ return { now: app.clock.advance(advanceMs) };
105
+ }
106
+ });
107
+ //#endregion
71
108
  //#region src/plugins/effects/control.ts
72
109
  /**
73
110
  * @file effects plugin — the filter command of the `/control` door: turn one filter kind off or on through
@@ -1354,6 +1391,7 @@ const commands = Object.freeze({
1354
1391
  saveExport: saveExportCommand,
1355
1392
  saveImport: saveImportCommand,
1356
1393
  step: stepCommand,
1394
+ clock: clockCommand,
1357
1395
  pause: pauseCommand,
1358
1396
  resume: resumeCommand,
1359
1397
  capture: captureCommand,
@@ -1385,7 +1423,8 @@ function envelopeOf(app) {
1385
1423
  /**
1386
1424
  * Runs a command in a dev build or a debug build. A `--debug` build and the dev page run every
1387
1425
  * command; a `--debug=read` build runs the read and cosmetic ones only. A `cheat` or `raw`
1388
- * command taints the session and is journaled before it runs, so a failing one still counts.
1426
+ * command taints the session and is journaled before it runs, once its input fits its schema, so
1427
+ * one that fails in its body still counts.
1389
1428
  *
1390
1429
  * @param app - The app the command acts on.
1391
1430
  * @param command - The command.
@@ -1394,6 +1433,9 @@ function envelopeOf(app) {
1394
1433
  * @throws {Error} Outside dev builds and debug builds (every command with `--debug`; the read and
1395
1434
  * cosmetic ones alone with `--debug=read`), the read-only refusal of `controlReadOnly` for a
1396
1435
  * `route`, `cheat` or `raw` command on a `--debug=read` page, and whatever the command throws.
1436
+ * @throws {TypeError} When the input has a field the schema does not name, leaves out a field
1437
+ * without `?`, or holds a value of another kind (a `number` must be finite); nothing runs then.
1438
+ * On a `--debug=read` page a `route` command throws "[game] The command game.tap changes the game: …".
1397
1439
  * @example
1398
1440
  * ```ts
1399
1441
  * // An e2e script: load the bug report, then tap Play.
@@ -1401,7 +1443,7 @@ function envelopeOf(app) {
1401
1443
  * const ran = await run(app, commands.answer, { intent: "play" });
1402
1444
  * ran.value; // true
1403
1445
  * ran.state; // { path: "board/awaitIntent", frame: 14, tainted: true }
1404
- * // On a --debug=read page: await run(app, commands.tap, { key: "play" }); // throws "[game] The command game.tap changes the game: …"
1446
+ * await run(app, commands.scroll, { key: "strip", dy: 10 }); // throws '[game] The command game.scroll got the field "dy", which it does not take. …'
1405
1447
  * ```
1406
1448
  */
1407
1449
  async function run(app, command, ...input) {
@@ -1410,6 +1452,7 @@ async function run(app, command, ...input) {
1410
1452
  if (command.effect !== "read" && command.effect !== "cosmetic") throw controlReadOnly(command.id);
1411
1453
  }
1412
1454
  const given = inputOrEmpty(input[0]);
1455
+ checkInput(command.id, command.input, given);
1413
1456
  if (command.effect === "cheat" || command.effect === "raw") recordCheat(app, command.id, given, app.time.snapshot().frame);
1414
1457
  return {
1415
1458
  value: await command.run(app, given),
@@ -1,4 +1,4 @@
1
- import { _ as UiIntrinsicElements, a as JsxChild, t as DescriptionNode } from "./types-Cx_-n0Ts.mjs";
1
+ import { _ as UiIntrinsicElements, a as JsxChild, t as DescriptionNode } from "./types-C1B7-x7p.mjs";
2
2
 
3
3
  //#region src/plugins/ui/jsx/runtime.d.ts
4
4
  /** What the compiler passes as props: the children plus whatever the tag declared. */
@@ -166,7 +166,143 @@ const noInput = Object.freeze({});
166
166
  * ```
167
167
  */
168
168
  function inputOrEmpty(input) {
169
- return input ?? noInput;
169
+ return input === void 0 ? noInput : input;
170
+ }
171
+ /**
172
+ * Tells whether a value is of an input kind: a string, a finite number, a boolean, or for `json`
173
+ * anything but `undefined`. Pure.
174
+ *
175
+ * @param kind - The kind, without its `?`.
176
+ * @param value - The value, not `undefined`.
177
+ * @returns True when the value fits the kind.
178
+ * @example
179
+ * ```ts
180
+ * fitsKind("number", Number.NaN); // false
181
+ * ```
182
+ */
183
+ function fitsKind(kind, value) {
184
+ if (kind === "number") return typeof value === "number" && Number.isFinite(value);
185
+ if (kind === "json") return true;
186
+ return typeof value === kind;
187
+ }
188
+ /**
189
+ * Shows a given value in a message: a number as it prints, so `NaN` stays `NaN`, anything else as
190
+ * JSON. Pure.
191
+ *
192
+ * @param value - The value.
193
+ * @returns The value as text.
194
+ * @example
195
+ * ```ts
196
+ * shown(Number.NaN); // "NaN"
197
+ * ```
198
+ */
199
+ function shown(value) {
200
+ return typeof value === "number" ? String(value) : JSON.stringify(value) ?? String(value);
201
+ }
202
+ /**
203
+ * Names a kind in a message. Pure.
204
+ *
205
+ * @param kind - The kind.
206
+ * @returns The kind with its article.
207
+ * @example
208
+ * ```ts
209
+ * kindName("number"); // "a finite number"
210
+ * ```
211
+ */
212
+ function kindName(kind) {
213
+ return kind === "number" ? "a finite number" : `a ${kind}`;
214
+ }
215
+ /**
216
+ * Lists the fields a schema takes, for a message: `key (string), to (number)`. Pure.
217
+ *
218
+ * @param schema - The schema.
219
+ * @returns The fields with their kinds, or `nothing` for an empty schema.
220
+ * @example
221
+ * ```ts
222
+ * fieldList({ key: "string", to: "number" }); // "key (string), to (number)"
223
+ * ```
224
+ */
225
+ function fieldList(schema) {
226
+ const fields = Object.keys(schema).map((name) => `${name} (${schema[name] ?? ""})`);
227
+ return fields.length === 0 ? "nothing" : fields.join(", ");
228
+ }
229
+ /**
230
+ * Builds the error of an input that does not fit the schema of its command.
231
+ *
232
+ * @param id - The id of the command.
233
+ * @param problem - What is wrong, one clause.
234
+ * @param schema - The schema, for the fix.
235
+ * @returns The error, ready to throw.
236
+ */
237
+ function inputError(id, problem, schema) {
238
+ return /* @__PURE__ */ new TypeError(`[game] The command ${id} got ${problem}.\n It takes ${fieldList(schema)}; a field ending in ? may be left out.`);
239
+ }
240
+ /**
241
+ * Splits a declared kind into its kind and whether it is optional. Pure.
242
+ *
243
+ * @param declared - The kind as the schema writes it.
244
+ * @returns The kind without its `?`, and whether it had one.
245
+ * @example
246
+ * ```ts
247
+ * splitKind("number?"); // { kind: "number", optional: true }
248
+ * ```
249
+ */
250
+ function splitKind(declared) {
251
+ const optional = declared.endsWith("?");
252
+ return {
253
+ kind: optional ? declared.slice(0, -1) : declared,
254
+ optional
255
+ };
256
+ }
257
+ /**
258
+ * Checks one field of the schema against its given value.
259
+ *
260
+ * @param id - The id of the command, for the message.
261
+ * @param schema - The schema of the command.
262
+ * @param name - The field.
263
+ * @param value - Its given value, `undefined` when left out.
264
+ * @throws {TypeError} When a field without `?` is left out, or the value is of another kind.
265
+ */
266
+ function checkField(id, schema, name, value) {
267
+ const { kind, optional } = splitKind(schema[name] ?? "json?");
268
+ if (value === void 0 && optional) return;
269
+ if (value === void 0) throw inputError(id, `no "${name}", which it needs`, schema);
270
+ if (!fitsKind(kind, value)) throw inputError(id, `${shown(value)} for "${name}", not ${kindName(kind)}`, schema);
271
+ }
272
+ /**
273
+ * Tells whether a value is an object a call can read field by field: not `null`, not an array. Pure.
274
+ *
275
+ * @param value - The value.
276
+ * @returns True for a plain object.
277
+ * @example
278
+ * ```ts
279
+ * isPlainObject([true]); // false
280
+ * ```
281
+ */
282
+ function isPlainObject(value) {
283
+ return typeof value === "object" && value !== null && !Array.isArray(value);
284
+ }
285
+ /**
286
+ * Checks a given input against the schema of its command before the command runs: an object, no
287
+ * field the schema does not name, every field without `?` given, and every given value of its
288
+ * kind. A field with `?` may be left out or be `undefined`. A door call, never a frame path.
289
+ *
290
+ * @param id - The id of the command, for the message.
291
+ * @param schema - The schema of the command.
292
+ * @param input - The input of the call, as it came: an editor or a visual test sends plain JSON.
293
+ * @throws {TypeError} Naming the first field that does not fit, and the fields the command takes.
294
+ * @example
295
+ * ```ts
296
+ * checkInput("game.scroll", { key: "string", to: "number" }, { key: "strip", to: 318 }); // passes
297
+ * checkInput("game.scroll", { key: "string", to: "number" }, { key: "strip", dy: 10 });
298
+ * // throws '[game] The command game.scroll got the field "dy", which it does not take.\n It takes key (string), to (number); …'
299
+ * ```
300
+ */
301
+ function checkInput(id, schema, input) {
302
+ if (!isPlainObject(input)) throw inputError(id, "an input that is not an object", schema);
303
+ const given = input;
304
+ for (const name of Object.keys(given)) if (!Object.hasOwn(schema, name)) throw inputError(id, `the field "${name}", which it does not take`, schema);
305
+ for (const name of Object.keys(schema)) checkField(id, schema, name, given[name]);
170
306
  }
171
307
  //#endregion
172
308
  //#region src/plugins/input/target.ts
@@ -254,4 +390,4 @@ function recordCheat(app, id, input, frame) {
254
390
  sessions.set(app, session);
255
391
  }
256
392
  //#endregion
257
- export { readTarget as a, defineSource as c, isProjectionTarget as i, inputSchema as l, isTainted as n, inputOrEmpty as o, recordCheat as r, defineCommand as s, cheatsOf as t };
393
+ export { readTarget as a, defineCommand as c, isProjectionTarget as i, defineSource as l, isTainted as n, checkInput as o, recordCheat as r, inputOrEmpty as s, cheatsOf as t, inputSchema as u };
@@ -1,6 +1,6 @@
1
1
  import { $ as Shape, H as parentOf, K as rootPoseOf, Y as NineSlice, i as drawnRect, ot as Layer, p as Box } from "./visual-DhqD6W3v.mjs";
2
2
  import { o as notInstalled } from "./dev-BNndV-hU.mjs";
3
- import { a as readTarget, c as defineSource, l as inputSchema, n as isTainted, o as inputOrEmpty, t as cheatsOf } from "./session-D0AYRm5T.mjs";
3
+ import { a as readTarget, l as defineSource, n as isTainted, s as inputOrEmpty, t as cheatsOf, u as inputSchema } from "./session-ClUqpGId.mjs";
4
4
  //#region src/plugins/flow/doors/read.ts
5
5
  /**
6
6
  * @file flow/doors — `read` and `watch`, the `/inspect` side. Neither changes the game.
@@ -35,13 +35,13 @@ const createCore$1 = coreConfig.createCore;
35
35
  */
36
36
  /**
37
37
  * Reads the source and raises the high-water mark. A source that goes back cannot move game time
38
- * back, and a fractional reading is cut to whole milliseconds.
38
+ * back, and a fractional reading is cut to whole milliseconds. The shift of `advance` is added.
39
39
  *
40
40
  * @param state - Clock state.
41
41
  * @returns The highest moment ever returned, in epoch milliseconds.
42
42
  */
43
43
  function readNow(state) {
44
- const moment = Math.trunc(state.source.now());
44
+ const moment = Math.trunc(state.source.now() + state.shift);
45
45
  if (moment > state.last) state.last = moment;
46
46
  return state.last;
47
47
  }
@@ -67,8 +67,8 @@ function deliverElapsed(state) {
67
67
  for (const listener of listeners) listener({ now: moment });
68
68
  }
69
69
  /**
70
- * Arms the single timer for a due moment. The delay is counted from the RAW source reading, not
71
- * from trusted time: the source's timer runs on the device clock, so after the device clock was
70
+ * Arms the single timer for a due moment. The delay is counted from the RAW source reading plus
71
+ * the shift of `advance`, not from trusted time: the source's timer runs on the device clock, so after the device clock was
72
72
  * moved back the wait is longer than `moment - now()`. A moment further than the longest timer
73
73
  * waits in steps: the timer fires early and `fireDue` arms it again.
74
74
  *
@@ -76,7 +76,8 @@ function deliverElapsed(state) {
76
76
  * @param moment - Due moment in epoch milliseconds.
77
77
  */
78
78
  function arm(state, moment) {
79
- const delayMs = Math.min(MAX_TIMER_MS, Math.max(0, moment - Math.trunc(state.source.now())));
79
+ const raw = Math.trunc(state.source.now() + state.shift);
80
+ const delayMs = Math.min(MAX_TIMER_MS, Math.max(0, moment - raw));
80
81
  state.dueAt = moment;
81
82
  state.handle = state.source.setTimer(() => fireDue(state), delayMs);
82
83
  }
@@ -98,6 +99,26 @@ function fireDue(state) {
98
99
  deliverElapsed(state);
99
100
  }
100
101
  /**
102
+ * Moves the clock forward by `ms`: the shift every reading adds grows, and the pending moment is
103
+ * delivered at once when it is due now, or armed again for the rest of its wait.
104
+ *
105
+ * @param state - Clock state.
106
+ * @param ms - Milliseconds forward.
107
+ * @returns The trusted moment after the move.
108
+ * @throws {RangeError} When `ms` is not a finite number above 0.
109
+ */
110
+ function advanceBy$1(state, ms) {
111
+ if (!Number.isFinite(ms) || ms <= 0) throw new RangeError(`[game] clock.advance moves the clock forward, not by ${ms} ms.\n Pass a finite number of milliseconds above 0.`);
112
+ state.shift += ms;
113
+ const moment = state.dueAt;
114
+ const now = readNow(state);
115
+ if (moment === void 0) return now;
116
+ cancelPending(state);
117
+ if (now >= moment) deliverElapsed(state);
118
+ else arm(state, moment);
119
+ return now;
120
+ }
121
+ /**
101
122
  * Removes one listener. A second removal of the same listener does nothing.
102
123
  *
103
124
  * @param state - Clock state.
@@ -130,6 +151,7 @@ function createClockApi(ctx) {
130
151
  poke: () => {
131
152
  deliverElapsed(ctx.state);
132
153
  },
154
+ advance: (ms) => advanceBy$1(ctx.state, ms),
133
155
  dueAt: () => ctx.state.dueAt,
134
156
  pending: () => ctx.state.dueAt === void 0 ? 0 : 1,
135
157
  listeners: () => ctx.state.listeners.length
@@ -141,8 +163,8 @@ function createClockApi(ctx) {
141
163
  * @file clock plugin — state factory.
142
164
  */
143
165
  /**
144
- * Creates the initial clock state: the configured source or the system source, no due moment,
145
- * no timer handle, no listeners.
166
+ * Creates the initial clock state: the configured source or the system source, no shift, no due
167
+ * moment, no timer handle, no listeners.
146
168
  *
147
169
  * @param ctx - Minimal context.
148
170
  * @param ctx.config - Resolved plugin config.
@@ -152,6 +174,7 @@ function createClockState(ctx) {
152
174
  return {
153
175
  source: ctx.config.source ?? systemSource(),
154
176
  last: 0,
177
+ shift: 0,
155
178
  dueAt: void 0,
156
179
  handle: void 0,
157
180
  listeners: []
@@ -9131,6 +9154,7 @@ function collectMatch(_value, entity) {
9131
9154
  */
9132
9155
  var SystemWalk = class {
9133
9156
  ctx;
9157
+ hidesAside;
9134
9158
  /** The step handed back for every row: always the one row array. */
9135
9159
  step;
9136
9160
  /** The one row: the entity, then one stored value per name, sized at registration. */
@@ -9151,14 +9175,19 @@ var SystemWalk = class {
9151
9175
  started = false;
9152
9176
  /** The first store's size at the first step: a dev build compares it; -1 when not watched. */
9153
9177
  size = -1;
9178
+ /** The entities of the running aside build this run passes over, read at the first step; `undefined` for none. */
9179
+ aside = void 0;
9154
9180
  /**
9155
9181
  * Prepares the walk of one system.
9156
9182
  *
9157
9183
  * @param ctx - Domain context of the world plugin.
9158
9184
  * @param plan - The system's resolved query.
9185
+ * @param hidesAside - True for a feature's system: it passes over the entities of a scene built aside until the
9186
+ * commit (F155).
9159
9187
  */
9160
- constructor(ctx, plan) {
9188
+ constructor(ctx, plan, hidesAside = false) {
9161
9189
  this.ctx = ctx;
9190
+ this.hidesAside = hidesAside;
9162
9191
  this.names = plan.names;
9163
9192
  this.written = plan.written;
9164
9193
  this.step = {
@@ -9191,13 +9220,14 @@ var SystemWalk = class {
9191
9220
  return this;
9192
9221
  }
9193
9222
  /**
9194
- * Keeps one key of the first store when the entity carries every other name.
9223
+ * Keeps one key of the first store when the entity carries every other name and is not built aside.
9195
9224
  *
9196
9225
  * @param entity - The key.
9197
9226
  */
9198
9227
  keep(entity) {
9199
9228
  const stores = this.stores;
9200
9229
  const count = stores.length;
9230
+ if (this.aside?.has(entity) === true) return;
9201
9231
  for (let index = 1; index < count; index += 1) if (stores[index]?.has(entity) !== true) return;
9202
9232
  this.entities[this.count] = entity;
9203
9233
  this.count += 1;
@@ -9227,8 +9257,8 @@ var SystemWalk = class {
9227
9257
  }
9228
9258
  /**
9229
9259
  * Reads the stores of this run and collects the entities that carry every name, in the first
9230
- * store's order. Structural changes are queued until the phase ends, so the matches stay true
9231
- * while the rows are consumed.
9260
+ * store's order; a feature's system passes over the entities of a scene built aside. Structural
9261
+ * changes are queued until the phase ends, so the matches stay true while the rows are consumed.
9232
9262
  */
9233
9263
  start() {
9234
9264
  const all = this.ctx.state.ecs.stores;
@@ -9242,6 +9272,7 @@ var SystemWalk = class {
9242
9272
  }
9243
9273
  const first = stores[0];
9244
9274
  if (first === void 0) return;
9275
+ this.aside = this.hidesAside ? this.ctx.state.projection.building?.entities : void 0;
9245
9276
  collecting.walk = this;
9246
9277
  first.forEach(collectMatch);
9247
9278
  collecting.walk = void 0;
@@ -9316,7 +9347,7 @@ function mayMatch(stores, entry) {
9316
9347
  */
9317
9348
  function systemRows(ctx, entry) {
9318
9349
  if (entry.plan.names.length === 0) return NO_ROWS;
9319
- entry.walk ??= new SystemWalk(ctx, entry.plan);
9350
+ entry.walk ??= new SystemWalk(ctx, entry.plan, entry.hidesAside);
9320
9351
  return entry.walk.reset();
9321
9352
  }
9322
9353
  /**
@@ -9694,23 +9725,24 @@ function storeSlots(count) {
9694
9725
  /**
9695
9726
  * Registers a system at the end of its phase list and returns the remover. In phase `sync` it goes
9696
9727
  * before `renderer.sync`, which stays last. Its query and its `scenes` are read here, once: a
9697
- * later change to the definition is not seen. A dev build checks
9698
- * the `scenes` against the scenes the features declare, once the world started.
9728
+ * later change to the definition is not seen. A dev build checks the `scenes` against the scenes
9729
+ * the features declare, once the world started.
9730
+ *
9731
+ * The rows of a feature's system (`hidesAside`) pass over the entities of a scene built aside
9732
+ * until the commit, so it meets the coming scene whole, in one frame (F155); `world.query()`,
9733
+ * `get` and `has` inside its `run` still read them. The engine's own systems lay that scene out
9734
+ * and draw it, and see it.
9699
9735
  *
9700
9736
  * @param ctx - Domain context of the world plugin.
9701
9737
  * @param definition - The system.
9738
+ * @param hidesAside - True for a system a feature brought.
9702
9739
  * @returns The remover; calling it twice is a no-op.
9703
9740
  * @throws {Error} When a system of that name is already registered, and in a dev build for a
9704
9741
  * name in `scenes` that no feature declares.
9705
9742
  */
9706
- function registerSystem(ctx, definition) {
9743
+ function registerSystem(ctx, definition, hidesAside = false) {
9707
9744
  const state = ctx.state.ecs;
9708
- for (const phase of [
9709
- "input",
9710
- "animate",
9711
- "layout",
9712
- "sync"
9713
- ]) if (state.systems[phase].some((entry) => entry.definition.name === definition.name)) throw new Error(`[game] System "${definition.name}" is registered twice.\n Give the second system another name, or remove the first one.`);
9745
+ for (const phase of WORLD_PHASES) if (state.systems[phase].some((entry) => entry.definition.name === definition.name)) throw new Error(`[game] System "${definition.name}" is registered twice.\n Give the second system another name, or remove the first one.`);
9714
9746
  if (typeof __MOKU_GAME_DEV__ !== "undefined" && __MOKU_GAME_DEV__) checkScenes(state.scene, definition);
9715
9747
  const plan = planOf(ctx, definition.query);
9716
9748
  const entry = {
@@ -9720,7 +9752,8 @@ function registerSystem(ctx, definition) {
9720
9752
  stores: storeSlots(plan.names.length),
9721
9753
  scenes: definition.scenes === void 0 ? void 0 : [...definition.scenes],
9722
9754
  skipped: false,
9723
- walk: plan.names.length === 0 ? void 0 : new SystemWalk(ctx, plan)
9755
+ hidesAside,
9756
+ walk: plan.names.length === 0 ? void 0 : new SystemWalk(ctx, plan, hidesAside)
9724
9757
  };
9725
9758
  const list = state.systems[definition.phase];
9726
9759
  const draws = list.findIndex((known) => known.definition.name === DRAWS_SYSTEM);
@@ -9913,6 +9946,7 @@ function createEcsApi(ctx) {
9913
9946
  const state = ctx.state.ecs;
9914
9947
  const api = {
9915
9948
  system: (definition) => registerSystem(ctx, definition),
9949
+ featureSystem: (definition) => registerSystem(ctx, definition, true),
9916
9950
  spawn: (owner, components) => {
9917
9951
  const entity = reserveEntity(state, owner);
9918
9952
  queueOrApply(ctx, {
@@ -10144,7 +10178,7 @@ function registerFeatures(ctx, ecs, projection) {
10144
10178
  declareScenes(ctx.state.ecs.scene, features);
10145
10179
  for (const feature of features) {
10146
10180
  registerEach(ctx, feature, "components", isComponentEntry, (entry) => registerType(ctx, entry));
10147
- registerEach(ctx, feature, "systems", isSystemEntry, (entry) => ecs.system(entry));
10181
+ registerEach(ctx, feature, "systems", isSystemEntry, (entry) => ecs.featureSystem(entry));
10148
10182
  registerEach(ctx, feature, "projections", isProjectionEntry, (entry) => projection.register(entry));
10149
10183
  }
10150
10184
  }
@@ -44524,23 +44558,37 @@ function endBuild(ctx, build, how) {
44524
44558
  build.resolve();
44525
44559
  }
44526
44560
  /**
44527
- * Tells whether the floor on the swap lets a built scene commit: no floor, or the clock passed it and the look was drawn
44528
- * once. The count is the look's, never the build's, so a switch slower than the floor is many frames past it and the
44529
- * floor adds no frame. While it holds, the loop is kept awake: it may stop at `idleFps: 0` during a long floor. No floor
44530
- * is one read; no allocation either way.
44561
+ * Tells whether the floor on the swap lets a built scene commit: no floor, or the clock or the game time passed it and
44562
+ * the look was drawn once. On a device both run together; the stepped frames of a visual test move the game time while
44563
+ * its fake clock stands (F86), so the floor passes there after `holdMs` of frames (F156). The count is the look's, never
44564
+ * the build's, so a switch slower than the floor is many frames past it and the floor adds no frame. While it holds, the
44565
+ * loop is kept awake: it may stop at `idleFps: 0` during a long floor. No floor is one read; no allocation either way.
44531
44566
  *
44532
44567
  * @param ctx - Domain context of the plugin.
44533
44568
  * @param frame - The frame counter now.
44569
+ * @param elapsed - The game time now, in ms.
44534
44570
  * @returns True when the build may commit.
44535
44571
  */
44536
- function holdOver(ctx, frame) {
44572
+ function holdOver(ctx, frame, elapsed) {
44537
44573
  const hold = ctx.state.leaving?.hold;
44538
44574
  if (hold === void 0) return true;
44539
- if (ctx.deps.clock.now() >= hold.until && frame >= hold.frame + HOLD_FRAMES) return true;
44575
+ if ((ctx.deps.clock.now() >= hold.until || elapsed >= hold.elapsedUntil) && frame >= hold.frame + HOLD_FRAMES) return true;
44540
44576
  ctx.deps.time.wake();
44541
44577
  return false;
44542
44578
  }
44543
44579
  /**
44580
+ * Tells whether a running build may commit now: every part of it is done and the floor on the swap
44581
+ * passed. Two calls, no allocation.
44582
+ *
44583
+ * @param ctx - Domain context of the plugin.
44584
+ * @param frame - The frame counter now.
44585
+ * @param elapsed - The game time now, in ms.
44586
+ * @returns True when the build may commit.
44587
+ */
44588
+ function readyToCommit(ctx, frame, elapsed) {
44589
+ return ctx.deps.world.projection.built() && holdOver(ctx, frame, elapsed);
44590
+ }
44591
+ /**
44544
44592
  * The `signals` callback of a running build: counts the frame and commits the build the frame
44545
44593
  * every part of it is done and the floor on the swap passed. A world that stopped running live
44546
44594
  * during the build or its wait (a walk that went fast, as the restore of a repro walks its route,
@@ -44552,15 +44600,15 @@ function holdOver(ctx, frame) {
44552
44600
  * @param ctx - Domain context of the plugin.
44553
44601
  * @param build - The running build.
44554
44602
  * @param frame - The frame counter of this frame.
44603
+ * @param elapsed - The game time of this frame, in ms.
44555
44604
  */
44556
- function stepBuild(ctx, build, frame) {
44605
+ function stepBuild(ctx, build, frame, elapsed) {
44557
44606
  build.frames += 1;
44558
- const world = ctx.deps.world;
44559
- if (world.ecs.mode() !== "live") {
44607
+ if (ctx.deps.world.ecs.mode() !== "live") {
44560
44608
  endBuild(ctx, build, "mount");
44561
44609
  return;
44562
44610
  }
44563
- if (world.projection.built() && holdOver(ctx, frame)) endBuild(ctx, build, "commit");
44611
+ if (readyToCommit(ctx, frame, elapsed)) endBuild(ctx, build, "commit");
44564
44612
  }
44565
44613
  /**
44566
44614
  * Drops the running build on an abort of its node (a restore, the inbox, a stop of the runner):
@@ -44614,7 +44662,7 @@ function startBuildRecord(ctx, scene, named, budgetMs, settle) {
44614
44662
  */
44615
44663
  function watchBuild(ctx, build, signal) {
44616
44664
  const onAbort = () => abortBuild(ctx, build);
44617
- const offFrame = ctx.deps.time.onFrame("signals", (time) => stepBuild(ctx, build, time.frame));
44665
+ const offFrame = ctx.deps.time.onFrame("signals", (time) => stepBuild(ctx, build, time.frame, time.elapsed));
44618
44666
  signal.addEventListener("abort", onAbort, { once: true });
44619
44667
  build.off = () => {
44620
44668
  offFrame();
@@ -44657,7 +44705,8 @@ function buildAside(ctx, scene, named, signal) {
44657
44705
  resolve,
44658
44706
  reject
44659
44707
  });
44660
- if (projection.built() && holdOver(ctx, ctx.deps.time.snapshot().frame)) {
44708
+ const { frame, elapsed } = ctx.deps.time.snapshot();
44709
+ if (readyToCommit(ctx, frame, elapsed)) {
44661
44710
  endBuild(ctx, build, "commit");
44662
44711
  return;
44663
44712
  }
@@ -45190,8 +45239,8 @@ function leftScene(ctx, run) {
45190
45239
  return ctx.state.scenes.get(current);
45191
45240
  }
45192
45241
  /**
45193
- * Stamps the floor of a loader on the look of a switch that starts now: the clock moment the swap may happen at, and the
45194
- * frame counter, read once here (`snapshot()` copies). A loader without one leaves the look as it is.
45242
+ * Stamps the floor of a loader on the look of a switch that starts now: the clock moment and the game time the swap may
45243
+ * happen at, and the frame counter, read once here (`snapshot()` copies). A loader without one leaves the look as it is.
45195
45244
  *
45196
45245
  * @param ctx - Domain context of the plugin.
45197
45246
  * @param leaving - The look of the switch.
@@ -45199,9 +45248,11 @@ function leftScene(ctx, run) {
45199
45248
  */
45200
45249
  function stampHold(ctx, leaving, loader) {
45201
45250
  if (loader.holdMs === void 0) return;
45251
+ const { frame, elapsed } = ctx.deps.time.snapshot();
45202
45252
  leaving.hold = {
45203
45253
  until: ctx.deps.clock.now() + loader.holdMs,
45204
- frame: ctx.deps.time.snapshot().frame
45254
+ elapsedUntil: elapsed + loader.holdMs,
45255
+ frame
45205
45256
  };
45206
45257
  }
45207
45258
  /**
@@ -1,7 +1,7 @@
1
- import { An as FeaturePlugin, Hn as Descriptor, Hr as Json, Ir as FakeClock, Kn as Hint, Mn as AnyFlow, Pr as ClockSource, Rn as NodeTable, qn as NodeFx } from "./types-BzVQAaSX.mjs";
2
- import { t as createApp } from "./index-Bz6p2alA.mjs";
3
- import { b as memory, x as saveOf, y as WithGameState } from "./types-Dx2qRDFg.mjs";
4
- import { a as createHeadless, i as ReproResult, n as HeadlessGame, o as runRepro, r as Repro, s as stepFrames, t as HeadlessApp } from "./headless-WyPk3UrP.mjs";
1
+ import { An as FeaturePlugin, Hn as Descriptor, Hr as Json, Ir as FakeClock, Kn as Hint, Mn as AnyFlow, Pr as ClockSource, Rn as NodeTable, qn as NodeFx } from "./types-Ce5W0gZe.mjs";
2
+ import { t as createApp } from "./index-DtbI1op8.mjs";
3
+ import { b as memory, x as saveOf, y as WithGameState } from "./types-IJXSUFJa.mjs";
4
+ import { a as createHeadless, i as ReproResult, n as HeadlessGame, o as runRepro, r as Repro, s as stepFrames, t as HeadlessApp } from "./headless-CEG1oR5D.mjs";
5
5
  import { AnyPluginInstance } from "@moku-labs/core";
6
6
 
7
7
  //#region src/plugins/clock/fake.d.ts
package/dist/testing.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as flattenFeatures, fn as exit, hn as type, t as createApp, un as refuseStart } from "./src-DsyJR7Ds.mjs";
1
+ import { C as flattenFeatures, fn as exit, hn as type, t as createApp, un as refuseStart } from "./src-CilP057R.mjs";
2
2
  import { n as saveOf, t as memory } from "./memory-DeD9wis6.mjs";
3
3
  import { n as fakeClock } from "./fake-hnJcJeYf.mjs";
4
4
  import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-CCiUwvlp.mjs";
@@ -1,4 +1,4 @@
1
- import { $n as Ease, Dr as TagType, Hn as Descriptor, Hr as Json, J as TransformValue, Kn as Hint, Nr as Api$5, Or as Api$2, Xn as AnchorTarget, Yn as Answered, Z as Api$3, Zn as ChangeHook, _t as ViewportSize, ci as Api, dr as AnyComponent, er as Motion, fn as Api$1, fr as AnyComponentType, gr as ComponentType, ir as ProjectionMotion, nr as MotionHandle, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, s as Events$1, t as Api$4, tr as MotionCause, ur as ViewHandle, vi as Require, vr as Entity } from "./types-BzVQAaSX.mjs";
1
+ import { $n as Ease, Dr as TagType, Hn as Descriptor, Hr as Json, J as TransformValue, Kn as Hint, Nr as Api$5, Or as Api$2, Xn as AnchorTarget, Yn as Answered, Z as Api$3, Zn as ChangeHook, _t as ViewportSize, ci as Api, dr as AnyComponent, er as Motion, fn as Api$1, fr as AnyComponentType, gr as ComponentType, ir as ProjectionMotion, nr as MotionHandle, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, s as Events$1, t as Api$4, tr as MotionCause, ur as ViewHandle, vi as Require, vr as Entity } from "./types-Ce5W0gZe.mjs";
2
2
  import { Log } from "@moku-labs/common/browser";
3
3
  import { PluginCtx } from "@moku-labs/core";
4
4
  import { Node, Yoga } from "yoga-layout/load";
@@ -1,5 +1,5 @@
1
- import { Hr as Json, Zr as Snapshot } from "./types-BzVQAaSX.mjs";
2
- import { t as HeadlessApp } from "./headless-WyPk3UrP.mjs";
1
+ import { Hr as Json, Zr as Snapshot } from "./types-Ce5W0gZe.mjs";
2
+ import { t as HeadlessApp } from "./headless-CEG1oR5D.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
 
5
5
  //#region src/plugins/flow/doors/types.d.ts
@@ -1,5 +1,5 @@
1
- import { $n as Ease, A as FilterSlotQuad, Hn as Descriptor, Hr as Json, O as FilterSlot, Or as Api$3, Vn as TypeTag, Vr as Events$3, Xn as AnchorTarget, Z as Api$4, _i as Events$2, at as PixiUniformGroup, b as Events$4, ci as Api$1, cr as TrackOptions, dr as AnyComponent, et as PixiFilter, fn as Api$2, gr as ComponentType, gt as Point, ii as Events$5, it as PixiTexture, j as SyncApi, k as FilterSlotInputs, lr as TrackSegment, mr as ComponentHandle, nr as MotionHandle, nt as PixiModule, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, rt as PixiSprite, s as Events$1, t as Api$5, tt as PixiGpuProgram, vi as Require, vr as Entity, vt as FilterCache, zr as Api$6 } from "./types-BzVQAaSX.mjs";
2
- import { H as I18nApi, L as InputApi, T as TextApi, c as UiNode, et as StylesState, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-Cx_-n0Ts.mjs";
1
+ import { $n as Ease, A as FilterSlotQuad, Hn as Descriptor, Hr as Json, O as FilterSlot, Or as Api$3, Vn as TypeTag, Vr as Events$3, Xn as AnchorTarget, Z as Api$4, _i as Events$2, at as PixiUniformGroup, b as Events$4, ci as Api$1, cr as TrackOptions, dr as AnyComponent, et as PixiFilter, fn as Api$2, gr as ComponentType, gt as Point, ii as Events$5, it as PixiTexture, j as SyncApi, k as FilterSlotInputs, lr as TrackSegment, mr as ComponentHandle, nr as MotionHandle, nt as PixiModule, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, rt as PixiSprite, s as Events$1, t as Api$5, tt as PixiGpuProgram, vi as Require, vr as Entity, vt as FilterCache, zr as Api$6 } from "./types-Ce5W0gZe.mjs";
2
+ import { H as I18nApi, L as InputApi, T as TextApi, c as UiNode, et as StylesState, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-C1B7-x7p.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
  import { PluginCtx } from "@moku-labs/core";
5
5
 
@@ -1768,7 +1768,8 @@ type Config$5 = {
1768
1768
  */
1769
1769
  type State$5 = {
1770
1770
  source: ClockSource;
1771
- last: number;
1771
+ last: number; /** Milliseconds `advance` moved the clock forward, added to every reading of the source. */
1772
+ shift: number;
1772
1773
  dueAt: number | undefined;
1773
1774
  handle: unknown;
1774
1775
  listeners: Array<(input: Elapsed) => void>;
@@ -1843,6 +1844,26 @@ type Api$4 = {
1843
1844
  * ```
1844
1845
  */
1845
1846
  poke(): void;
1847
+ /**
1848
+ * Moves the clock forward, as if `ms` passed at once: every later `now()` is `ms` further, and a
1849
+ * pending moment that is due now is delivered at once, before the call returns; one still ahead
1850
+ * waits for the rest. The door `game.clock` calls it, so a visual test or the editor reaches a
1851
+ * moment the rules scheduled without waiting for it. Only forward.
1852
+ *
1853
+ * @param ms - Milliseconds forward, a finite number above 0.
1854
+ * @returns The trusted moment after the move.
1855
+ * @throws {RangeError} `[game] clock.advance moves the clock forward, not by 0 ms.` for 0, a
1856
+ * negative or a number that is not finite.
1857
+ * @example
1858
+ * ```ts
1859
+ * // A board tick is due in 60 s; the visual test moves the clock and the tick arrives.
1860
+ * app.clock.now(); // 1000000000
1861
+ * app.clock.scheduleAt(1_000_060_000);
1862
+ * app.clock.advance(60_000); // 1000060000: onElapsed listeners got { now: 1000060000 }
1863
+ * app.clock.dueAt(); // undefined
1864
+ * ```
1865
+ */
1866
+ advance(ms: number): number;
1846
1867
  /**
1847
1868
  * Reads the pending due moment, for inspection and tests.
1848
1869
  *
@@ -2075,6 +2096,7 @@ type QueryPlan = {
2075
2096
  */
2076
2097
  declare class SystemWalk implements Iterator<readonly unknown[], undefined> {
2077
2098
  private readonly ctx;
2099
+ private readonly hidesAside;
2078
2100
  /** The step handed back for every row: always the one row array. */
2079
2101
  private readonly step;
2080
2102
  /** The one row: the entity, then one stored value per name, sized at registration. */
@@ -2095,13 +2117,17 @@ declare class SystemWalk implements Iterator<readonly unknown[], undefined> {
2095
2117
  private started;
2096
2118
  /** The first store's size at the first step: a dev build compares it; -1 when not watched. */
2097
2119
  private size;
2120
+ /** The entities of the running aside build this run passes over, read at the first step; `undefined` for none. */
2121
+ private aside;
2098
2122
  /**
2099
2123
  * Prepares the walk of one system.
2100
2124
  *
2101
2125
  * @param ctx - Domain context of the world plugin.
2102
2126
  * @param plan - The system's resolved query.
2127
+ * @param hidesAside - True for a feature's system: it passes over the entities of a scene built aside until the
2128
+ * commit (F155).
2103
2129
  */
2104
- constructor(ctx: WorldCtx, plan: QueryPlan);
2130
+ constructor(ctx: WorldCtx, plan: QueryPlan, hidesAside?: boolean);
2105
2131
  /**
2106
2132
  * The walk is its own iterator, so the runner hands it to `run` as the rows. A second loop over
2107
2133
  * it in the same run finds it walked.
@@ -2116,7 +2142,7 @@ declare class SystemWalk implements Iterator<readonly unknown[], undefined> {
2116
2142
  */
2117
2143
  reset(): SystemWalk;
2118
2144
  /**
2119
- * Keeps one key of the first store when the entity carries every other name.
2145
+ * Keeps one key of the first store when the entity carries every other name and is not built aside.
2120
2146
  *
2121
2147
  * @param entity - The key.
2122
2148
  */
@@ -2130,8 +2156,8 @@ declare class SystemWalk implements Iterator<readonly unknown[], undefined> {
2130
2156
  next(): IteratorResult<readonly unknown[], undefined>;
2131
2157
  /**
2132
2158
  * Reads the stores of this run and collects the entities that carry every name, in the first
2133
- * store's order. Structural changes are queued until the phase ends, so the matches stay true
2134
- * while the rows are consumed.
2159
+ * store's order; a feature's system passes over the entities of a scene built aside. Structural
2160
+ * changes are queued until the phase ends, so the matches stay true while the rows are consumed.
2135
2161
  */
2136
2162
  private start;
2137
2163
  /**
@@ -2582,7 +2608,8 @@ type SystemEntry = {
2582
2608
  */
2583
2609
  readonly stores: Array<ComponentStore | undefined>; /** The scenes it runs on, read once at registration; `undefined` for every scene. */
2584
2610
  readonly scenes: readonly string[] | undefined; /** Its last chance to run was skipped: the next run is told so with `resumed`. */
2585
- skipped: boolean;
2611
+ skipped: boolean; /** A feature brought it: its rows pass over the entities of a scene built aside (F155). */
2612
+ readonly hidesAside?: boolean;
2586
2613
  /**
2587
2614
  * The walk of the declared query, made at registration; `undefined` for an empty query, which
2588
2615
  * the runner never walks. An entry built without one gets it on its first run.
@@ -3323,6 +3350,15 @@ type EcsApi = {
3323
3350
  * ecs methods the plugin root calls: frame phases, the owner listener, the clears. Not public.
3324
3351
  */
3325
3352
  type EcsInternal = {
3353
+ /**
3354
+ * Registers a system a feature brought: as `system`, and the rows of its declared `query` pass
3355
+ * over the entities of a scene built aside until the commit (F155). `world.query()`, `get` and
3356
+ * `has` inside its `run` still read them.
3357
+ *
3358
+ * @param definition - The system.
3359
+ * @returns The remover.
3360
+ */
3361
+ featureSystem(definition: AnySystem): () => void;
3326
3362
  /**
3327
3363
  * Registers a listener for `despawnOwnedBy`, so `projection` can drop the views of an owner
3328
3364
  * that left.
@@ -13455,11 +13491,13 @@ type Leaving = {
13455
13491
  outMs: number;
13456
13492
  /**
13457
13493
  * The floor on the swap (F130), for a loader that is on with `holdMs` above 0: the clock moment the swap may happen at,
13458
- * and the frame counter at the look's start. Absent: no floor. `state.leaving` is always the running switch's look
13494
+ * the game time it may happen at (F156: the stepped frames of a visual test move it where the clock stands), and the
13495
+ * frame counter at the look's start. Absent: no floor. `state.leaving` is always the running switch's look
13459
13496
  * (`dropLeftOver` and `leaveFor` keep it so), which is why the build reads it there.
13460
13497
  */
13461
13498
  hold?: {
13462
13499
  until: number;
13500
+ elapsedUntil: number;
13463
13501
  frame: number;
13464
13502
  };
13465
13503
  /**
@@ -1,7 +1,7 @@
1
- import { An as FeaturePlugin, Br as Config, Hr as Json, Ir as FakeClock, Jr as ProviderCall, Mn as AnyFlow, Pr as ClockSource, Q as Config$2, Qr as SnapshotOf, Vn as TypeTag, Yr as SaveDoc, a as Config$3, d as Manifest, ht as Orientation, mn as Config$1, n as AssetsIo, nt as PixiModule, qr as PlayerStateProvider } from "./types-BzVQAaSX.mjs";
2
- import { o as AudioContextLike, s as Config$4 } from "./types-Co-6A6Y8.mjs";
3
- import { H as I18nApi, J as TextKey, q as StringTable } from "./types-Cx_-n0Ts.mjs";
4
- import { Ct as platformPlugin, Ft as audioPlugin, Mt as effectsPlugin, Tt as PlatformProvider, i as screen, t as createApp } from "./index-Bz6p2alA.mjs";
1
+ import { An as FeaturePlugin, Br as Config, Hr as Json, Ir as FakeClock, Jr as ProviderCall, Mn as AnyFlow, Pr as ClockSource, Q as Config$2, Qr as SnapshotOf, Vn as TypeTag, Yr as SaveDoc, a as Config$3, d as Manifest, ht as Orientation, mn as Config$1, n as AssetsIo, nt as PixiModule, qr as PlayerStateProvider } from "./types-Ce5W0gZe.mjs";
2
+ import { o as AudioContextLike, s as Config$4 } from "./types-Cdzw3as5.mjs";
3
+ import { H as I18nApi, J as TextKey, q as StringTable } from "./types-C1B7-x7p.mjs";
4
+ import { Ct as platformPlugin, Ft as audioPlugin, Mt as effectsPlugin, Tt as PlatformProvider, i as screen, t as createApp } from "./index-DtbI1op8.mjs";
5
5
  import { AnyPluginInstance } from "@moku-labs/core";
6
6
 
7
7
  //#region src/plugins/model/store/providers/memory.d.ts
@@ -1,9 +1,9 @@
1
- import { Nr as Api$4, Or as Api$1, Z as Api, ni as Api$3, zr as Api$2 } from "./types-BzVQAaSX.mjs";
2
- import { U as AnimApi, r as UiApi } from "./types-Co-6A6Y8.mjs";
3
- import { L as InputApi } from "./types-Cx_-n0Ts.mjs";
4
- import { r as Repro } from "./headless-WyPk3UrP.mjs";
5
- import { i as ControlApp, o as InputOf } from "./types-DyohsXF_.mjs";
6
- import { t as commands } from "./commands-DFCBw6F2.mjs";
1
+ import { Nr as Api$4, Or as Api$1, Z as Api, ni as Api$3, zr as Api$2 } from "./types-Ce5W0gZe.mjs";
2
+ import { U as AnimApi, r as UiApi } from "./types-Cdzw3as5.mjs";
3
+ import { L as InputApi } from "./types-C1B7-x7p.mjs";
4
+ import { r as Repro } from "./headless-CEG1oR5D.mjs";
5
+ import { i as ControlApp, o as InputOf } from "./types-C612npUH.mjs";
6
+ import { t as commands } from "./commands-C2JXDkUV.mjs";
7
7
 
8
8
  //#region src/visual/types.d.ts
9
9
  /** The base commands of the `/control` door, keyed by their short names. */
package/dist/visual.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-D5L3ZtuQ.mjs";
1
+ import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-BoSpJLWP.mjs";
2
2
  export { type CheckpointResult, type VisualApp, type VisualOptions, type VisualPage, type VisualRenderer, type VisualReport, type VisualSetup, type VisualStart, type VisualStep, type VisualTest, type VisualTestResult, type VisualTolerance, defineVisualTest, parseVisualArgv, runVisualTests };
package/dist/visual.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as VISUAL_CLOCK } from "./fake-hnJcJeYf.mjs";
2
- import { n as read, t as sources } from "./sources-Cqqz-0-b.mjs";
3
- import { n as commands, t as run } from "./run-B5if0jxE.mjs";
2
+ import { n as read, t as sources } from "./sources-BJyIJf_X.mjs";
3
+ import { n as commands, t as run } from "./run-pCQlIaNP.mjs";
4
4
  import path from "node:path";
5
5
  import { createBrandConsole } from "@moku-labs/common/cli";
6
6
  import { mkdir, readFile, writeFile } from "node:fs/promises";
package/llms.txt CHANGED
@@ -12,7 +12,7 @@ Facts: Bun only. ESM only. `"sideEffects"` lists the root entry `./dist/index.mj
12
12
  - `@moku-labs/game/app/system` (the browser, the native shell): `systemShellOf`, `fromSystem`, `storeSave`, `createSystemApp`, the type `SystemModules`, over the optional peer `@moku-labs/system`. The one entry that names it, in types only: the page hands it the loaders.
13
13
  - `@moku-labs/game/cli` (node and bun only): `runCli`, the bin `moku-game`, `preparePage`, the editor's dev page, `watchKeys`, the watch that keeps `generated/` fresh next to it, and `watchEngine`, the watch that tells when the installed engine changed.
14
14
  - `@moku-labs/game/testing`: headless play, repro runs, isolated feature tests (`isolate`, `stub`), fake clock, the `fx` of a node for a unit test (`fakeFx`), in-memory save provider. No `node:` import.
15
- - `@moku-labs/game/visual` (node and bun only): the visual tests `defineVisualTest`, `runVisualTests`, `parseVisualArgv`. The bin runs them: `moku-game visual`. A step is a `/control` command or `{ checkpoint: name, finish?: boolean }`: a checkpoint lands every motion before its snapshot, `finish: false` keeps them running (same frames in both legs). Both legs run on one clock: the pixel leg's dev page runs on a fake clock at the headless app's `clock.now()` (`startMoment`), standing still like the headless one.
15
+ - `@moku-labs/game/visual` (node and bun only): the visual tests `defineVisualTest`, `runVisualTests`, `parseVisualArgv`. The bin runs them: `moku-game visual`. A step is a `/control` command or `{ checkpoint: name, finish?: boolean }`: a checkpoint lands every motion before its snapshot, `finish: false` keeps them running (same frames in both legs). Both legs run on one clock: the pixel leg's dev page runs on a fake clock at the headless app's `clock.now()` (`startMoment`), standing still like the headless one. Frames move game time, not that clock: the step `{ clock: { advanceMs } }` moves it (`clock.advance`), so a moment armed with `schedule` comes due (F157). A floor on a scene swap (`loader.holdMs`) also passes in game time, so an `answer` that switches the scene settles in the pixel leg (F156).
16
16
  - `@moku-labs/game/assets` (node and bun only): the asset key scanner, the production packer and the string compiler. The package bin `moku-game-assets` runs it.
17
17
  - `@moku-labs/game/inspect`: the read door of the editor, safe in a production build. See "Doors for the editor".
18
18
  - `@moku-labs/game/control`: the write door of the editor, dev builds only. See "Doors for the editor".
@@ -558,12 +558,12 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
558
558
  ### Screen plugins (V2, built)
559
559
 
560
560
  `world`, `renderer`, `input`, `assets`, `scenes`. Each has a README at `src/plugins/<name>/README.md`; the root README lists their APIs, events and config. Rendering: WebGPU preferred, with Pixi's WebGL fallback.
561
- - `app.scenes`: `current()` the mounted scene id, `expect(id)` the scene the next node without its own `scene` mounts, a rest node or a transit node in live mode (the restore door calls it; an unknown id throws). An `over` node takes it the same way, also over another mounted scene. A live switch, before it builds the scene, warms the bundles the scene names (`assets.warm`): their textures go to the GPU `renderer.uploads` a drawn frame while the old scene is still up, so the first frame of the new scene uploads none of them; textures already there are not waited for, and a fast walk or a headless app never waits. A bundle the scene does not name (a `core` bundle of portraits the board shows) is not warmed: name it in the scene's `bundles` or call `app.assets.warm`. Then, with a drawing renderer, the next scene is built aside: its ui elements are made by root and by part, laid out once and applied in parts, and the renderer makes its Pixi views, over the next frames off the stage in a budget per frame, config `scenes.buildMs: number | "auto"` (default `"auto"`, two thirds of the frame interval: 11.1 ms at 60 Hz, 5.56 ms at 120 Hz; `0` throws), and it is swapped in one frame. Until the swap `current()` answers the old scene, nothing of the new one is drawn, hit or found by `ui.find`, its `enter` motions wait and the gate stays closed, so the first tap lands on a complete scene; `scenes:changed` is emitted at the swap. A fast walk, a world that is not live and a headless app mount in one block as before. Over the scene being left, a live switch shows the look of `scenes.leave` (a veil, and a loader once the switch is not done `afterMs` after its start); the veil goes up at the node's `"begin"` stage, before `assets` downloads the coming scene at `"load"`, so a cold first visit reacts in the next frame.
561
+ - `app.scenes`: `current()` the mounted scene id, `expect(id)` the scene the next node without its own `scene` mounts, a rest node or a transit node in live mode (the restore door calls it; an unknown id throws). An `over` node takes it the same way, also over another mounted scene. A live switch, before it builds the scene, warms the bundles the scene names (`assets.warm`): their textures go to the GPU `renderer.uploads` a drawn frame while the old scene is still up, so the first frame of the new scene uploads none of them; textures already there are not waited for, and a fast walk or a headless app never waits. A bundle the scene does not name (a `core` bundle of portraits the board shows) is not warmed: name it in the scene's `bundles` or call `app.assets.warm`. Then, with a drawing renderer, the next scene is built aside: its ui elements are made by root and by part, laid out once and applied in parts, and the renderer makes its Pixi views, over the next frames off the stage in a budget per frame, config `scenes.buildMs: number | "auto"` (default `"auto"`, two thirds of the frame interval: 11.1 ms at 60 Hz, 5.56 ms at 120 Hz; `0` throws), and it is swapped in one frame. Until the swap `current()` answers the old scene, nothing of the new one is drawn, hit or found by `ui.find`, the rows of a feature's system pass over its entities (a system without `scenes` sees the new scene whole from the commit frame, F155), its `enter` motions wait and the gate stays closed, so the first tap lands on a complete scene; `scenes:changed` is emitted at the swap. A fast walk, a world that is not live and a headless app mount in one block as before. Over the scene being left, a live switch shows the look of `scenes.leave` (a veil, and a loader once the switch is not done `afterMs` after its start); the veil goes up at the node's `"begin"` stage, before `assets` downloads the coming scene at `"load"`, so a cold first visit reacts in the next frame.
562
562
  - `Shape({ kind, w, h, fill, fillAlpha, alpha, radius, stroke, strokeWidth, dash, clip, sweep?, cap? })` (`kind: "rect"`; `sweep` and `cap` are optional, `1` and `"round"` when left out; only an arc reads them; a rectangle or a triangle ignores them, also when an earlier arc left them on the `Shape`): a rounded rectangle, `kind: "triangle"` (fills its box pointing right) or `kind: "arc"`: a stroke on the circle inscribed in the box (`min(w, h) − strokeWidth` across, centred) from 12 o'clock clockwise over `sweep` (0..1, clamped; 0 draws nothing, 1 a closed ring), ended by `cap` (`"round" | "butt"`); an arc draws no fill and ignores `radius` and `dash`. The path is built again only when a field changes: a still arc costs nothing a frame. `Shape({ kind: "arc", w: 28, h: 28, stroke: 0xc8a15a, strokeWidth: 2.2, sweep: 0.42 })` is a slot timer's ring with 42 % left.
563
563
  - Overlays: `Overlay({ dim, dimColor, cover, hud, fade, hold })` on the root of an overlay (in `components`) keeps everything drawn before it as one picture, retaken in the frame anything in it changes, and with `cover: "opaque"` draws none of it once landed at alpha 1; `hold: true` (default `false`) holds the endless loops under it while it stands, as under a cover or a blurred picture (their phase follows time), so a dimmed sheet over a sharp scene draws no frame at rest; the engine draws the dim (`dim × level`, right under the root); the level follows the root's own enter and exit motion, `fade` (250 ms) only when it has none; level and landing are read through `app.renderer.sync.debug.overlays()`. A `backdrop: true` filter inside the kept range runs no pass while the picture stands (its look is in the picture) and is drawn again in the frame the overlay is gone. Types: `OverlayValue` (the component's value) and `HudPartValue` (a part of the HUD an overlay keeps shown or lets fade).
564
564
  - HUD: a scene layer `{ above: "overlays" }` is the HUD layer, drawn above every overlay and never in a picture; a scene with a HUD layer and no `ui` gets `ui` right under it. Its roots never take the keyboard: Escape and the Back press reach the top sheet under it. `HudPart({ key })` tags a HUD view; an overlay's `hud` (`"all"`, `"none"` or keys) names the parts that stay shown, the others fade with its level and take no tap. `hud: "under"` draws the whole HUD layer under the overlay's own dim instead, dimmed with the rest (one Pixi `RenderLayer` right before the dim; the HUD and the veil each drawn once): `Overlay({ dim: 0.82, dimColor: 0x1e161a, hud: "under" })`. While held the HUD takes no tap; the topmost such overlay holds it, and a sheet without `"under"` over it shows the HUD above again until it goes; with `dim: 0` it is `"all"`. Keys are typed by `defineGame<{ …, hud: "energy" | "gems" }>()`.
565
565
  - Endless loops of views under an opaque or blurred overlay write nothing (`renderer.sync.loopsHeld(entity)`, the seam anim asks before an endless loop writes); their phase follows time.
566
- - Scene switch look: from the start of a live switch (before its bundles and textures are awaited) the renderer draws a veil over the scene being left, above every layer, and, when the switch is not done `afterMs` after its start, a loader above it until the swap; then the veil fades out over the new scene. Config `scenes.leave` (default `{ cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } }`) and a scene's `leave` (`defineScene("ward", { ..., leave: false })`) are merged field by field (the scene being left decides; `false` turns a part or the whole off); the loader is the engine's white ring, `loader: { texture: "ui.loader.ring" }` a game texture turning, or `loader: { projection: "loading" }` a projection in a layer of its own the scene declares (no other projection of the scene may draw there), kept built and hidden while the scene stands and shown once the loader is due; `scenes` feeds that loader the switch (`projection.feed`), so its `from(player, session, sw)` reads a `SceneSwitch`: `{ from: "ward", to: "ward", progress: 0 }` while the ward stands, then `{ from: "ward", to: "board", progress }`, the share of the board's bundles loaded (from `assets:bundle-progress`; a bundle loaded at the start or once the scene stage has its loads counts whole), 0 to 1 in steps of 0.01, the last exactly 1; `loader: { holdMs: 260 }` (default 0) is a floor on the swap: the next scene builds at once and the old one stays until 260 ms after the switch start and one drawn frame of the look, so a switch slower than it gets nothing added; an abort or a throw drops both at once; fast walks, a world that is not live, headless apps and the first scene show nothing and hold nothing. The scene being entered sets the veil's colour and alpha: `defineScene("night", { ..., enter: { cover: { color: 0x0b1020, alpha: 0.7 } } })` wins over what the scene being left resolved, field by field; `inMs`/`outMs` stay the left scene's and a veil turned off stays off. Types `SceneLeave`, `SceneCover`, `SceneLoader`, `SceneEnter` (`Scenes`).
566
+ - Scene switch look: from the start of a live switch (before its bundles and textures are awaited) the renderer draws a veil over the scene being left, above every layer, and, when the switch is not done `afterMs` after its start, a loader above it until the swap; then the veil fades out over the new scene. Config `scenes.leave` (default `{ cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } }`) and a scene's `leave` (`defineScene("ward", { ..., leave: false })`) are merged field by field (the scene being left decides; `false` turns a part or the whole off); the loader is the engine's white ring, `loader: { texture: "ui.loader.ring" }` a game texture turning, or `loader: { projection: "loading" }` a projection in a layer of its own the scene declares (no other projection of the scene may draw there), kept built and hidden while the scene stands and shown once the loader is due; `scenes` feeds that loader the switch (`projection.feed`), so its `from(player, session, sw)` reads a `SceneSwitch`: `{ from: "ward", to: "ward", progress: 0 }` while the ward stands, then `{ from: "ward", to: "board", progress }`, the share of the board's bundles loaded (from `assets:bundle-progress`; a bundle loaded at the start or once the scene stage has its loads counts whole), 0 to 1 in steps of 0.01, the last exactly 1; `loader: { holdMs: 260 }` (default 0) is a floor on the swap: the next scene builds at once and the old one stays until 260 ms after the switch start (on the clock or in game time, whichever passes first, so a visual test's stepped frames pass it while its fake clock stands, F156) and one drawn frame of the look, so a switch slower than it gets nothing added; an abort or a throw drops both at once; fast walks, a world that is not live, headless apps and the first scene show nothing and hold nothing. The scene being entered sets the veil's colour and alpha: `defineScene("night", { ..., enter: { cover: { color: 0x0b1020, alpha: 0.7 } } })` wins over what the scene being left resolved, field by field; `inMs`/`outMs` stay the left scene's and a veil turned off stays off. Types `SceneLeave`, `SceneCover`, `SceneLoader`, `SceneEnter` (`Scenes`).
567
567
  - A scene names bundles on top of its `bundle` from the committed state: `defineScene("ward", { bundle: "episodes-kit", bundles: ({ session }) => [session.episode], layers: {}, projections: [wardRoom] })`. `bundles` is read each time a node enters the scene, and every way in (a live entry, a restore, the `safeNode` recovery) waits for all of them before the scene is mounted and the node's gate opens. The keys are `BundleKey`s of `generated/assets.ts`.
568
568
  - `app.assets`: `load(bundle)`, `warm(bundle)` (loads it if needed, then puts its textures and atlas pages on the GPU through `renderer.sync.textures.upload`, `renderer.uploads` a drawn frame; joins a running or finished warm; an unload forgets it; resolves also when the renderer could not upload; headless at once), `unload(bundle)`, `isLoaded(bundle)`, `has(bundle)` (the manifest carries it, loaded or not), `texture(key)`, `font(key)`, `audio(key)`, `usage()`. Per bundle in a feature's `assets.ts`: `defineBundles({ ep01: { tier: "feature", release: "leave", mipmaps: ["items/**"] } })`. `release: "leave"` also unloads the bundle, with reason `"leave"`, at the next rest once nothing holds it: not pinned by the node entered, not named by the mounted scene, no node of its feature on the stack; a bundle the outgoing scene named leaves one rest later. The default `"budget"` leaves only under the texture budget. `mipmaps` (`true` or globs relative to `assets/`) uploads the textures with their full chain; such a texture stays loose in a pack. A sub-feature with resources gets its own bundles, named like its folder, with `dir` and `parent` in the manifest; a code-only one has none. The effect `ready(bundle | bundles)` (root export, also from `defineGame`) lets a node rest on a load and stay answerable: its handler (fast mode too) answers `true` headless, throws for an unknown bundle, answers `true` when every bundle is loaded and warmed or its last warm failed (`ctx.log.warn("assets:ready-failed", { bundle, error })`, cleared by a later successful load), otherwise starts `warm` for what is missing, answers `false` and posts `{ type: "ready" }` into `flow.inbox` once all of it settled. Recipe: a rest node `inbox: ["elapsed", "ready"]` with outcomes `ready` and `back`, and a transit node `if ((await fx(ready(list))) === false) return out.wait();`. `companions.add({ load(bundle), unload(bundle) })` adds what loads and unloads with every bundle; `i18n` adds the strings of a sub-feature that way, only when `assets` is composed. Events `assets:bundle-loaded`, `assets:bundle-progress`, `assets:bundle-unloaded` (`reason: "budget" | "request" | "leave"`), `assets:replaced` (dev). Config: `manifest`, `textureBudgetMb: 192`, `preloadDepth: 2`, `baseUrl`, `io`.
569
569
  - `resource(name, defaults)` clones plain JSON defaults into every world. `resource(name, () => value)` calls the factory once per world on first read, so the value may hold a `Map` or a function: `const Looks = resource("boardLooks", () => ({ shown: new Map<World.Entity, { look: string }>() }))`. A system keeps its own state there; `snapshot()` leaves a value that is not JSON out.
@@ -703,7 +703,7 @@ A plugin that owns a resource stores it in its state and frees it in `onStop: ({
703
703
  Two subpaths, neither on the root (V4). An editor, MCP tools and e2e scripts reach a running game through them; `docs/doors.md` in the engine repository has the full catalogue.
704
704
 
705
705
  - `@moku-labs/game/inspect`: `read(app, source, input?)` reads once; `watch(app, source, input, fn)` reads on the `signals` phase when the source changes and returns the stop function; `defineSource`; the frozen catalogue `sources`; the types `Source`, `InputSchema`, `InputOf`. Every source only reads, so the door is safe in a production build. Keys of `sources`: `graph`, `position`, `history`, `tainted`, `cheats`, `model`, `entities`, `projections`, `ui`, `locate`, `render`, `sounds`, `audioMuted`, `effects`, `filters`, `assets`, `log`, `explain`, `diff`, `schema`, `at`; their ids are `game.<key>`. `filters` answers `{ kinds, off }` of `effects.diagnostics`. `locate` takes `{ key }` (a ui element) or `{ target }` (a view by projection key) and answers its box in CSS px, the numbers Playwright clicks. `at` takes `{ x, y }` in CSS px and lists the views under that point, topmost first. `explain` takes `{ entity }` and answers that entity in full, `undefined` for a stale id. `diff` takes `{ from, to }` frames and answers what changed per entity; it throws in a production build and for a frame outside the last 120. `schema` lists every component and tag type the world met, with the JSON kind of each field. `audioMuted` answers whether the master bus is muted. `sounds` throws `[game] The source game.sounds needs audioPlugin.`, `audioMuted` throws `[game] The source game.audioMuted needs audioPlugin.` and `effects` and `filters` throw `[game] The source game.effects needs effectsPlugin.` (`game.filters` for `filters`) when that plugin is not installed; the editor lists such a source as not installed.
706
- - `@moku-labs/game/control`: `run(app, command, input?)` resolves `{ value, state }`, `state` being `{ path, frame, tainted }`; `defineCommand`; `controlRefused`; `controlReadOnly`; the frozen catalogue `commands`; the types `Command`, `ChoiceInput`, `Ran`, `ControlReadOnlyError`. Keys of `commands`: `answer`, `tap`, `drag`, `key`, `fill`, `scroll`, `walk`, `bookmark`, `restore`, `saveExport`, `saveImport`, `step`, `pause`, `resume`, `capture`, `debug`, `reducedMotion`, `timeScale`, `frameRate`, `mute`, `trace`, `filter`. `capture` resolves `{ png }`, and `{ png, legend }` with `legend: true`; `undefined` while the renderer is inert. `timeScale` takes `{ scale }`; 0 freezes game time while the frames keep running. `frameRate` takes `{ fps? }`, calls `time.setRate(fps ?? "auto")` and answers `time.rate()`. `mute` takes `{ muted }`, mutes the master bus and answers the flag. Without `audioPlugin` it throws `[game] The command game.mute needs audioPlugin.` `trace` takes `{ path }`, a list of views by projection key, and answers whether the gate took the answer. `scroll` takes `{ key, to }`, calls `ui.scroll(key, to)` and answers what it answers; a visual test writes it as the step `{ scroll: { key, to } }`. `filter` takes `{ kind, on }`, switches the filter kind through `effects.diagnostics` (cosmetic) and answers the off kinds; an unknown kind throws `[game] No filter kind "fx.nope".` naming the known ones; without `effectsPlugin` it throws `[game] The command game.filter needs effectsPlugin.`
706
+ - `@moku-labs/game/control`: `run(app, command, input?)` resolves `{ value, state }`, `state` being `{ path, frame, tainted }`; `defineCommand`; `controlRefused`; `controlReadOnly`; the frozen catalogue `commands`; the types `Command`, `ChoiceInput`, `Ran`, `ControlReadOnlyError`. Keys of `commands`: `answer`, `tap`, `drag`, `key`, `fill`, `scroll`, `walk`, `bookmark`, `restore`, `saveExport`, `saveImport`, `step`, `clock`, `pause`, `resume`, `capture`, `debug`, `reducedMotion`, `timeScale`, `frameRate`, `mute`, `trace`, `filter`. `run` checks the input against the command's schema first (F154): an unknown field, a required field left out and a value of another kind (a `number` must be finite) throw `[game] The command game.scroll got the field "dy", which it does not take.` with the fields it takes, and nothing runs. `clock` takes `{ advanceMs }` (cheat), calls `clock.advance(advanceMs)` and answers `{ now }`: a moment armed with `clock.scheduleAt` that is due arrives as `elapsed`; a visual test writes it as the step `{ clock: { advanceMs: 60_000 } }` to reach a clock-armed rest node (F157). `capture` resolves `{ png }`, and `{ png, legend }` with `legend: true`; `undefined` while the renderer is inert. `timeScale` takes `{ scale }`; 0 freezes game time while the frames keep running. `frameRate` takes `{ fps? }`, calls `time.setRate(fps ?? "auto")` and answers `time.rate()`. `mute` takes `{ muted }`, mutes the master bus and answers the flag. Without `audioPlugin` it throws `[game] The command game.mute needs audioPlugin.` `trace` takes `{ path }`, a list of views by projection key, and answers whether the gate took the answer. `scroll` takes `{ key, to }`, calls `ui.scroll(key, to)` and answers what it answers; a visual test writes it as the step `{ scroll: { key, to } }`. `filter` takes `{ kind, on }`, switches the filter kind through `effects.diagnostics` (cosmetic) and answers the off kinds; an unknown kind throws `[game] No filter kind "fx.nope".` naming the known ones; without `effectsPlugin` it throws `[game] The command game.filter needs effectsPlugin.`
707
707
  - Commands run in dev builds and debug builds. `__MOKU_GAME_DEV__ === true` (the dev page, a test's `vi.stubGlobal("__MOKU_GAME_DEV__", true)`) or `__MOKU_GAME_CONTROL__ === true` (`--debug`) runs every command; `__MOKU_GAME_AGENT__ === true` alone (`--debug=read`) runs the `read` and `cosmetic` ones and `run` refuses the others with `controlReadOnly(id)`, an error with `reason: "read-only"`: `[game] The command game.tap changes the game: this debug build runs read and cosmetic commands only.`; no flag: `run` throws `[game] Control commands run in dev builds only.` `moku-game build` defines the three flags `false`; a game without the shell uses a bundler `define` and should add `__MOKU_GAME_AGENT__: "false"` and `__MOKU_GAME_CONTROL__: "false"`. `saveExport` answers the committed `{ player, session, rng }` (read); `saveImport` takes `{ save }` of `saveExport`, restores it at the main flow's start and flushes the store (raw: not on a `--debug=read` page).
708
708
  - A command's effect is `read`, `route`, `cosmetic`, `cheat` or `raw`. A `cheat` or `raw` command taints the session and is journaled; read it with `sources.tainted` and `sources.cheats`. Of the base commands `restore` and `saveImport` are `raw`; `capture` with `diff` writes the state too, so a `--debug=read` page refuses it. `bookmark` answers `flow.bookmark()` plus `scene`, the mounted scene; `restore` calls `scenes.expect(scene)` before `flow.restore`, so a bookmark at a popup restores the scene under it, also on a page that shows another scene. A bookmark taken while an effect that takes answers waits names the waiting transit node (`info/show` in the mini game) and carries `rest`; `restore` of it answers once that node's gate is open, with `pending.gate` in its value, and the popup shows on the next frame.
709
709
  - A game's own: `defineSource({ id, title, input, changes, read })` with `changes` `"frame"`, `"commit"` or `"edge"`, and `defineCommand({ id, title, input, effect, run, overlay?, value?, choices?, choice? })`: `overlay: "toggle"` (input exactly `{ on: "boolean" }` and `value: app => boolean`, the switch's state; with `choices: readonly [string, ...string[]]`, each word once or `defineCommand` throws, the input is exactly `{ on: "boolean", choice: "string" | "string?" }` and `choice: app => string` answers the marked one, run with `{ on, choice }`) or `overlay: "button"` (no required input, no value) lists the command in the editor's overlay, which shows only such commands; any other combination is a type error. The id is camelCase words joined by dots, at least two: `dice.rolls`. An input schema maps field names to `"string"`, `"number"`, `"boolean"` or `"json"`; a trailing `?` makes one optional. A command body starts with `if (typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) throw controlRefused();`: it runs in dev and is refused on a debug page. A `.dev` command meant for a debug page writes the agent form for a read or cosmetic effect, `if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_AGENT__ === "undefined" || !__MOKU_GAME_AGENT__)) throw controlRefused();`, and the control form (`__MOKU_GAME_CONTROL__` in place of `__MOKU_GAME_AGENT__`) for the others. Keep them in `.dev` modules that only the dev page, a debug page and the tests import: the editor's dev page (`preparePage` with agents) and `moku-game build --debug` import every `**/*.dev.ts`, `moku-game build` none.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/game",
3
- "version": "0.15.101",
3
+ "version": "0.15.102",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [