@moku-labs/game 0.15.148 → 0.15.149

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.
@@ -1,4 +1,4 @@
1
- import { h as StartedPage, r as GameConfig, t as AnyGameApp, u as PageOptions } from "../types-Bxecqli6.mjs";
1
+ import { h as StartedPage, r as GameConfig, t as AnyGameApp, u as PageOptions } from "../types-Cy2IGCQU.mjs";
2
2
 
3
3
  //#region src/app/page.d.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { Yr as PlayerStateProvider } from "../types-C9L-dSRf.mjs";
2
- import { Et as PlatformProvider } from "../index-sltlACR5.mjs";
3
- import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-Bxecqli6.mjs";
1
+ import { Yr as PlayerStateProvider } from "../types-DFmiN69h.mjs";
2
+ import { Et as PlatformProvider } from "../index-DP9hZTrk.mjs";
3
+ import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-Cy2IGCQU.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 { Wr as Json } from "./types-C9L-dSRf.mjs";
2
- import { J as StringTable } from "./types-CbbpjAo1.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-Bxecqli6.mjs";
1
+ import { Wr as Json } from "./types-DFmiN69h.mjs";
2
+ import { J as StringTable } from "./types-BbHpVeAD.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-Cy2IGCQU.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 { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-BcZrBZKH.mjs";
1
+ import { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-6rmoFaD5.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-C9L-dSRf.mjs";
1
+ import { d as Manifest } from "./types-DFmiN69h.mjs";
2
2
 
3
3
  //#region src/plugins/assets/scan/cli.d.ts
4
4
  /**
@@ -1,8 +1,8 @@
1
- import { $r as Snapshot, Ar as Api$4, Fn as Bookmark, Fr as Api$1, O as DebugSwitches, Q as Api$3, Rn as FlowState, fi as FrameRate, gi as Time, ii as Api$2, mt as Captured, t as Api, ti as StoreApi, w as ScenesApi } from "./types-C9L-dSRf.mjs";
2
- import { W as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-BZuWxDNn.mjs";
3
- import { R as InputApi } from "./types-CbbpjAo1.mjs";
4
- import { t as HeadlessApp } from "./headless-ABpROLSJ.mjs";
5
- import { i as ControlApp, r as Command } from "./types-D9J6jJ6g.mjs";
1
+ import { $r as Snapshot, Ar as Api$4, Fn as Bookmark, Fr as Api$1, O as DebugSwitches, Q as Api$3, Rn as FlowState, fi as FrameRate, gi as Time, ii as Api$2, mt as Captured, t as Api, ti as StoreApi, w as ScenesApi } from "./types-DFmiN69h.mjs";
2
+ import { W as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-fkR2U4dd.mjs";
3
+ import { R as InputApi } from "./types-BbHpVeAD.mjs";
4
+ import { t as HeadlessApp } from "./headless-CayFBKSj.mjs";
5
+ import { i as ControlApp, r as Command } from "./types-BMhuZtOK.mjs";
6
6
 
7
7
  //#region src/plugins/flow/doors/commands.d.ts
8
8
  /**
@@ -1,7 +1,7 @@
1
- import { t as HeadlessApp } from "./headless-ABpROLSJ.mjs";
2
- import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-D9J6jJ6g.mjs";
3
- import { t as commands } from "./commands-DCBhp5aM.mjs";
4
- import { t as defineCommand } from "./define-BUk0oFzZ.mjs";
1
+ import { t as HeadlessApp } from "./headless-CayFBKSj.mjs";
2
+ import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-BMhuZtOK.mjs";
3
+ import { t as commands } from "./commands-Rk3il_Pn.mjs";
4
+ import { t as defineCommand } from "./define-CXfxHIZS.mjs";
5
5
 
6
6
  //#region src/plugins/flow/doors/dev.d.ts
7
7
  /**
@@ -1,5 +1,5 @@
1
- import { t as HeadlessApp } from "./headless-ABpROLSJ.mjs";
2
- import { l as Source, r as Command, s as InputSchema } from "./types-D9J6jJ6g.mjs";
1
+ import { t as HeadlessApp } from "./headless-CayFBKSj.mjs";
2
+ import { l as Source, r as Command, s as InputSchema } from "./types-BMhuZtOK.mjs";
3
3
 
4
4
  //#region src/plugins/flow/doors/define.d.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { Rn as FlowState, Vn as RouteStep, Wr as Json, Xn as Answer, mn as Api$1, ri as RngState, ui as Api, zn as JournalEntry } from "./types-C9L-dSRf.mjs";
1
+ import { Rn as FlowState, Vn as RouteStep, Wr as Json, Xn as Answer, mn as Api$1, ri as RngState, ui as Api, zn as JournalEntry } from "./types-DFmiN69h.mjs";
2
2
 
3
3
  //#region src/plugins/flow/headless.d.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { $ as Config$6, Ar as Api$6, B as OverlayValue, C as SceneSpec, Cn as TextStylesOf, Cr as Mut, Dr as SystemDefinition, Dt as FrameRing, En as defineFlow, Er as ResourceType, Et as FrameRecord, Fr as Api$1, Gn as Effect, Gr as Root, Hn as SceneIdOf, Hr as Config$5, I as HudPartValue, In as DefineNode, Jn as Hint, Jr as Patch, K as SpriteOptions, Kn as EffectOptions, Kr as State$5, Lr as Config$2, Lt as PassKind, Mn as FeaturePlugin, Nn as FeatureTree, Nr as State$9, Or as SystemFor, Q as Api$4, R as NineSliceValue, S as SceneDefinition, Sn as TextFormatsOf, T as State$7, Tr as QueryTerm, U as ShapeValue, Wn as Descriptor, Wr as Json, X as sprite, Y as TransformValue, Zn as Answered, _ as AnySceneProjection, _n as EmitterIdOf, a as Config$1, ai as Config$4, ar as NumericFields, bi as Require, c as LoadBundles, ci as State$4, cr as ReducedMotion, di as Config$8, er as DescriptionNode, f as ReadyBundles, gn as Config$3, gr as ComponentHandle, hi as ThermalReading, hn as BundlesOf, i as BundleSpec, ii as Api$3, jn as FeatureDescription, jr as Config$9, kr as TagType, l as LoadReason, lt as State$6, m as Tier, mi as State$8, mn as Api$2, ni as RngApi, o as DefineBundles, oi as Events, or as ProjectionMotion, p as State$1, pi as RateChange, q as SpriteValue, qn as GuideOptions, r as BundleMap, si as PauseReason, sr as ProjectionSpec, t as Api, ti as StoreApi, tr as Ease, u as LoadResult, ui as Api$5, v as Config$7, vi as Config$10, vn as GameTypes, vr as ComponentType, w as ScenesApi, wr as Narrowed, x as LayerMap, xn as State$3, y as DefineScene, yi as Events$1, yn as HudKeysOf, yr as ComponentValue, yt as ViewportSize, zr as State$2 } from "./types-C9L-dSRf.mjs";
2
- import { $ as HapticKind, A as EmitterDefinition, B as GlowValue, C as FoldValue, D as ShineValue, E as RevealRoundValue, F as DisplacementValue, G as AnimPlayerValue, H as OutlineValue, J as MotionKeyframe, K as Config$11, L as FilterComponent, M as AlphaValue, N as BlurValue, O as VignetteValue, P as ColorMatrixValue, R as FilterSpec, S as FlashValue, T as RevealLineValue, U as UniformDeclaration, V as NoiseValue, W as AnimApi, X as Target, Y as State$10, _ as State$12, a as AudioApi, b as BloomValue, bt as OverlayApi, c as MusicDescriptor, d as State$11, et as SfxDescriptor, f as VolumesFor, h as EffectsApi, j as EmitterValue, k as EmitterConfig, l as MusicOptions, lt as play, m as Config$13, n as State$13, q as FramesValue, r as UiApi, rt as defineAnimation, s as Config$12, t as Config$14, tt as Step, w as GradeValue, x as DissolveValue, y as AuraValue, z as FilterValueOf } from "./types-BZuWxDNn.mjs";
3
- import { $ as ResolvedStyle, A as TextFormats, C as Point, E as TextBind, G as Message, H as Config$15, I as defineComponent, K as Part, L as Config$16, M as TextStyleInput, N as TextStyles, P as TextValue, Q as IsFlags, R as InputApi, T as TextApi, U as I18nApi, V as Argument, W as IntlKit, X as TypedTr, Y as TextKey, b as Config$17, et as Style, g as IntrinsicElementsFor, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, nt as TextTagStyle, q as State$14, rt as WhenFlags, s as PopupComponent, v as BindField, w as State$16, x as CountdownValue, y as BindOptions, z as State$15 } from "./types-CbbpjAo1.mjs";
1
+ import { $ as Config$6, Ar as Api$6, B as OverlayValue, C as SceneSpec, Cn as TextStylesOf, Cr as Mut, Dr as SystemDefinition, Dt as FrameRing, En as defineFlow, Er as ResourceType, Et as FrameRecord, Fr as Api$1, Gn as Effect, Gr as Root, Hn as SceneIdOf, Hr as Config$5, I as HudPartValue, In as DefineNode, Jn as Hint, Jr as Patch, K as SpriteOptions, Kn as EffectOptions, Kr as State$5, Lr as Config$2, Lt as PassKind, Mn as FeaturePlugin, Nn as FeatureTree, Nr as State$9, Or as SystemFor, Q as Api$4, R as NineSliceValue, S as SceneDefinition, Sn as TextFormatsOf, T as State$7, Tr as QueryTerm, U as ShapeValue, Wn as Descriptor, Wr as Json, X as sprite, Y as TransformValue, Zn as Answered, _ as AnySceneProjection, _n as EmitterIdOf, a as Config$1, ai as Config$4, ar as NumericFields, bi as Require, c as LoadBundles, ci as State$4, cr as ReducedMotion, di as Config$8, er as DescriptionNode, f as ReadyBundles, gn as Config$3, gr as ComponentHandle, hi as ThermalReading, hn as BundlesOf, i as BundleSpec, ii as Api$3, jn as FeatureDescription, jr as Config$9, kr as TagType, l as LoadReason, lt as State$6, m as Tier, mi as State$8, mn as Api$2, ni as RngApi, o as DefineBundles, oi as Events, or as ProjectionMotion, p as State$1, pi as RateChange, q as SpriteValue, qn as GuideOptions, r as BundleMap, si as PauseReason, sr as ProjectionSpec, t as Api, ti as StoreApi, tr as Ease, u as LoadResult, ui as Api$5, v as Config$7, vi as Config$10, vn as GameTypes, vr as ComponentType, w as ScenesApi, wr as Narrowed, x as LayerMap, xn as State$3, y as DefineScene, yi as Events$1, yn as HudKeysOf, yr as ComponentValue, yt as ViewportSize, zr as State$2 } from "./types-DFmiN69h.mjs";
2
+ import { $ as HapticKind, A as EmitterDefinition, B as GlowValue, C as FoldValue, D as ShineValue, E as RevealRoundValue, F as DisplacementValue, G as AnimPlayerValue, H as OutlineValue, J as MotionKeyframe, K as Config$11, L as FilterComponent, M as AlphaValue, N as BlurValue, O as VignetteValue, P as ColorMatrixValue, R as FilterSpec, S as FlashValue, T as RevealLineValue, U as UniformDeclaration, V as NoiseValue, W as AnimApi, X as Target, Y as State$10, _ as State$12, a as AudioApi, b as BloomValue, bt as OverlayApi, c as MusicDescriptor, d as State$11, et as SfxDescriptor, f as VolumesFor, h as EffectsApi, j as EmitterValue, k as EmitterConfig, l as MusicOptions, lt as play, m as Config$13, n as State$13, q as FramesValue, r as UiApi, rt as defineAnimation, s as Config$12, t as Config$14, tt as Step, w as GradeValue, x as DissolveValue, y as AuraValue, z as FilterValueOf } from "./types-fkR2U4dd.mjs";
3
+ import { $ as ResolvedStyle, A as TextFormats, C as Point, E as TextBind, G as Message, H as Config$15, I as defineComponent, K as Part, L as Config$16, M as TextStyleInput, N as TextStyles, P as TextValue, Q as IsFlags, R as InputApi, T as TextApi, U as I18nApi, V as Argument, W as IntlKit, X as TypedTr, Y as TextKey, b as Config$17, et as Style, g as IntrinsicElementsFor, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, nt as TextTagStyle, q as State$14, rt as WhenFlags, s as PopupComponent, v as BindField, w as State$16, x as CountdownValue, y as BindOptions, z as State$15 } from "./types-BbHpVeAD.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 { $t as PerfSampleLine, An as type, At as MonitorSections, B as OverlayValue, Br as types_d_exports$3, Bt as PerfChange, Ct as FrameColumns, Dn as exit, Dt as FrameRing, E as types_d_exports$13, Et as FrameRecord, F as HudPart, Ft as PERF_LOG_VERSION, G as SpriteBlend, Gt as PerfEventLine, H as Shape, Ht as PerfCollectorLine, I as HudPartValue, It as PROBLEM_RULES, J as Transform, Jt as PerfHeaderLine, Kt as PerfEventName, L as NineSlice, Lt as PassKind, Mt as OverlayWhat, N as WhyEntry, Nt as PERF_CAUSES, On as slot, Ot as LongFrameEntry, P as Display, Pr as types_d_exports$17, Pt as PERF_GAP_BUCKETS, Qn as AnchorTarget, Qr as SaveUnreadableError, Qt as PerfMeasured, Rt as PassRecord, St as WhyLive, Tn as contribution, Tt as FrameReadout, Ut as PerfCounts, V as Parent, Vt as PerfChangeEntry, W as Sprite, Wt as PerfDisplay, X as sprite, Xt as PerfLongFrameLine, Yt as PerfLogLine, Z as AdaptiveScale, Zt as PerfMarkLine, _i as types_d_exports$15, an as ProblemEventDetail, cn as ShaderEventDetail, ct as PoolTrim, dn as CANVAS_RESTARTS, dt as types_d_exports$12, en as PerfSpikeLine, er as DescriptionNode, et as MonitorConfig, fn as CanvasRestart, ft as ShotsApi, g as types_d_exports$1, ht as MonitorCounts, in as PoolTrimDetail, jt as OverlayEventDetail, kn as to, kt as MONITOR_SECTIONS, li as types_d_exports$9, ln as ShaderWhat, lr as SceneSwitch, nn as PerfTelemetryLine, on as ProblemRule, pn as DEMAND_REASONS, pt as ShotsConfig, qr as types_d_exports$10, qt as PerfGapLine, rn as PerfThermalLine, sn as SHADER_WHATS, tn as PerfStartupLine, un as WarmDetail, wn as types_d_exports$6, wt as FrameReadResult, xt as RetakeWhy, z as Overlay, zt as PerfCause } from "./types-C9L-dSRf.mjs";
2
- import { $ as HapticKind, C as FoldValue, D as ShineValue, E as RevealRoundValue, I as FilterArea, O as VignetteValue, Q as types_d_exports, S as FlashValue, T as RevealLineValue, _t as tween, at as frames, b as BloomValue, ct as parallel, dt as set, ft as sfx, gt as stopSfx, ht as stagger, i as types_d_exports$16, it as external, lt as play, mt as spawned, nt as HAPTIC_KINDS, ot as haptic, p as types_d_exports$2, pt as spawn, rt as defineAnimation, st as mark, ut as sequence, v as types_d_exports$5, vt as use, w as GradeValue, x as DissolveValue, xt as types_d_exports$4, y as AuraValue, yt as wait } from "./types-BZuWxDNn.mjs";
3
- import { A as TextFormats, B as types_d_exports$8, D as TextFormat, F as types_d_exports$14, I as defineComponent, O as TextFormatAnswer, S as FormattedNumber, Z as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, m as popup, nt as TextTagStyle, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-CbbpjAo1.mjs";
4
- import { $ as Traced, A as messageDuration, At as inputPlugin, B as Draggable, Bt as Countdown, C as Noise, Ct as rendererPlugin, D as defineStyle, Dt as types_d_exports$11, E as resolve, Et as PlatformProvider, F as Frames, Ft as clockPlugin, G as PointerOver, Gt as label, H as Held, Ht as bind, I as defineScene, It as audioPlugin, J as Swipeable, K as Pressable, L as defineBundles, Lt as assetsPlugin, M as defineMotion, Mt as flowPlugin, N as AnimPlayer, Nt as effectsPlugin, O as tr, Ot as modelPlugin, P as Animation, Pt as debugPlugin, Q as Traceable, R as load, Rt as animPlugin, S as Glow, St as scenesPlugin, T as music, Tt as BackResult, U as Hovered, Ut as defineTextFormats, V as DropTarget, Vt as Text, W as Pointer, Wt as defineTextStyles, X as Tappable, Y as TapValue, Z as Touchable, _ as defineFilter, _t as flattenFeatures, a as defineEmitter, at as Order, b as ColorMatrix, bt as timePlugin, c as Shine, ct as mut, d as Grade, dt as tag, et as PASS_KINDS, f as Fold, ft as defineEffect, g as Aura, gt as defineFeature, h as Bloom, ht as schedule, i as screen, it as Now, j as cubicBezier, jt as i18nPlugin, k as messageArgument, kt as lifecyclePlugin, l as RevealRound, lt as resource, m as Dissolve, mt as hint, n as createPlugin, nt as Exiting, o as Emitter, ot as Tree, p as Flash, pt as guide, q as Pressed, r as defineGame, rt as Layer, s as Vignette, st as component, t as createApp, tt as frameAt, u as RevealLine, ut as system, v as Alpha, vt as worldPlugin, w as Outline, wt as platformPlugin, x as Displacement, xt as textPlugin, y as Blur, yt as uiPlugin, z as ready, zt as projection } from "./index-sltlACR5.mjs";
1
+ import { $t as PerfSampleLine, An as type, At as MonitorSections, B as OverlayValue, Br as types_d_exports$3, Bt as PerfChange, Ct as FrameColumns, Dn as exit, Dt as FrameRing, E as types_d_exports$13, Et as FrameRecord, F as HudPart, Ft as PERF_LOG_VERSION, G as SpriteBlend, Gt as PerfEventLine, H as Shape, Ht as PerfCollectorLine, I as HudPartValue, It as PROBLEM_RULES, J as Transform, Jt as PerfHeaderLine, Kt as PerfEventName, L as NineSlice, Lt as PassKind, Mt as OverlayWhat, N as WhyEntry, Nt as PERF_CAUSES, On as slot, Ot as LongFrameEntry, P as Display, Pr as types_d_exports$17, Pt as PERF_GAP_BUCKETS, Qn as AnchorTarget, Qr as SaveUnreadableError, Qt as PerfMeasured, Rt as PassRecord, St as WhyLive, Tn as contribution, Tt as FrameReadout, Ut as PerfCounts, V as Parent, Vt as PerfChangeEntry, W as Sprite, Wt as PerfDisplay, X as sprite, Xt as PerfLongFrameLine, Yt as PerfLogLine, Z as AdaptiveScale, Zt as PerfMarkLine, _i as types_d_exports$15, an as ProblemEventDetail, cn as ShaderEventDetail, ct as PoolTrim, dn as CANVAS_RESTARTS, dt as types_d_exports$12, en as PerfSpikeLine, er as DescriptionNode, et as MonitorConfig, fn as CanvasRestart, ft as ShotsApi, g as types_d_exports$1, ht as MonitorCounts, in as PoolTrimDetail, jt as OverlayEventDetail, kn as to, kt as MONITOR_SECTIONS, li as types_d_exports$9, ln as ShaderWhat, lr as SceneSwitch, nn as PerfTelemetryLine, on as ProblemRule, pn as DEMAND_REASONS, pt as ShotsConfig, qr as types_d_exports$10, qt as PerfGapLine, rn as PerfThermalLine, sn as SHADER_WHATS, tn as PerfStartupLine, un as WarmDetail, wn as types_d_exports$6, wt as FrameReadResult, xt as RetakeWhy, z as Overlay, zt as PerfCause } from "./types-DFmiN69h.mjs";
2
+ import { $ as HapticKind, C as FoldValue, D as ShineValue, E as RevealRoundValue, I as FilterArea, O as VignetteValue, Q as types_d_exports, S as FlashValue, T as RevealLineValue, _t as tween, at as frames, b as BloomValue, ct as parallel, dt as set, ft as sfx, gt as stopSfx, ht as stagger, i as types_d_exports$16, it as external, lt as play, mt as spawned, nt as HAPTIC_KINDS, ot as haptic, p as types_d_exports$2, pt as spawn, rt as defineAnimation, st as mark, ut as sequence, v as types_d_exports$5, vt as use, w as GradeValue, x as DissolveValue, xt as types_d_exports$4, y as AuraValue, yt as wait } from "./types-fkR2U4dd.mjs";
3
+ import { A as TextFormats, B as types_d_exports$8, D as TextFormat, F as types_d_exports$14, I as defineComponent, O as TextFormatAnswer, S as FormattedNumber, Z as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, m as popup, nt as TextTagStyle, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-BbHpVeAD.mjs";
4
+ import { $ as Traced, A as messageDuration, At as inputPlugin, B as Draggable, Bt as Countdown, C as Noise, Ct as rendererPlugin, D as defineStyle, Dt as types_d_exports$11, E as resolve, Et as PlatformProvider, F as Frames, Ft as clockPlugin, G as PointerOver, Gt as label, H as Held, Ht as bind, I as defineScene, It as audioPlugin, J as Swipeable, K as Pressable, L as defineBundles, Lt as assetsPlugin, M as defineMotion, Mt as flowPlugin, N as AnimPlayer, Nt as effectsPlugin, O as tr, Ot as modelPlugin, P as Animation, Pt as debugPlugin, Q as Traceable, R as load, Rt as animPlugin, S as Glow, St as scenesPlugin, T as music, Tt as BackResult, U as Hovered, Ut as defineTextFormats, V as DropTarget, Vt as Text, W as Pointer, Wt as defineTextStyles, X as Tappable, Y as TapValue, Z as Touchable, _ as defineFilter, _t as flattenFeatures, a as defineEmitter, at as Order, b as ColorMatrix, bt as timePlugin, c as Shine, ct as mut, d as Grade, dt as tag, et as PASS_KINDS, f as Fold, ft as defineEffect, g as Aura, gt as defineFeature, h as Bloom, ht as schedule, i as screen, it as Now, j as cubicBezier, jt as i18nPlugin, k as messageArgument, kt as lifecyclePlugin, l as RevealRound, lt as resource, m as Dissolve, mt as hint, n as createPlugin, nt as Exiting, o as Emitter, ot as Tree, p as Flash, pt as guide, q as Pressed, r as defineGame, rt as Layer, s as Vignette, st as component, t as createApp, tt as frameAt, u as RevealLine, ut as system, v as Alpha, vt as worldPlugin, w as Outline, wt as platformPlugin, x as Displacement, xt as textPlugin, y as Blur, yt as uiPlugin, z as ready, zt as projection } from "./index-DP9hZTrk.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, Bloom, type BloomValue, 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, type TextRunStyle, type TextTagStyle, 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 HAPTIC_KINDS, $t as PASS_KINDS, A as types_exports$17, At as Traced, B as types_exports$7, Bt as Glow, C as defineFeature, Ct as PointerOver, D as defineBundles, Dt as Tappable, E as music, Et as Swipeable, F as types_exports$12, Ft as Emitter, G as types_exports$2, Gt as audioPlugin, H as types_exports$5, Ht as Outline, I as types_exports$11, It as Alpha, J as uiPlugin, Jt as animPlugin, K as types_exports$1, Kt as scenesPlugin, L as types_exports$10, Lt as Blur, M as types_exports$15, Mt as messageArgument, N as types_exports$14, Nt as messageDuration, O as load, Ot as Touchable, P as types_exports$13, Pt as effectsPlugin, Q as platformPlugin, Qt as rendererPlugin, R as types_exports$9, Rt as ColorMatrix, S as tr, St as Pointer, T as defineEmitter, Tt as Pressed, U as types_exports$4, Ut as defineFilter, V as types_exports$6, Vt as Noise, W as types_exports$3, Wt as debugPlugin, X as defineMotion, Xt as Animation, Y as resolve, Yt as AnimPlayer, Z as textPlugin, Zt as Frames, _ as guide, _n as modelPlugin, _t as inputPlugin, a as Vignette, an as PROBLEM_RULES, at as parallel, b as projection, bn as lifecyclePlugin, bt as Held, c as RevealLine, cn as DEMAND_REASONS, ct as set, d as Flash, dt as spawned, en as frameAt, et as defineAnimation, f as Dissolve, fn as contribution, ft as stagger, g as defineEffect, gn as type, gt as wait, h as cubicBezier, hn as to, ht as use, i as screen, in as PERF_LOG_VERSION, it as mark, j as types_exports$16, jt as i18nPlugin, k as ready, kt as Traceable, l as Grade, ln as worldPlugin, lt as sfx, m as Aura, mn as slot, mt as tween, n as createPlugin, nn as PERF_CAUSES, nt as frames, o as Shine, on as SHADER_WHATS, ot as play, p as Bloom, pn as exit, pt as stopSfx, q as types_exports, qt as assetsPlugin, r as defineGame, rn as PERF_GAP_BUCKETS, rt as haptic, s as RevealRound, sn as CANVAS_RESTARTS, st as sequence, t as createApp, tn as MONITOR_SECTIONS, tt as external, u as Fold, un as flowPlugin, ut as spawn, v as hint, vn as SaveUnreadableError, vt as Draggable, w as flattenFeatures, wt as Pressable, x as defineScene, xn as timePlugin, xt as Hovered, y as schedule, yn as clockPlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-BcZrBZKH.mjs";
1
+ import { $ as HAPTIC_KINDS, $t as PASS_KINDS, A as types_exports$17, At as Traced, B as types_exports$7, Bt as Glow, C as defineFeature, Ct as PointerOver, D as defineBundles, Dt as Tappable, E as music, Et as Swipeable, F as types_exports$12, Ft as Emitter, G as types_exports$2, Gt as audioPlugin, H as types_exports$5, Ht as Outline, I as types_exports$11, It as Alpha, J as uiPlugin, Jt as animPlugin, K as types_exports$1, Kt as scenesPlugin, L as types_exports$10, Lt as Blur, M as types_exports$15, Mt as messageArgument, N as types_exports$14, Nt as messageDuration, O as load, Ot as Touchable, P as types_exports$13, Pt as effectsPlugin, Q as platformPlugin, Qt as rendererPlugin, R as types_exports$9, Rt as ColorMatrix, S as tr, St as Pointer, T as defineEmitter, Tt as Pressed, U as types_exports$4, Ut as defineFilter, V as types_exports$6, Vt as Noise, W as types_exports$3, Wt as debugPlugin, X as defineMotion, Xt as Animation, Y as resolve, Yt as AnimPlayer, Z as textPlugin, Zt as Frames, _ as guide, _n as modelPlugin, _t as inputPlugin, a as Vignette, an as PROBLEM_RULES, at as parallel, b as projection, bn as lifecyclePlugin, bt as Held, c as RevealLine, cn as DEMAND_REASONS, ct as set, d as Flash, dt as spawned, en as frameAt, et as defineAnimation, f as Dissolve, fn as contribution, ft as stagger, g as defineEffect, gn as type, gt as wait, h as cubicBezier, hn as to, ht as use, i as screen, in as PERF_LOG_VERSION, it as mark, j as types_exports$16, jt as i18nPlugin, k as ready, kt as Traceable, l as Grade, ln as worldPlugin, lt as sfx, m as Aura, mn as slot, mt as tween, n as createPlugin, nn as PERF_CAUSES, nt as frames, o as Shine, on as SHADER_WHATS, ot as play, p as Bloom, pn as exit, pt as stopSfx, q as types_exports, qt as assetsPlugin, r as defineGame, rn as PERF_GAP_BUCKETS, rt as haptic, s as RevealRound, sn as CANVAS_RESTARTS, st as sequence, t as createApp, tn as MONITOR_SECTIONS, tt as external, u as Fold, un as flowPlugin, ut as spawn, v as hint, vn as SaveUnreadableError, vt as Draggable, w as flattenFeatures, wt as Pressable, x as defineScene, xn as timePlugin, xt as Hovered, y as schedule, yn as clockPlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-6rmoFaD5.mjs";
2
2
  import { $ as Overlay, D as defineStyle, E as defineTokens, L as defineTextFormats, M as Countdown, N as Text, P as bind, Q as NineSlice, R as defineTextStyles, X as Display, Z as HudPart, _ as DebugTrigger, ct as Exiting, dt as Order, ft as Tree, gt as system, h as Box, ht as resource, it as Transform, lt as Layer, mt as mut, nt as Shape, pt as component, rt as Sprite, st as sprite, tt as Parent, ut as Now, vt as tag, w as popup, x as ScrollState, y as LocalWrite, z as label } from "./visual-x0TPowBE.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, Bloom, 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 { $r as Snapshot, Ar as Api$1, Ln as FlowGraph, Mr as Explained, Q as Api$2, Sr as FrameDiff, Vr as Api, _r as ComponentSchema, bn as Position, gt as RenderStats, h as Usage, t as Api$3, ut as Under, xr as EntitySnapshot, zn as JournalEntry } from "./types-C9L-dSRf.mjs";
2
- import { W as AnimApi, Z as TimelinesSnapshot, a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-BZuWxDNn.mjs";
3
- import { c as UiNode } from "./types-CbbpjAo1.mjs";
4
- import { t as HeadlessApp } from "./headless-ABpROLSJ.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-D9J6jJ6g.mjs";
6
- import { n as defineSource } from "./define-BUk0oFzZ.mjs";
1
+ import { $r as Snapshot, Ar as Api$1, Ln as FlowGraph, Mr as Explained, Q as Api$2, Sr as FrameDiff, Vr as Api, _r as ComponentSchema, bn as Position, gt as RenderStats, h as Usage, t as Api$3, ut as Under, xr as EntitySnapshot, zn as JournalEntry } from "./types-DFmiN69h.mjs";
2
+ import { W as AnimApi, Z as TimelinesSnapshot, a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-fkR2U4dd.mjs";
3
+ import { c as UiNode } from "./types-BbHpVeAD.mjs";
4
+ import { t as HeadlessApp } from "./headless-CayFBKSj.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-BMhuZtOK.mjs";
6
+ import { n as defineSource } from "./define-CXfxHIZS.mjs";
7
7
 
8
8
  //#region src/plugins/flow/doors/read.d.ts
9
9
  /**
@@ -1,2 +1,2 @@
1
- import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-D97-7253.mjs";
1
+ import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-CaKaJAak.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-D97-7253.mjs";
1
+ import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-CaKaJAak.mjs";
2
2
  export { Fragment, type JSX, jsx, jsxs };
@@ -1,4 +1,4 @@
1
- import { _ as UiIntrinsicElements, a as JsxChild, t as DescriptionNode } from "./types-CbbpjAo1.mjs";
1
+ import { _ as UiIntrinsicElements, a as JsxChild, t as DescriptionNode } from "./types-BbHpVeAD.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. */
@@ -3063,6 +3063,41 @@ function createFeaturesApi(ctx) {
3063
3063
  };
3064
3064
  }
3065
3065
  //#endregion
3066
+ //#region src/plugins/flow/signal.ts
3067
+ /**
3068
+ * @file flow plugin — the child abort signal that the effects gateway and the `fx` of a node
3069
+ * context both derive. A plugin-root helper: the `fx` and `runner` modules may not import each
3070
+ * other's run-time code, and both need this one.
3071
+ */
3072
+ /**
3073
+ * Derives a signal that ends with its parent or earlier on its own: a child of the node's signal
3074
+ * that the gateway, or the `fx` of a node context, can end by itself. The parent's abort reaches
3075
+ * the child with its reason; what the child does never reaches the parent. The forwarding
3076
+ * listener is dropped with the child, so a node that shows many popups leaves nothing behind on
3077
+ * its signal once they ended.
3078
+ *
3079
+ * @param signal - The parent signal, the node's or one derived from it.
3080
+ * @returns The controller of the child signal.
3081
+ * @example
3082
+ * ```ts
3083
+ * childOf(AbortSignal.abort("restore")).signal.reason; // "restore": born aborted, like its parent
3084
+ * ```
3085
+ */
3086
+ function childOf$1(signal) {
3087
+ const child = new AbortController();
3088
+ if (signal.aborted) {
3089
+ child.abort(signal.reason);
3090
+ return child;
3091
+ }
3092
+ signal.addEventListener("abort", () => {
3093
+ child.abort(signal.reason);
3094
+ }, {
3095
+ once: true,
3096
+ signal: child.signal
3097
+ });
3098
+ return child;
3099
+ }
3100
+ //#endregion
3066
3101
  //#region src/plugins/flow/fx/api.ts
3067
3102
  /**
3068
3103
  * Turns whatever an effect handler or a hint listener failed with into an error the log takes.
@@ -3282,29 +3317,6 @@ function enqueue$2(state, work) {
3282
3317
  });
3283
3318
  }
3284
3319
  /**
3285
- * Derives the signal one handler gets: a child of the node's signal that the gateway can end on
3286
- * its own. The node's abort reaches the child with its reason; what the child does never reaches
3287
- * the node. The forwarding listener is dropped with the child, so a node that shows many popups
3288
- * leaves nothing behind on its signal.
3289
- *
3290
- * @param signal - The node's abort signal.
3291
- * @returns The controller of the child signal.
3292
- */
3293
- function childOf$1(signal) {
3294
- const child = new AbortController();
3295
- if (signal.aborted) {
3296
- child.abort(signal.reason);
3297
- return child;
3298
- }
3299
- signal.addEventListener("abort", () => {
3300
- child.abort(signal.reason);
3301
- }, {
3302
- once: true,
3303
- signal: child.signal
3304
- });
3305
- return child;
3306
- }
3307
- /**
3308
3320
  * Starts the signal of a `guide` handler and records it, so the runner can end every guide where
3309
3321
  * it lifts the narrow. A guide the node's abort already ended takes itself off the list.
3310
3322
  *
@@ -5609,19 +5621,96 @@ function refuseStart(descriptor, path) {
5609
5621
  throw new Error(`[game] fx.start() got the effect "${descriptor.kind}" in the node "${path}", and its answer has to be awaited.\n Write await fx(...) for a descriptor with answers and for a guide.`);
5610
5622
  }
5611
5623
  /**
5624
+ * Takes one effect off the open list of its run.
5625
+ *
5626
+ * @param open - The open effects of the run.
5627
+ * @param entry - The effect that settled or was closed.
5628
+ */
5629
+ function forget(open, entry) {
5630
+ const index = open.indexOf(entry);
5631
+ if (index !== -1) open.splice(index, 1);
5632
+ }
5633
+ /**
5634
+ * Ends one open effect of a node run and takes it off the list: its handler's signal is aborted (a
5635
+ * popup unmounts), the gate closes for a descriptor with `answers`, and the promise the body got
5636
+ * resolves `undefined`. Only an effect found on the list is handed here, so nothing is closed twice.
5637
+ *
5638
+ * @param modules - Injected sibling APIs.
5639
+ * @param open - The open effects of the run.
5640
+ * @param entry - The effect to end, on the list.
5641
+ */
5642
+ function closeOne(modules, open, entry) {
5643
+ forget(open, entry);
5644
+ entry.controller.abort();
5645
+ if (entry.descriptor.answers !== void 0) modules.gate.close();
5646
+ entry.end();
5647
+ }
5648
+ /**
5649
+ * Closes the popups a body or a `recover` left open, in the order they were started, when it
5650
+ * settled with a result or a failure. Other awaited effects run on. Nothing is closed after the
5651
+ * abort of the node: the abort already reached every effect, the runner shut the gate, and a body
5652
+ * that settles late must not close the gate of the node the loop entered after it.
5653
+ *
5654
+ * @param modules - Injected sibling APIs.
5655
+ * @param signal - The abort signal of the run.
5656
+ * @param open - The open effects of the run.
5657
+ */
5658
+ function closePopups(modules, signal, open) {
5659
+ if (signal.aborted) return;
5660
+ const popups = open.filter((entry) => entry.descriptor.answers !== void 0);
5661
+ for (const entry of popups) closeOne(modules, open, entry);
5662
+ }
5663
+ /**
5664
+ * Runs one awaited effect with a signal of its own, a child of the run's, and keeps it on the open
5665
+ * list until it settles, so `fx.cancel` and the body's return can end it early.
5666
+ *
5667
+ * @param modules - Injected sibling APIs.
5668
+ * @param step - The run in progress: its abort signal.
5669
+ * @param open - The open effects of the run.
5670
+ * @param descriptor - The descriptor the body awaits.
5671
+ * @returns The promise the body gets: the effect's value, or `undefined` once it was ended early.
5672
+ */
5673
+ function track(modules, step, open, descriptor) {
5674
+ const controller = childOf$1(step.signal);
5675
+ const value = modules.fx.run(descriptor, controller.signal);
5676
+ const entry = {
5677
+ effect: value,
5678
+ descriptor,
5679
+ controller,
5680
+ end: noop
5681
+ };
5682
+ entry.effect = new Promise((resolve, reject) => {
5683
+ entry.end = () => {
5684
+ resolve(void 0);
5685
+ };
5686
+ value.then((result) => {
5687
+ forget(open, entry);
5688
+ resolve(result);
5689
+ }, (error) => {
5690
+ forget(open, entry);
5691
+ reject(error);
5692
+ });
5693
+ });
5694
+ open.push(entry);
5695
+ return entry.effect;
5696
+ }
5697
+ /**
5612
5698
  * Builds the `fx` of a node context: awaited effects by call, effects the body does not wait for
5613
- * by `start`, cosmetic hints by `emit`. A `guide` narrows the gate while it runs; the runner lifts
5614
- * the narrow when the node is left. A body that was aborted keeps running, since the loop only
5615
- * stops waiting for it, so its `fx` starts nothing any more: the gate and the narrow belong to the
5616
- * node the loop entered after it. The `recover` of a rest node gets the same `fx`, bound to the
5617
- * signal of its recovery.
5699
+ * by `start`, cosmetic hints by `emit`, an awaited effect ended early by `cancel`. Each awaited
5700
+ * effect but a `guide` gets a child of the run's signal and stays on `open` until it settles; the
5701
+ * caller closes the popups left there with `closePopups` when the body settles. A `guide` narrows
5702
+ * the gate while it runs; the runner lifts the narrow when the node is left. A body that was
5703
+ * aborted keeps running, since the loop only stops waiting for it, so its `fx` starts and ends
5704
+ * nothing any more: the gate and the narrow belong to the node the loop entered after it. The
5705
+ * `recover` of a rest node gets the same `fx`, bound to the signal of its recovery.
5618
5706
  *
5619
5707
  * @param modules - Injected sibling APIs.
5620
5708
  * @param step - The run in progress: its abort signal, how it tells a walk that a gate opened, and
5621
5709
  * the path and the log a failed `start` is reported with.
5710
+ * @param open - The open effects of the run, filled and emptied by this `fx`.
5622
5711
  * @returns The effects gateway of one node run.
5623
5712
  */
5624
- function nodeFx(modules, step) {
5713
+ function nodeFx(modules, step, open = []) {
5625
5714
  /**
5626
5715
  * Awaits one effect. After the abort of the node it rejects with the abort reason instead.
5627
5716
  *
@@ -5634,11 +5723,24 @@ function nodeFx(modules, step) {
5634
5723
  const allow = guideAnswer(descriptor.payload, "allow");
5635
5724
  if (allow !== void 0) modules.gate.narrow(allow, guideAnswer(descriptor.payload, "blocked"));
5636
5725
  }
5637
- const value = modules.fx.run(descriptor, step.signal);
5726
+ const value = descriptor.kind === "guide" ? modules.fx.run(descriptor, step.signal) : track(modules, step, open, descriptor);
5638
5727
  if (descriptor.answers !== void 0) step.gateOpened();
5639
5728
  return value;
5640
5729
  };
5641
5730
  /**
5731
+ * Ends one open effect of this run early. After the abort of the node nothing is ended.
5732
+ *
5733
+ * @param effect - A promise `run` returned.
5734
+ * @returns True when the effect was open and is ended now.
5735
+ */
5736
+ const cancel = (effect) => {
5737
+ if (step.signal.aborted) return false;
5738
+ const entry = open.find((item) => item.effect === effect);
5739
+ if (entry === void 0) return false;
5740
+ closeOne(modules, open, entry);
5741
+ return true;
5742
+ };
5743
+ /**
5642
5744
  * Starts one effect and does not wait for it. It takes the path of an awaited effect, so the
5643
5745
  * mode and the node's signal apply; only its end is nobody's wait. A failure is the handler's:
5644
5746
  * it goes to the log and never to the node. A `cosmetic` descriptor does not get that far: the
@@ -5670,7 +5772,8 @@ function nodeFx(modules, step) {
5670
5772
  emit: (item) => {
5671
5773
  modules.fx.buffer(item);
5672
5774
  },
5673
- start
5775
+ start,
5776
+ cancel
5674
5777
  });
5675
5778
  }
5676
5779
  /**
@@ -5678,15 +5781,16 @@ function nodeFx(modules, step) {
5678
5781
  *
5679
5782
  * @param modules - Injected sibling APIs.
5680
5783
  * @param step - The node run in progress.
5784
+ * @param open - The open effects of the run, for its `fx`.
5681
5785
  * @returns The node context.
5682
5786
  */
5683
- function nodeContext(modules, step) {
5787
+ function nodeContext(modules, step, open) {
5684
5788
  return {
5685
5789
  input: step.input,
5686
5790
  player: step.transaction.player,
5687
5791
  session: step.transaction.session,
5688
5792
  rng: step.transaction.rng,
5689
- fx: nodeFx(modules, step),
5793
+ fx: nodeFx(modules, step, open),
5690
5794
  out: createOut(step.node.outcomes),
5691
5795
  signal: step.signal,
5692
5796
  now: step.now
@@ -5814,14 +5918,16 @@ function abortOutcome(signal) {
5814
5918
  }
5815
5919
  /**
5816
5920
  * Calls the body of a node and turns what it does into an outcome. Nothing is thrown out of here.
5921
+ * A body that settles closes the popups it left open before the loop moves on.
5817
5922
  *
5818
5923
  * @param modules - Injected sibling APIs.
5819
5924
  * @param step - The node run in progress.
5820
5925
  * @returns The result, the abort or the failure.
5821
5926
  */
5822
5927
  async function callBody(modules, step) {
5928
+ const open = [];
5823
5929
  try {
5824
- const result = await step.node.run?.(nodeContext(modules, step));
5930
+ const result = await step.node.run?.(nodeContext(modules, step, open));
5825
5931
  if (step.signal.aborted) return {
5826
5932
  kind: "aborted",
5827
5933
  reason: abortReason(step.signal)
@@ -5843,6 +5949,8 @@ async function callBody(modules, step) {
5843
5949
  kind: "failed",
5844
5950
  error
5845
5951
  };
5952
+ } finally {
5953
+ closePopups(modules, step.signal, open);
5846
5954
  }
5847
5955
  }
5848
5956
  /**
@@ -6166,29 +6274,31 @@ function takeRecovery(safe, node) {
6166
6274
  *
6167
6275
  * @param modules - Injected sibling APIs.
6168
6276
  * @param recovery - The recovery in progress.
6277
+ * @param open - The open effects of the recovery, for its `fx`.
6169
6278
  * @returns The recovery context.
6170
6279
  */
6171
- function recoverContext(modules, recovery) {
6280
+ function recoverContext(modules, recovery, open) {
6172
6281
  return {
6173
6282
  player: recovery.transaction.player,
6174
6283
  session: recovery.transaction.session,
6175
6284
  rng: recovery.transaction.rng,
6176
- fx: nodeFx(modules, recovery),
6285
+ fx: nodeFx(modules, recovery, open),
6177
6286
  signal: recovery.signal,
6178
6287
  now: recovery.now
6179
6288
  };
6180
6289
  }
6181
6290
  /**
6182
6291
  * Calls the `recover` of a node and turns what it does into an outcome. Nothing is thrown out of
6183
- * here.
6292
+ * here. A `recover` that settles closes the popups it left open, so the gate of its node opens.
6184
6293
  *
6185
6294
  * @param modules - Injected sibling APIs.
6186
6295
  * @param recovery - The recovery in progress.
6187
6296
  * @returns That it returned, the abort or the failure.
6188
6297
  */
6189
6298
  async function callRecover(modules, recovery) {
6299
+ const open = [];
6190
6300
  try {
6191
- await recovery.node.recover?.(recoverContext(modules, recovery));
6301
+ await recovery.node.recover?.(recoverContext(modules, recovery, open));
6192
6302
  if (recovery.signal.aborted) return {
6193
6303
  kind: "aborted",
6194
6304
  reason: abortReason(recovery.signal)
@@ -6203,6 +6313,8 @@ async function callRecover(modules, recovery) {
6203
6313
  kind: "failed",
6204
6314
  error
6205
6315
  };
6316
+ } finally {
6317
+ closePopups(modules, recovery.signal, open);
6206
6318
  }
6207
6319
  }
6208
6320
  /**
@@ -1,7 +1,7 @@
1
- import { Bn as NodeTable, Ir as ClockSource, Jn as Hint, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Wn as Descriptor, Wr as Json, Yn as NodeFx } from "./types-C9L-dSRf.mjs";
2
- import { t as createApp } from "./index-sltlACR5.mjs";
3
- import { b as memory, x as saveOf, y as WithGameState } from "./types-Bxecqli6.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-ABpROLSJ.mjs";
1
+ import { Bn as NodeTable, Ir as ClockSource, Jn as Hint, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Wn as Descriptor, Wr as Json, Yn as NodeFx } from "./types-DFmiN69h.mjs";
2
+ import { t as createApp } from "./index-DP9hZTrk.mjs";
3
+ import { b as memory, x as saveOf, y as WithGameState } from "./types-Cy2IGCQU.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-CayFBKSj.mjs";
5
5
  import { AnyPluginInstance } from "@moku-labs/core";
6
6
 
7
7
  //#region src/plugins/clock/fake.d.ts
@@ -89,11 +89,12 @@ type FakeFx = {
89
89
  * Builds the `fx` of a node context for a unit test that calls `node.run(context)` itself, with no
90
90
  * app and no runner. It records every call and plays no effect: `await fx(descriptor)` goes to
91
91
  * `awaited` and resolves with `options.answer(descriptor)`, `fx.start(descriptor)` goes to
92
- * `started`, `fx.emit(hint)` goes to `emitted`. `fx.start` refuses a descriptor with `answers`
93
- * and a `guide` with the error the game throws. An `answer` that fails rejects the awaited
94
- * effect, and resolves `undefined` for a `cosmetic` descriptor, as in the game. There is no
95
- * handler, no log, no fast mode and no abort signal here: for those, walk the graph with
96
- * `createHeadless`.
92
+ * `started`, `fx.emit(hint)` goes to `emitted`. `fx.cancel(promise)` resolves an awaited effect
93
+ * that has not settled `undefined` and returns `true`, and returns `false` for any other promise.
94
+ * `fx.start` refuses a descriptor with `answers` and a `guide` with the error the game throws. An
95
+ * `answer` that fails rejects the awaited effect, and resolves `undefined` for a `cosmetic`
96
+ * descriptor, as in the game. There is no handler, no log, no fast mode and no abort signal here:
97
+ * for those, walk the graph with `createHeadless`.
97
98
  *
98
99
  * @param options - The answer of an awaited effect, and the node path for the refusal message.
99
100
  * @returns The `fx` and the lists `awaited`, `started` and `emitted`.
package/dist/testing.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-BcZrBZKH.mjs";
1
+ import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-6rmoFaD5.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-yi2XmYWC.mjs";
@@ -9,11 +9,12 @@ const defaultPath = "test";
9
9
  * Builds the `fx` of a node context for a unit test that calls `node.run(context)` itself, with no
10
10
  * app and no runner. It records every call and plays no effect: `await fx(descriptor)` goes to
11
11
  * `awaited` and resolves with `options.answer(descriptor)`, `fx.start(descriptor)` goes to
12
- * `started`, `fx.emit(hint)` goes to `emitted`. `fx.start` refuses a descriptor with `answers`
13
- * and a `guide` with the error the game throws. An `answer` that fails rejects the awaited
14
- * effect, and resolves `undefined` for a `cosmetic` descriptor, as in the game. There is no
15
- * handler, no log, no fast mode and no abort signal here: for those, walk the graph with
16
- * `createHeadless`.
12
+ * `started`, `fx.emit(hint)` goes to `emitted`. `fx.cancel(promise)` resolves an awaited effect
13
+ * that has not settled `undefined` and returns `true`, and returns `false` for any other promise.
14
+ * `fx.start` refuses a descriptor with `answers` and a `guide` with the error the game throws. An
15
+ * `answer` that fails rejects the awaited effect, and resolves `undefined` for a `cosmetic`
16
+ * descriptor, as in the game. There is no handler, no log, no fast mode and no abort signal here:
17
+ * for those, walk the graph with `createHeadless`.
17
18
  *
18
19
  * @param options - The answer of an awaited effect, and the node path for the refusal message.
19
20
  * @returns The `fx` and the lists `awaited`, `started` and `emitted`.
@@ -44,22 +45,56 @@ function fakeFx(options = {}) {
44
45
  const awaited = [];
45
46
  const started = [];
46
47
  const emitted = [];
48
+ const open = /* @__PURE__ */ new Map();
47
49
  /**
48
- * Records one awaited effect and answers it. Both happen at the call. An `answer` that throws
49
- * or rejects is a handler that fails: the effect rejects, never the call. A `cosmetic`
50
- * descriptor swallows that failure and resolves `undefined`, as the gateway of the game does.
50
+ * Asks `options.answer` for one awaited effect. An `answer` that throws or rejects is a handler
51
+ * that fails: the effect rejects, never the call. A `cosmetic` descriptor swallows that failure
52
+ * and resolves `undefined`, as the gateway of the game does.
51
53
  *
52
54
  * @param descriptor - The descriptor the body awaits.
53
55
  * @returns A promise of what `options.answer` gives for it.
54
56
  */
55
- const run = async (descriptor) => {
56
- awaited.push(descriptor);
57
+ const answerOf = async (descriptor) => {
57
58
  try {
58
59
  return await options.answer?.(descriptor);
59
60
  } catch (error) {
60
61
  if (descriptor.cosmetic !== true) throw error;
61
62
  }
62
63
  };
64
+ /**
65
+ * Records one awaited effect and answers it. Both happen at the call. The effect stays open
66
+ * until it settles, or until `cancel` resolves it `undefined`.
67
+ *
68
+ * @param descriptor - The descriptor the body awaits.
69
+ * @returns A promise of what `options.answer` gives for it.
70
+ */
71
+ const run = (descriptor) => {
72
+ awaited.push(descriptor);
73
+ const answered = answerOf(descriptor);
74
+ const early = { end: () => void 0 };
75
+ const effect = new Promise((resolve, reject) => {
76
+ early.end = () => {
77
+ resolve(void 0);
78
+ };
79
+ answered.then(resolve, reject);
80
+ });
81
+ open.set(effect, early.end);
82
+ answered.then(() => open.delete(effect), () => open.delete(effect));
83
+ return effect;
84
+ };
85
+ /**
86
+ * Ends one open effect the fake returned: it resolves `undefined`.
87
+ *
88
+ * @param effect - A promise `run` returned.
89
+ * @returns True when the effect was open and is ended now.
90
+ */
91
+ const cancel = (effect) => {
92
+ const end = open.get(effect);
93
+ if (end === void 0) return false;
94
+ open.delete(effect);
95
+ end();
96
+ return true;
97
+ };
63
98
  const fx = Object.assign(run, {
64
99
  /**
65
100
  * Records one hint. Nothing releases it: the test has no edge to commit.
@@ -78,7 +113,8 @@ function fakeFx(options = {}) {
78
113
  start: (descriptor) => {
79
114
  refuseStart(descriptor, path);
80
115
  started.push(descriptor);
81
- }
116
+ },
117
+ cancel
82
118
  });
83
119
  return Object.freeze({
84
120
  fx,
@@ -1,5 +1,5 @@
1
- import { $r as Snapshot, Wr as Json } from "./types-C9L-dSRf.mjs";
2
- import { t as HeadlessApp } from "./headless-ABpROLSJ.mjs";
1
+ import { $r as Snapshot, Wr as Json } from "./types-DFmiN69h.mjs";
2
+ import { t as HeadlessApp } from "./headless-CayFBKSj.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
 
5
5
  //#region src/plugins/flow/doors/types.d.ts
@@ -1,4 +1,4 @@
1
- import { $n as ChangeHook, Ar as Api$2, D as AxisPose, Fr as Api$5, Jn as Hint, Q as Api$3, Qn as AnchorTarget, Wn as Descriptor, Wr as Json, Y as TransformValue, Zn as Answered, ar as NumericFields, bi as Require, br as Entity, cr as ReducedMotion, fr as ViewHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, kr as TagType, mn as Api$1, mr as AnyComponentType, nr as Motion, or as ProjectionMotion, pr as AnyComponent, rr as MotionCause, s as Events$1, t as Api$4, tr as Ease, tt as PixiContainer, ui as Api, vr as ComponentType, yt as ViewportSize } from "./types-C9L-dSRf.mjs";
1
+ import { $n as ChangeHook, Ar as Api$2, D as AxisPose, Fr as Api$5, Jn as Hint, Q as Api$3, Qn as AnchorTarget, Wn as Descriptor, Wr as Json, Y as TransformValue, Zn as Answered, ar as NumericFields, bi as Require, br as Entity, cr as ReducedMotion, fr as ViewHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, kr as TagType, mn as Api$1, mr as AnyComponentType, nr as Motion, or as ProjectionMotion, pr as AnyComponent, rr as MotionCause, s as Events$1, t as Api$4, tr as Ease, tt as PixiContainer, ui as Api, vr as ComponentType, yt as ViewportSize } from "./types-DFmiN69h.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,7 +1,7 @@
1
- import { $ as Config$2, Hr as Config, Ir as ClockSource, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Un as TypeTag, Wr as Json, Xr as ProviderCall, Yr as PlayerStateProvider, Zr as SaveDoc, _t as Orientation, a as Config$3, d as Manifest, ei as SnapshotOf, gn as Config$1, it as PixiModule, n as AssetsIo } from "./types-C9L-dSRf.mjs";
2
- import { o as AudioContextLike, s as Config$4 } from "./types-BZuWxDNn.mjs";
3
- import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-CbbpjAo1.mjs";
4
- import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-sltlACR5.mjs";
1
+ import { $ as Config$2, Hr as Config, Ir as ClockSource, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Un as TypeTag, Wr as Json, Xr as ProviderCall, Yr as PlayerStateProvider, Zr as SaveDoc, _t as Orientation, a as Config$3, d as Manifest, ei as SnapshotOf, gn as Config$1, it as PixiModule, n as AssetsIo } from "./types-DFmiN69h.mjs";
2
+ import { o as AudioContextLike, s as Config$4 } from "./types-fkR2U4dd.mjs";
3
+ import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-BbHpVeAD.mjs";
4
+ import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-DP9hZTrk.mjs";
5
5
  import { AnyPluginInstance } from "@moku-labs/core";
6
6
 
7
7
  //#region src/plugins/model/store/providers/memory.d.ts
@@ -5330,9 +5330,10 @@ type GuideOptions = {
5330
5330
  text?: string;
5331
5331
  };
5332
5332
  /**
5333
- * Handler of one effect kind, registered by a plugin above `flow`. `signal` is the node's abort
5334
- * signal, except for a descriptor with `answers` and for `guide`: those get a signal of their own,
5335
- * aborted when the answer arrives or the narrow is lifted, so the handler unmounts what it showed.
5333
+ * Handler of one effect kind, registered by a plugin above `flow`. `signal` is a signal that ends
5334
+ * with the node, or earlier on `fx.cancel` and, for a popup, at the body's return. A descriptor
5335
+ * with `answers` and a `guide` get a signal of their own, aborted as well when the answer arrives
5336
+ * or the narrow is lifted, so the handler unmounts what it showed.
5336
5337
  *
5337
5338
  * @example
5338
5339
  * ```ts
@@ -5446,7 +5447,9 @@ type FxApi = {
5446
5447
  /**
5447
5448
  * The `fx` of a node context, and of the context of `recover`. Three ways to reach what is not
5448
5449
  * logic: `await fx(descriptor)` runs an effect and waits for it, `fx.start(descriptor)` starts one
5449
- * now and does not wait, `fx.emit(hint)` keeps a cosmetic hint until the edge has committed. The
5450
+ * now and does not wait, `fx.emit(hint)` keeps a cosmetic hint until the edge has committed.
5451
+ * `fx.cancel(promise)` ends an awaited effect early, and the body's return closes the popups it
5452
+ * left open. The
5450
5453
  * awaited value is typed by the descriptor: what its helper or its `defineEffect` declared,
5451
5454
  * `unknown` for a descriptor written by hand.
5452
5455
  *
@@ -5498,6 +5501,35 @@ type NodeFx = (<Result>(descriptor: Descriptor<Result>) => Promise<Result>) & {
5498
5501
  * ```
5499
5502
  */
5500
5503
  start(descriptor: Descriptor): void;
5504
+ /**
5505
+ * Ends one awaited effect of this node early, without leaving the node. Its handler's signal is
5506
+ * aborted, so a popup unmounts; for a descriptor with `answers` the gate closes as well. The
5507
+ * promise then resolves `undefined`, also where the descriptor's result type has no `undefined`
5508
+ * in it: a body that cancels an effect does not read its value. The body's return closes the
5509
+ * popups it left open anyway; `cancel` is for an effect that has to go while the node goes on.
5510
+ *
5511
+ * @param effect - A promise this node's `fx(...)` returned.
5512
+ * @returns `true` when the effect was open and is ended now. `false` for an effect that settled
5513
+ * or was cancelled already, one of another node, a `guide`, any other promise, and for every
5514
+ * call after the node's abort: then nothing happens.
5515
+ * @example
5516
+ * ```ts
5517
+ * // The "wait" node: the popup Loading (outcome "back") stands while the board bundle loads.
5518
+ * run: async ({ fx, out }) => {
5519
+ * const shown = fx(popup(Loading, {}));
5520
+ * const back = shown.then(() => "back" as const);
5521
+ * const there = await Promise.race([back, fx(load("board")).then(() => "loaded" as const)]);
5522
+ *
5523
+ * if (there === "back") return out.back();
5524
+ *
5525
+ * fx.cancel(shown); // true: Loading unmounts, its gate closes, `shown` resolves undefined
5526
+ * await fx(popup(Tip, {})); // the next popup opens the gate for its own answers
5527
+ *
5528
+ * return out.ready();
5529
+ * }
5530
+ * ```
5531
+ */
5532
+ cancel(effect: Promise<unknown>): boolean;
5501
5533
  };
5502
5534
  /**
5503
5535
  * How an effect a game declares behaves; see `defineEffect`. `fast: "run"` runs its handler in a
@@ -5515,7 +5547,8 @@ type EffectOptions = {
5515
5547
  };
5516
5548
  /**
5517
5549
  * The handler of one declared effect: the typed payload in, the result out. The context is the
5518
- * gateway's: the node's abort signal and the mode of the walk.
5550
+ * gateway's: a signal that ends with the node, or earlier on `fx.cancel` and, for a popup, at the
5551
+ * body's return, and the mode of the walk.
5519
5552
  *
5520
5553
  * @example
5521
5554
  * ```ts
@@ -1,5 +1,5 @@
1
- import { A as FilterSlotInputs, Ar as Api$3, M as SyncApi, Q as Api$4, Qn as AnchorTarget, Un as TypeTag, Ur as Events$3, Vr as Api$6, Wn as Descriptor, Wr as Json, ar as NumericFields, at as PixiSprite, b as Events$4, bi as Require, br as Entity, bt as FilterCache, cr as ReducedMotion, dr as TrackSegment, gr as ComponentHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, j as FilterSlotQuad, k as FilterSlot, mn as Api$2, nt as PixiFilter, oi as Events$5, ot as PixiTexture, pr as AnyComponent, rt as PixiGpuProgram, s as Events$1, st as PixiUniformGroup, t as Api$5, tr as Ease, ui as Api$1, ur as TrackOptions, vr as ComponentType, vt as Point, yi as Events$2 } from "./types-C9L-dSRf.mjs";
2
- import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-CbbpjAo1.mjs";
1
+ import { A as FilterSlotInputs, Ar as Api$3, M as SyncApi, Q as Api$4, Qn as AnchorTarget, Un as TypeTag, Ur as Events$3, Vr as Api$6, Wn as Descriptor, Wr as Json, ar as NumericFields, at as PixiSprite, b as Events$4, bi as Require, br as Entity, bt as FilterCache, cr as ReducedMotion, dr as TrackSegment, gr as ComponentHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, j as FilterSlotQuad, k as FilterSlot, mn as Api$2, nt as PixiFilter, oi as Events$5, ot as PixiTexture, pr as AnyComponent, rt as PixiGpuProgram, s as Events$1, st as PixiUniformGroup, t as Api$5, tr as Ease, ui as Api$1, ur as TrackOptions, vr as ComponentType, vt as Point, yi as Events$2 } from "./types-DFmiN69h.mjs";
2
+ import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-BbHpVeAD.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
  import { PluginCtx } from "@moku-labs/core";
5
5
 
@@ -1,9 +1,9 @@
1
- import { Ar as Api$1, Fr as Api$4, Q as Api, Vr as Api$2, ii as Api$3 } from "./types-C9L-dSRf.mjs";
2
- import { W as AnimApi, r as UiApi } from "./types-BZuWxDNn.mjs";
3
- import { R as InputApi } from "./types-CbbpjAo1.mjs";
4
- import { r as Repro } from "./headless-ABpROLSJ.mjs";
5
- import { i as ControlApp, o as InputOf } from "./types-D9J6jJ6g.mjs";
6
- import { t as commands } from "./commands-DCBhp5aM.mjs";
1
+ import { Ar as Api$1, Fr as Api$4, Q as Api, Vr as Api$2, ii as Api$3 } from "./types-DFmiN69h.mjs";
2
+ import { W as AnimApi, r as UiApi } from "./types-fkR2U4dd.mjs";
3
+ import { R as InputApi } from "./types-BbHpVeAD.mjs";
4
+ import { r as Repro } from "./headless-CayFBKSj.mjs";
5
+ import { i as ControlApp, o as InputOf } from "./types-BMhuZtOK.mjs";
6
+ import { t as commands } from "./commands-Rk3il_Pn.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-BmR3GBMY.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-CrXEquz3.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/llms.txt CHANGED
@@ -44,6 +44,7 @@ Root exports:
44
44
  - A pure wait ends in two ways. A gate answer whose `intent` is an outcome name: the answer payload becomes the outcome payload. Or a world event whose `type` is listed in the node's `inbox`: the event payload becomes the outcome payload.
45
45
  - Transition: rest node to rest node. It is a transaction. On an error the runner discards, rolls back to the last rest point, retries `retries` times, then enters `safeNode`. A failure inside `safeNode` rejects `run()`.
46
46
  - Three ways to run an effect in a node. `await fx(descriptor)`: the node waits for it. `fx.start(descriptor)`: it starts now and the node goes on; write it in place of `void fx(...)`. A failure of a started effect is the log entry `flow:fx-start-failed` and never fails the node. A `cosmetic` descriptor (`sfx`, `play`, `haptic`, `music`) that fails, awaited or started, is the warn entry `flow:fx-cosmetic-failed` with `{ kind, message }` and resolves `undefined`; a descriptor with `answers` and a `guide` are refused, they have to be awaited. `fx.emit(hint(...))`: released after the commit of the edge, dropped in fast mode.
47
+ - A body's return closes the popups it left open. A body may show a popup without awaiting it (`const shown = fx(popup(Loading, {}))`, raced against a load) and return an outcome: when it returns, with an outcome or a failure, each popup still open is closed in the order it was shown, its handler's signal aborted (the popup unmounts) and the gate shut, so the next rest opens its own gate. The same holds for `recover`. Other awaited effects nobody waited for run on. A body the inbox, a restore or a stop already left closes nothing when it returns late. `fx.cancel(promise)` ends one awaited effect early while the node stays: for an open effect of this node it aborts the handler's signal, shuts the gate when the descriptor has `answers`, resolves the promise `undefined` (whatever the descriptor's type says) and returns `true`; for a settled or cancelled effect, a `guide`, another node's effect, any other promise, or after the node's abort it does nothing and returns `false`. Pass the promise `fx(...)` returned, not one built from it with `.then`. So `fx.cancel(shown); await fx(popup(Tip, {}))` opens the next popup in the same node.
47
48
  - `await fx(descriptor)` is typed by the descriptor (`Flow.Descriptor<Result>`): `schedule`, `guide`, `music`, `sfx`, `haptic`, `play` resolve `void`; `load` resolves `Assets.LoadResult | undefined` (`undefined` without `assets`, as in `game.headless()`); `ready` resolves `boolean | undefined` (`true` when every bundle is loaded and on the GPU, `undefined` without `assets`, so compare `=== false`); `popup(Component, props)` resolves `Flow.Answered<outcome names>`, `{ intent, payload?, at }` with `at` the `clock.now()` moment the answer arrived (live and in a fast walk alike), so comparing it with an intent the component does not declare is a compile error; a descriptor written by hand resolves `unknown`. A game declares its own: `const envRead = defineEffect<{ notice: boolean }, EnvRead>("view-env.read", { fast: "run" })`, then `await fx(envRead({ notice: true }))` is `EnvRead` and `envRead.handle(ctx.require(flowPlugin).fx, payload => ...)` registers the one handler (returns the remover). Only `{ fast: "run" }` without `cosmetic` resolves `Result`; any other declaration resolves `Result | undefined`. `NodeFx` is generic: a hand-written fake is typed `as NodeFx`, or use `fakeFx`.
48
49
  - Every failure is written into the log by the engine: an `error` entry `flow:error` with `{ path, rolledBackTo, retry, error: { message, stack } }`. Read it with `app.log.trace()`. A game needs no plugin for it.
49
50
  - `recover` on a rest node: `recover: async ({ player, session, rng, fx, signal, now }) => { ... }`. It runs only when the runner gave up on a transition and enters this node as `safeNode`, before the node is entered. The rollback left the state of the failed rest point; `recover` writes the drafts so the safe node can draw itself. What it wrote commits as one edge with `outcome: "recover"` and becomes the rest point. A `recover` that throws rejects `run()`. A retry does not run it. So the safe node stays a pure wait: no `run` body, no extra outcome, no self edge.
@@ -138,7 +139,7 @@ type NodeContext = {
138
139
  player: Player; // draft of the saved player tree, mutate it
139
140
  session: Session; // draft of the session tree, never saved
140
141
  rng: RngView; // rng.stream(id) gives a deterministic stream
141
- fx: NodeFx; // await fx(descriptor), fx.start(descriptor), fx.emit(hint(...))
142
+ fx: NodeFx; // await fx(descriptor), fx.start(descriptor), fx.emit(hint(...)), fx.cancel(promise)
142
143
  out: Out; // one method per declared outcome
143
144
  signal: AbortSignal; // aborted on stop, restore and inbox delivery
144
145
  now: number; // clock.now() read once at node entry
@@ -763,7 +764,7 @@ The scanner keys it `ui.font-body`, which is the `text` config default `fonts.bo
763
764
 
764
765
  ## Testing entry
765
766
 
766
- Exports of `@moku-labs/game/testing`: `createHeadless`, `runRepro`, `stepFrames`, `fakeClock`, `memory`, `saveOf`, `isolate`, `stub`, `fakeFx`. `fakeFx(options?)` is the `fx` of a node context for a unit test that calls `node.run?.({ ...context, fx: fake.fx })`: it returns `{ fx, awaited, started, emitted }`, `options.answer(descriptor)` gives what an awaited effect resolves with, and `fx.start` refuses `answers` and a `guide` as the game does. The visual tests `defineVisualTest`, `runVisualTests`, `parseVisualArgv` come from `@moku-labs/game/visual`, node and bun only (see `docs/testing.md` in the engine repository).
767
+ Exports of `@moku-labs/game/testing`: `createHeadless`, `runRepro`, `stepFrames`, `fakeClock`, `memory`, `saveOf`, `isolate`, `stub`, `fakeFx`. `fakeFx(options?)` is the `fx` of a node context for a unit test that calls `node.run?.({ ...context, fx: fake.fx })`: it returns `{ fx, awaited, started, emitted }`, `options.answer(descriptor)` gives what an awaited effect resolves with, `fx.cancel(promise)` resolves an effect it returned that has not settled `undefined` and returns `true` (`false` for any other promise), and `fx.start` refuses `answers` and a `guide` as the game does. The visual tests `defineVisualTest`, `runVisualTests`, `parseVisualArgv` come from `@moku-labs/game/visual`, node and bun only (see `docs/testing.md` in the engine repository).
767
768
 
768
769
  - `createHeadless(app): Promise<HeadlessGame>`. Pass an app that is not started. It sets mode `"fast"`, awaits `app.start()`, starts `flow.run()` unless the app's `onStart` already did, and resolves when the loop rests for the first time: `game.state().path` already names the first rest node. A fatal error of `run()` rejects the call.
769
770
  - `HeadlessGame`: `walk(route): Promise<FlowState>`, `answer(answer): boolean`, `state()`, `history()`, `stop()`. `walk` and `stop` throw a fatal error of the loop again when the headless runner owns `run()`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/game",
3
- "version": "0.15.148",
3
+ "version": "0.15.149",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [