@moku-labs/game 0.15.84 → 0.15.86

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 (32) hide show
  1. package/README.md +2 -1
  2. package/dist/app/page.d.mts +1 -1
  3. package/dist/app/page.mjs +1 -1
  4. package/dist/app/system.d.mts +3 -3
  5. package/dist/app.d.mts +4 -4
  6. package/dist/app.mjs +1 -1
  7. package/dist/assets.d.mts +1 -1
  8. package/dist/cli.mjs +519 -185
  9. package/dist/{commands-DKjkHK5b.d.mts → commands-CeBF2nRY.d.mts} +5 -5
  10. package/dist/{config-HpC-p8Ow.mjs → config-Cn1VZ-tx.mjs} +77 -4
  11. package/dist/control.d.mts +4 -4
  12. package/dist/{define-DcB9KOfh.d.mts → define-N-2nQNK_.d.mts} +2 -2
  13. package/dist/{headless-B8JIqsZk.d.mts → headless-DtDdn5gg.d.mts} +1 -1
  14. package/dist/{index-DTHVVLFB.d.mts → index-Bn0pFiae.d.mts} +3 -3
  15. package/dist/index.d.mts +4 -4
  16. package/dist/index.mjs +1 -1
  17. package/dist/inspect.d.mts +6 -6
  18. package/dist/jsx-dev-runtime.d.mts +1 -1
  19. package/dist/jsx-runtime.d.mts +1 -1
  20. package/dist/{runtime-B3CsJr_p.d.mts → runtime-DOvgFNLH.d.mts} +1 -1
  21. package/dist/{src-D1J2QlGK.mjs → src-BFa-zMmW.mjs} +1132 -89
  22. package/dist/testing.d.mts +4 -4
  23. package/dist/testing.mjs +1 -1
  24. package/dist/{types-DJCC9CAp.d.mts → types-C5gLBKbm.d.mts} +16 -6
  25. package/dist/{types-DfHytzox.d.mts → types-CbVXXqPs.d.mts} +130 -16
  26. package/dist/{types-D-5dwalj.d.mts → types-CyPbo757.d.mts} +45 -7
  27. package/dist/{types-DsRV-ph1.d.mts → types-DNWWlVky.d.mts} +2 -2
  28. package/dist/{types-CPWi_CLI.d.mts → types-OBpR0u05.d.mts} +1 -1
  29. package/dist/{visual-B76IxxTL.d.mts → visual-Di8ecxYD.d.mts} +6 -6
  30. package/dist/visual.d.mts +1 -1
  31. package/llms.txt +3 -2
  32. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
- import { Bn as Hint, Dr as ClockSource, En as AnyFlow, Fr as Json, In as Descriptor, Mn as NodeTable, Vn as NodeFx, kr as FakeClock, wn as FeaturePlugin } from "./types-DfHytzox.mjs";
2
- import { t as createApp } from "./index-DTHVVLFB.mjs";
3
- import { b as saveOf, v as WithGameState, y as memory } from "./types-D-5dwalj.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-B8JIqsZk.mjs";
1
+ import { Ar as ClockSource, Dn as FeaturePlugin, Fn as NodeTable, Mr as FakeClock, Rr as Json, Un as Hint, Wn as NodeFx, kn as AnyFlow, zn as Descriptor } from "./types-CbVXXqPs.mjs";
2
+ import { t as createApp } from "./index-Bn0pFiae.mjs";
3
+ import { b as memory, x as saveOf, y as WithGameState } from "./types-CyPbo757.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-DtDdn5gg.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 { m as flattenFeatures, on as type, rn as exit, t as createApp, tn as refuseStart } from "./src-D1J2QlGK.mjs";
1
+ import { m as flattenFeatures, on as type, rn as exit, t as createApp, tn as refuseStart } from "./src-BFa-zMmW.mjs";
2
2
  import { n as saveOf, t as memory } from "./memory-CWlqhS7l.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,5 +1,5 @@
1
- import { $ as PixiFilter, $n as ReducedMotion, A as SyncApi, Fn as TypeTag, Fr as Json, In as Descriptor, Kn as Ease, Mr as Api$6, O as FilterSlot, Pr as Events$3, Un as AnchorTarget, X as Api$4, Xn as NumericFields, Yn as MotionHandle, Zr as Events$5, b as Events$4, di as Require, dr as Entity, dt as Point, et as PixiModule, ir as AnyComponent, k as FilterSlotInputs, lr as ComponentType, nr as TrackSegment, nt as PixiTexture, or as AnyComponentValue, pt as FilterCache, s as Events$1, sn as Api$2, sr as ComponentHandle, t as Api$5, ti as Api$1, tr as TrackOptions, tt as PixiSprite, ui as Events$2, xr as Api$3 } from "./types-DfHytzox.mjs";
2
- import { N as InputApi, R as I18nApi, X as StylesState, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, w as TextApi } from "./types-CPWi_CLI.mjs";
1
+ import { $n as NumericFields, A as FilterSlotQuad, Fr as Api$6, Kn as AnchorTarget, Lr as Events$3, O as FilterSlot, Qn as MotionHandle, Rn as TypeTag, Rr as Json, Yn as Ease, Z as Api$4, ar as TrackSegment, at as PixiUniformGroup, b as Events$4, ei as Events$5, et as PixiFilter, fr as ComponentType, gt as FilterCache, ii as Api$1, ir as TrackOptions, it as PixiTexture, j as SyncApi, k as FilterSlotInputs, lr as AnyComponentValue, mi as Require, mr as Entity, mt as Point, nr as ReducedMotion, nt as PixiModule, pi as Events$2, rt as PixiSprite, s as Events$1, sr as AnyComponent, t as Api$5, tt as PixiGpuProgram, un as Api$2, ur as ComponentHandle, wr as Api$3, zn as Descriptor } from "./types-CbVXXqPs.mjs";
2
+ import { N as InputApi, R as I18nApi, X as StylesState, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, w as TextApi } from "./types-OBpR0u05.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
  import { PluginCtx } from "@moku-labs/core";
5
5
 
@@ -1537,6 +1537,11 @@ type FilterDefinition = {
1537
1537
  readonly id: string; /** The assembled WGSL: the engine's header, the uniform struct, the input bindings, the body. */
1538
1538
  readonly source: string; /** The assembled GLSL ES 3.0: the engine's header, one `uniform` per uniform, the inputs, the body. */
1539
1539
  readonly glsl: string;
1540
+ /**
1541
+ * The quad program: the same body on a mesh, in the pass that draws the canvas (renderer README, "Kept pictures").
1542
+ * `undefined` for a definition with inputs, a backdrop, or a body the rewrite does not fit.
1543
+ */
1544
+ readonly quadSource: string | undefined;
1540
1545
  readonly uniforms: readonly UniformSpec[];
1541
1546
  readonly passes: number;
1542
1547
  readonly padding: number | string; /** The second textures the body reads, in declaration order; empty for a filter with none. */
@@ -1851,7 +1856,7 @@ type UniformValues = Record<string, number | Float32Array>;
1851
1856
  /**
1852
1857
  * The uniform group of one of our filter instances, as the instance writes it.
1853
1858
  */
1854
- type FilterUniforms = {
1859
+ type FilterUniforms = PixiUniformGroup & {
1855
1860
  readonly uniforms: UniformValues;
1856
1861
  };
1857
1862
  /**
@@ -1868,7 +1873,8 @@ type FilterBody = {
1868
1873
  inputs: InputsState | undefined; /** The dev mark drawn after the fallback by a stand-in (E5.4); `undefined` otherwise. */
1869
1874
  readonly mark: OursBody | undefined; /** The definition's last area answer, filled in place; `some: false` for `undefined` (B4). */
1870
1875
  readonly area: AreaBox; /** The value changed since the area was last asked: the next sync asks the definition again. */
1871
- areaStale: boolean;
1876
+ areaStale: boolean; /** What the slot hands over for the quad, made once: the renderer compares it by identity. */
1877
+ quad: FilterSlotQuad | undefined;
1872
1878
  } | {
1873
1879
  readonly kind: "blur";
1874
1880
  readonly filter: InstanceType<PixiModule["BlurFilter"]>; /** The fields the setters were last given; compared before a write. */
@@ -1908,10 +1914,12 @@ type FilterBody = {
1908
1914
  calm: number;
1909
1915
  };
1910
1916
  /**
1911
- * A probe of the warm-up (spec 27 F4): the Pixi filter handed to `renderer.sync.filters.warm`, and its teardown.
1917
+ * A probe of the warm-up (spec 27 F4): the Pixi filter handed to `renderer.sync.filters.warm`, the quad of a kind whose
1918
+ * body can run on one, and its teardown.
1912
1919
  */
1913
1920
  type WarmProbe = {
1914
1921
  readonly filter: PixiFilter;
1922
+ readonly quad: FilterSlotQuad | undefined;
1915
1923
  destroy(): void;
1916
1924
  };
1917
1925
  /**
@@ -1988,7 +1996,9 @@ type InputsState = {
1988
1996
  type CheckState = {
1989
1997
  /** Bumped by `stopEffects`: an answer of an earlier run is ignored. */run: number; /** The checks were started on the running backend. */
1990
1998
  started: boolean; /** Where each definition stands. */
1991
- status: WeakMap<FilterDefinition, "pending" | "ok" | "broken">; /** Definitions still pending. */
1999
+ status: WeakMap<FilterDefinition, "pending" | "ok" | "broken">; /** The definitions whose quad text compiled clean on this run's device: only they hand a quad over. */
2000
+ quads: WeakSet<FilterDefinition>; /** The program of each of them, built at the first ask: `GpuProgram.from` keys the whole source on every call. */
2001
+ programs: WeakMap<FilterDefinition, PixiGpuProgram>; /** Definitions still pending. */
1992
2002
  waiting: number; /** Definitions started, for the `effects:checks` line. */
1993
2003
  checked: number; /** Definitions that failed, for the `effects:checks` line. */
1994
2004
  failed: number; /** GLSL compiles in flight under `KHR_parallel_shader_compile`. */
@@ -8725,6 +8725,17 @@ type HostInternal = {
8725
8725
  onCanvasPass(fn: CanvasPassListener): void;
8726
8726
  };
8727
8727
  //#endregion
8728
+ //#region src/plugins/renderer/quad.d.ts
8729
+ /** The six vectors of the group, under the names Pixi's filter system fills. */
8730
+ type FilterGlobals = {
8731
+ uInputSize: Float32Array;
8732
+ uInputPixel: Float32Array;
8733
+ uInputClamp: Float32Array;
8734
+ uOutputFrame: Float32Array;
8735
+ uGlobalFrame: Float32Array;
8736
+ uOutputTexture: Float32Array;
8737
+ };
8738
+ //#endregion
8728
8739
  //#region src/plugins/renderer/kept/types.d.ts
8729
8740
  /**
8730
8741
  * What a slot's filter lets the cache do with it: `"local"` (kept anywhere), `"placed"` (kept with its canvas origin
@@ -8845,6 +8856,24 @@ type KeptInternal = {
8845
8856
  };
8846
8857
  /** The two lives of a record. */
8847
8858
  type KeptMode = "live" | "kept";
8859
+ /** What draws a kept picture beside its top: a sprite of the picture, or the mesh of a shaded record. */
8860
+ type KeptQuad = PixiSprite | PixiMesh;
8861
+ /**
8862
+ * What a shaded record draws through (F126 stage 2): made at its first entry and kept while the record lives, so an entry
8863
+ * after that makes nothing. While the record is not shaded the shader binds no texture of the record.
8864
+ */
8865
+ type KeptShade = {
8866
+ /** Runs the filter's program over the padded picture, on the state's unit quad; destroyed with the record. */mesh: PixiMesh; /** The program of `quad` and what it binds: `gfu`, the padded picture, its sampler, and `quad.fu` when there is one. */
8867
+ shader: PixiShader; /** The global filter uniforms a filter pass would hand the body; static, uploaded only when a value changed. */
8868
+ readonly gfu: PixiUniformGroup; /** The arrays `gfu` reads, typed. */
8869
+ readonly vectors: FilterGlobals; /** The sprite of the record's picture, out of the tree while the mesh draws. */
8870
+ sprite: PixiSprite; /** The slot's quad the shader was built from. */
8871
+ quad: FilterSlotQuad; /** The texture source the shader binds. */
8872
+ source: PixiTextureSource; /** The `s1Version` the padded picture in `s3` was copied from; -1 when `s3` holds no copy. */
8873
+ copied: number; /** The device width of that copy: resizing `s3` in place blanks it without moving `s1Version`. */
8874
+ copiedWidth: number; /** The device height of that copy. */
8875
+ copiedHeight: number;
8876
+ };
8848
8877
  /** One filtered view the cache watches. */
8849
8878
  type KeptRecord = {
8850
8879
  readonly entity: Entity; /** The view's top (`view.wrapper ?? view.object`) when the record was made; another top resets the record. */
@@ -8854,8 +8883,13 @@ type KeptRecord = {
8854
8883
  slots: readonly FilterSlot[]; /** "local" or "placed": the worst category of the enabled slots; a "screen" slot makes no record (P4.1). */
8855
8884
  category: "local" | "placed"; /** Sprite(stage 1): carries the filters while kept (P3.3). */
8856
8885
  standIn: PixiSprite | undefined; /** A second Sprite(stage 1) whose filters are [keeper] only (P3.2). */
8857
- keeperStandIn: PixiSprite | undefined; /** Sprite(stage 3), in the tree beside the top. */
8858
- quad: PixiSprite | undefined; /** The filter that runs stage 2 (P3.4). */
8886
+ keeperStandIn: PixiSprite | undefined; /** Sprite(stage 3), in the tree beside the top; the mesh of `shade` while the record is shaded. */
8887
+ quad: KeptQuad | undefined; /** What the record draws through while shaded; made at its first entry, kept while the record lives. */
8888
+ shade: KeptShade | undefined; /** The record draws through the mesh: `s3` holds the padded picture, not a filter output. */
8889
+ shaded: boolean; /** Drawn frames that owed stage 3 alone, without a gap of `CALM_AFTER` frames. */
8890
+ outputRuns: number; /** The `KeptState.frame` of the last of them. */
8891
+ outputAt: number; /** The `KeptState.frame` of the last shaded change. */
8892
+ shadedAt: number; /** The filter that runs stage 2 (P3.4). */
8859
8893
  keeper: PixiFilter | undefined;
8860
8894
  s1: PixiRenderTexture | undefined; /** One per input of the first enabled filter with inputs, else []. */
8861
8895
  s2: PixiRenderTexture[];
@@ -8886,7 +8920,8 @@ type KeptRecord = {
8886
8920
  * (P4.3), and the step must run also in a calm frame.
8887
8921
  */
8888
8922
  coarse: boolean; /** This step's change of the record was a refining take and nothing else: read by `dirtyAbove`, cleared with the dirty flags. */
8889
- refined: boolean; /** Bytes a refused take asked for; the record is not offered again until they fit (P6.3). */
8923
+ refined: boolean; /** This step changed what the mesh draws without a pass: read by `drawingChanged`, cleared with the dirty flags. */
8924
+ redrawn: boolean; /** Bytes a refused take asked for; the record is not offered again until they fit (P6.3). */
8890
8925
  refused: number;
8891
8926
  /**
8892
8927
  * The picture was cut to the canvas at its take (F53): a move or another canvas size would show what it left out,
@@ -8952,7 +8987,9 @@ type KeptState = {
8952
8987
  byEntity: Map<Entity, KeptRecord>;
8953
8988
  byTop: Map<PixiContainer, KeptRecord>;
8954
8989
  ranges: Map<Entity, RangeRecord>; /** A canvas-sized texture a released range left, reused by the next take of the same size (LRU-evictable, P6). */
8955
- spare: PixiRenderTexture | undefined;
8990
+ spare: PixiRenderTexture | undefined; /** The one unit quad every mesh of the run draws on: 3 GPU buffers, not 3 per view. Made on demand. */
8991
+ quadGeometry: PixiMeshGeometry | undefined; /** The one sprite that copies every padded picture, its texture set before the render. Made on demand. */
8992
+ quadCopy: PixiSprite | undefined;
8956
8993
  /**
8957
8994
  * The textures of records whose views left, reused by the next take of the same size (F119); counted in `bytes`,
8958
8995
  * destroyed first when a take needs room.
@@ -10082,7 +10119,7 @@ type PictureRequest = {
10082
10119
  reject: (error: Error) => void;
10083
10120
  };
10084
10121
  declare namespace types_d_exports$2 {
10085
- export { AdaptiveScale, Api$1 as Api, AspectRange, BitmapFontData, CanvasRestart, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LeaveApi, LeaveCover, LeaveLoader, LeaveLook, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorCounts, MonitorDeps, MonitorInternal, MonitorModule, MonitorSections, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfCounts, PerfDisplay, PerfEventLine, PerfEventName, PerfGapLine, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfTelemetryLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGraphics, PixiMatrix, PixiMesh, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderTexture, PixiSprite, PixiTexture, PixiTextureSource, Point, PoolTrim, PoolTrimDetail, ProblemEventDetail, ProblemRule, Rect, RenderStats, RendererCtx, RendererKind, RetakeWhy, SafeArea, ShaderEventDetail, ShaderWhat, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail, WhyEntry, WhyLive };
10122
+ export { AdaptiveScale, Api$1 as Api, AspectRange, BitmapFontData, CanvasRestart, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FilterSlotQuad, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LeaveApi, LeaveCover, LeaveLoader, LeaveLook, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorCounts, MonitorDeps, MonitorInternal, MonitorModule, MonitorSections, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfCounts, PerfDisplay, PerfEventLine, PerfEventName, PerfGapLine, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfTelemetryLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGpuProgram, PixiGraphics, PixiMatrix, PixiMesh, PixiMeshGeometry, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderTexture, PixiShader, PixiSprite, PixiTexture, PixiTextureSource, PixiUniformGroup, Point, PoolTrim, PoolTrimDetail, ProblemEventDetail, ProblemRule, Rect, RenderStats, RendererCtx, RendererKind, RetakeWhy, SafeArea, ShaderEventDetail, ShaderWhat, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail, WhyEntry, WhyLive };
10086
10123
  }
10087
10124
  /**
10088
10125
  * The part of Pixi the engine uses: the classes `sync` builds views from (a `Rectangle` frames the
@@ -10139,6 +10176,22 @@ type PixiNineSliceSprite = InstanceType<PixiModule["NineSliceSprite"]>;
10139
10176
  * A Pixi mesh: what the rim-only nine-slice of a `NineSlice` with `hollow: true` is drawn with.
10140
10177
  */
10141
10178
  type PixiMesh = InstanceType<PixiModule["Mesh"]>;
10179
+ /**
10180
+ * A Pixi GPU program: the WebGPU half of a shader. `effects` builds the one a filter's body runs on its quad.
10181
+ */
10182
+ type PixiGpuProgram = InstanceType<PixiModule["GpuProgram"]>;
10183
+ /**
10184
+ * A Pixi uniform group: what a shader binds its numbers from.
10185
+ */
10186
+ type PixiUniformGroup = InstanceType<PixiModule["UniformGroup"]>;
10187
+ /**
10188
+ * The geometry of a Pixi mesh: every shaded view of the kept cache draws through one unit quad of it.
10189
+ */
10190
+ type PixiMeshGeometry = InstanceType<PixiModule["MeshGeometry"]>;
10191
+ /**
10192
+ * A Pixi shader: a program and what it binds, on a mesh. A shaded view of the kept cache holds one.
10193
+ */
10194
+ type PixiShader = InstanceType<PixiModule["Shader"]>;
10142
10195
  /**
10143
10196
  * A Pixi graphics object: what a `Shape` component is drawn with, and what clips its children.
10144
10197
  */
@@ -11376,7 +11429,25 @@ type FilterSlot = {
11376
11429
  * The filter shows a blurred copy of what is under it (the built-in `Blur`, a filter with inputs); an overlay over
11377
11430
  * it holds the loops under it (spec 22).
11378
11431
  */
11379
- blurs?: boolean;
11432
+ blurs?: boolean; /** The filter's own body as a program for its quad, for a kept view whose numbers change; filled by effects. */
11433
+ quad?: FilterSlotQuad;
11434
+ };
11435
+ /**
11436
+ * What the kept cache needs to draw a filter's own body on its quad; effects fills it, a game's own slot leaves it out.
11437
+ * The renderer holds no WGSL: it gets the built program and binds its own global filter uniforms and texture beside `fu`.
11438
+ * The object stands for the instance's life, so a list handed over again does not build a shader again.
11439
+ *
11440
+ * @example
11441
+ * ```ts
11442
+ * // `effects` hands a Tint on a kept row: 8 rows of the kind share the program, each binds its own numbers.
11443
+ * const quad: FilterSlotQuad = { program: tintProgram, fu: tintOfRow.group };
11444
+ * ctx.require(rendererPlugin).sync.filters.set(row, [{ filter: tintOfRow.filter, passes: 1, cache: "local", quad }]);
11445
+ * quad.program.vertex?.entryPoint; // "mainVertex"
11446
+ * ```
11447
+ */
11448
+ type FilterSlotQuad = {
11449
+ /** The filter's body behind Pixi's mesh groups; `GpuProgram.from` of the text effects assembles and checks. */readonly program: PixiGpuProgram; /** The uniform group of the filter's instance; `undefined` for a filter that binds none. */
11450
+ readonly fu: PixiUniformGroup | undefined;
11380
11451
  };
11381
11452
  /**
11382
11453
  * The stages of a filter's inputs and the seam of the kept-picture cache, on the filter's slot. `effects` fills it;
@@ -11510,18 +11581,27 @@ type FiltersApi = {
11510
11581
  * frame. Answers `true` once every draw was made, `false` at once when there is nothing to warm (no device, a headless
11511
11582
  * app, `warm: 0`), and `false` when the renderer stops first or a probe's render threw, which ends the warm-up of the
11512
11583
  * application (`renderer:warm-failed`). A filter handed over again on the same device answers `true` at once when its
11513
- * draws were made. The renderer never destroys the filter.
11584
+ * draws were made. The renderer never destroys the filter. On WebGPU a `quad` asks for the pipelines of the filter's body
11585
+ * on its mesh too, once, after the filter, so a kept view that later draws through it compiles
11586
+ * nothing in play; each of those draws runs in an error scope, and a program that does not fit logs
11587
+ * `renderer:warm-invalid` while the warm-up goes on. WebGL ignores it.
11514
11588
  *
11515
11589
  * @param filter - A filter the caller built and keeps alive while it waits.
11590
+ * @param quad - The filter's quad, for a kind whose body can run on one; `effects` leaves it out for a stage or a
11591
+ * fallback, and for a body the mesh cannot carry.
11516
11592
  * @returns Whether the filter's pipelines were created.
11517
11593
  * @example
11518
11594
  * ```ts
11519
11595
  * // `effects`, during the splash: a probe of the Frost's body, before the shop is ever opened.
11520
11596
  * const renderer = ctx.require(rendererPlugin);
11521
- * const warmed = await renderer.sync.filters.warm(frostProbe.filter); // true four drawn frames later (WebGPU, warm: 1)
11597
+ * // Four drawn frames later on WebGPU at `warm: 1` with a cleared canvas:
11598
+ * const warmed = await renderer.sync.filters.warm(frostProbe.filter); // true
11599
+ *
11600
+ * // A Tint's probe, whose body can also run on a kept view's quad: its pipelines are made with the filter's.
11601
+ * await renderer.sync.filters.warm(tintProbe.filter, tintProbe.quad); // true, one drawn frame after those four
11522
11602
  * ```
11523
11603
  */
11524
- warm(filter: PixiFilter): Promise<boolean>;
11604
+ warm(filter: PixiFilter, quad?: FilterSlotQuad): Promise<boolean>;
11525
11605
  };
11526
11606
  /**
11527
11607
  * The debug switches of the renderer: the nine-slice outline, the pixel check of skipped frames, the kept pictures and
@@ -11541,7 +11621,8 @@ type DebugSwitches = {
11541
11621
  /**
11542
11622
  * One view of `sync.debug.why()`: the label the monitor names its view by; how it is drawn (`"direct"` is a stack of
11543
11623
  * `AlphaFilter`s drawn by its quad, F54); why it is live, `null` when it is not; the still frames left before a take, 0
11544
- * when it waits for none; and the last take in the last full second, with the view whose mark caused it.
11624
+ * when it waits for none; the last take in the last full second, with the view whose mark caused it; and `quad` on a
11625
+ * kept view that runs on its filter's own shader.
11545
11626
  *
11546
11627
  * @example
11547
11628
  * ```ts
@@ -11564,6 +11645,19 @@ type WhyEntry = {
11564
11645
  why: RetakeWhy;
11565
11646
  by: string | null;
11566
11647
  } | null;
11648
+ /**
11649
+ * Present on a kept view drawn through its filter's own shader: its numbers change, and a change costs no pass.
11650
+ * The field is absent on every other view, a kept sprite included.
11651
+ *
11652
+ * @example
11653
+ * ```ts
11654
+ * // A lens whose angle a tween writes every frame: from its third write on, it runs on the canvas pass.
11655
+ * app.renderer.sync.debug.why()[0];
11656
+ * // { view: "Shape#1048590 shop:lens", mode: "kept", reason: null, calmIn: 0, retake: { why: "filter", by: null }, quad: true }
11657
+ * // A full second on: no take is left in the last one, `retake` is null and `quad` stays true.
11658
+ * ```
11659
+ */
11660
+ quad?: true;
11567
11661
  };
11568
11662
  /**
11569
11663
  * The debug drawing of the renderer, `app.renderer.sync.debug`. The switch outlines every
@@ -12218,10 +12312,18 @@ type AreaEntry = {
12218
12312
  };
12219
12313
  /**
12220
12314
  * What one probe draw of the warm-up draws: a content subject of the renderer (the batch pipeline of sprites, with the
12221
- * normal, the add and the screen blend, the graphics pipe's own, particles with either blend, distance-field text), or
12222
- * a filter handed to `filters.warm`.
12315
+ * normal, the add and the screen blend, the graphics pipe's own, particles with either blend, distance-field text), a
12316
+ * filter handed to `filters.warm`, or its body on its quad.
12317
+ */
12318
+ type WarmSubject = "sprite" | "sprite-add" | "sprite-screen" | "graphics" | "particles-normal" | "particles-add" | "text" | PixiFilter | WarmQuad;
12319
+ /**
12320
+ * A filter's body on its quad, as a probe of the warm-up draws it: on WebGPU, once, after the filter, in the first of
12321
+ * the device's variants, so a kept view's first frame on its shader compiles nothing.
12223
12322
  */
12224
- type WarmSubject = "sprite" | "sprite-add" | "sprite-screen" | "graphics" | "particles-normal" | "particles-add" | "text" | PixiFilter;
12323
+ type WarmQuad = {
12324
+ readonly filter: PixiFilter;
12325
+ readonly quad: FilterSlotQuad;
12326
+ };
12225
12327
  /**
12226
12328
  * Where a probe draws: straight onto the canvas, or into a texture under a filter of the module's own, each with or
12227
12329
  * without a stencil clip. A WebGPU pipeline is keyed by all four.
@@ -12258,7 +12360,18 @@ type WarmObjects = {
12258
12360
  graphics: PixiGraphics;
12259
12361
  particlesNormal: PixiContainer;
12260
12362
  particlesAdd: PixiContainer; /** A `BitmapText` of "0" in `WarmState.textFont`; made at its first draw. */
12261
- text: PixiContainer | undefined;
12363
+ text: PixiContainer | undefined; /** The mesh a quad subject draws on; made at its first draw. */
12364
+ quad: WarmMesh | undefined;
12365
+ };
12366
+ /**
12367
+ * What a quad subject draws on. The module's own geometry, with the attributes of `kept`'s: a pipeline is keyed by the
12368
+ * layout, so it hits the same pipeline, and a probe over `kept`'s geometry would throw after a lost device.
12369
+ */
12370
+ type WarmMesh = {
12371
+ mesh: PixiMesh;
12372
+ geometry: PixiMeshGeometry; /** The global filter uniforms of the probes: nothing reads what they draw. */
12373
+ gfu: PixiUniformGroup; /** The shader of the draw being made; destroyed with its draw. */
12374
+ shader: PixiShader | undefined;
12262
12375
  };
12263
12376
  /**
12264
12377
  * The pipeline warm-up (F4): the queue of probe draws, the filters handed over and the promises waiting on them, the
@@ -12267,7 +12380,8 @@ type WarmObjects = {
12267
12380
  type WarmState = {
12268
12381
  /** The draws not yet drawn, from `head` on; emptied when the head reaches the end. */queue: WarmDraw[];
12269
12382
  head: number; /** Every filter handed over on any device: queued again after a restore. */
12270
- filters: Set<PixiFilter>; /** The filters whose draws are not all made yet: the draws left, and the promises to answer. */
12383
+ filters: Set<PixiFilter>; /** The quad a filter was handed over with: queued with it, on WebGPU. */
12384
+ quads: Map<PixiFilter, FilterSlotQuad>; /** The filters whose draws are not all made yet: the draws left, and the promises to answer. */
12271
12385
  waiting: Map<PixiFilter, {
12272
12386
  left: number;
12273
12387
  resolve: Array<(warmed: boolean) => void>;
@@ -14250,4 +14364,4 @@ type BundleCompanion = {
14250
14364
  unload(bundle: string): void;
14251
14365
  };
14252
14366
  //#endregion
14253
- export { PixiFilter as $, ReducedMotion as $n, State$7 as $r, ProblemRule as $t, SyncApi as A, FlowState as An, State$5 as Ar, PassKind as At, Shape as B, Hint as Bn, PlayerStateProvider as Br, PerfGapLine as Bt, SceneSpec as C, FeatureDescription as Cn, Explained as Cr, MonitorSections as Ct, DebugSwitches as D, Bookmark as Dn, ClockSource as Dr, PERF_GAP_BUCKETS as Dt, types_d_exports$1 as E, AnyFlow as En, Api$4 as Er, PERF_CAUSES as Et, NineSlice$1 as F, TypeTag as Fn, Json as Fr, PerfCollectorLine as Ft, SpriteValue as G, DescriptionNode as Gn, SnapshotOf as Gr, PerfMeasured as Gt, Sprite as H, Answer as Hn, SaveDoc as Hr, PerfLogLine as Ht, NineSliceValue as I, Descriptor as In, Root as Ir, PerfCounts as It, sprite as J, MotionCause as Jn, RngState as Jr, PerfStartupLine as Jt, Transform as K, Ease as Kn, StoreApi as Kr, PerfSampleLine as Kt, Overlay as L, Effect as Ln, State$6 as Lr, PerfDisplay as Lt, Display as M, NodeTable as Mn, Api$5 as Mr, PerfCause as Mt, HudPart as N, RouteStep as Nn, Config$6 as Nr, PerfChange as Nt, FilterSlot as O, DefineNode as On, Config$5 as Or, PERF_LOG_VERSION as Ot, HudPartValue as P, SceneIdOf as Pn, Events$5 as Pr, PerfChangeEntry as Pt, MonitorConfig as Q, ProjectionSpec as Qn, PauseReason as Qr, ProblemEventDetail as Qt, OverlayValue as R, EffectOptions as Rn, types_d_exports$6 as Rr, PerfEventLine as Rt, SceneDefinition as S, type as Sn, Config$4 as Sr, MONITOR_SECTIONS as St, State$1 as T, FeatureTree as Tn, types_d_exports$4 as Tr, OverlayWhat as Tt, SpriteBlend as U, AnchorTarget as Un, SaveUnreadableError as Ur, PerfLongFrameLine as Ut, ShapeValue as V, NodeFx as Vn, ProviderCall as Vr, PerfHeaderLine as Vt, SpriteOptions as W, ChangeHook as Wn, Snapshot as Wr, PerfMarkLine as Wt, Api$1 as X, NumericFields as Xn, Config$7 as Xr, PerfThermalLine as Xt, AdaptiveScale as Y, MotionHandle as Yn, Api$6 as Yr, PerfTelemetryLine as Yt, Config$2 as Z, ProjectionMotion as Zn, Events$6 as Zr, PoolTrimDetail as Zt, AnySceneProjection as _, contribution as _n, ResourceType as _r, FrameReadResult as _t, Config as a, State$8 as ai, CanvasRestart as an, AnyComponentType as ar, Under as at, Events$1 as b, slot as bn, TagType as br, FrameRing as bt, LoadBundles as c, types_d_exports$8 as ci, BundlesOf as cn, ComponentSchema as cr, MonitorCounts as ct, Manifest as d, Require as di, GameTypes as dn, Entity as dr, Point as dt, types_d_exports$7 as ei, SHADER_WHATS as en, SceneSwitch as er, PixiModule as et, ReadyBundles as f, HudKeysOf as fn, EntitySnapshot as fr, ViewportSize as ft, types_d_exports as g, types_d_exports$3 as gn, QueryTerm as gr, FrameColumns as gt, Usage as h, TextStylesOf as hn, Narrowed as hr, WhyLive as ht, BundleSpec as i, RateChange as ii, CANVAS_RESTARTS as in, AnyComponent as ir, State$2 as it, WhyEntry as j, JournalEntry as jn, types_d_exports$5 as jr, PassRecord as jt, FilterSlotInputs as k, FlowGraph as kn, FakeClock as kr, PROBLEM_RULES as kt, LoadReason as l, Config$9 as li, Config$3 as ln, ComponentType as lr, RenderStats as lt, Tier as m, State$3 as mn, Mut as mr, RetakeWhy as mt, AssetsIo as n, Config$8 as ni, ShaderWhat as nn, TrackSegment as nr, PixiTexture as nt, DefineBundles as o, ThermalReading as oi, DEMAND_REASONS as on, AnyComponentValue as or, types_d_exports$2 as ot, State as p, Position as pn, FrameDiff as pr, FilterCache as pt, TransformValue as q, Motion as qn, RngApi as qr, PerfSpikeLine as qt, BundleMap as r, FrameRate as ri, WarmDetail as rn, ViewHandle as rr, PoolTrim as rt, Events as s, Time as si, Api$2 as sn, ComponentHandle as sr, Captured as st, Api as t, Api$7 as ti, ShaderEventDetail as tn, TrackOptions as tr, PixiSprite as tt, LoadResult as u, Events$8 as ui, EmitterIdOf as un, ComponentValue as ur, Orientation as ut, Config$1 as v, defineFlow as vn, SystemDefinition as vr, FrameReadout as vt, ScenesApi as w, FeaturePlugin as wn, State$4 as wr, OverlayEventDetail as wt, LayerMap as x, to as xn, Api$3 as xr, LongFrameEntry as xt, DefineScene as y, exit as yn, SystemFor as yr, FrameRecord as yt, Parent as z, GuideOptions as zn, Patch as zr, PerfEventName as zt };
14367
+ export { MonitorConfig as $, NumericFields as $n, Config$7 as $r, PerfThermalLine as $t, FilterSlotQuad as A, Bookmark as An, ClockSource as Ar, PERF_GAP_BUCKETS as At, Parent as B, Effect as Bn, State$6 as Br, PerfDisplay as Bt, SceneSpec as C, slot as Cn, TagType as Cr, FrameRing as Ct, DebugSwitches as D, FeaturePlugin as Dn, State$4 as Dr, OverlayEventDetail as Dt, types_d_exports$1 as E, FeatureDescription as En, Explained as Er, MonitorSections as Et, HudPartValue as F, NodeTable as Fn, Api$5 as Fr, PerfCause as Ft, SpriteOptions as G, Answer as Gn, SaveDoc as Gr, PerfLogLine as Gt, ShapeValue as H, GuideOptions as Hn, Patch as Hr, PerfEventName as Ht, NineSlice$1 as I, RouteStep as In, Config$6 as Ir, PerfChange as It, TransformValue as J, DescriptionNode as Jn, SnapshotOf as Jr, PerfMeasured as Jt, SpriteValue as K, AnchorTarget as Kn, SaveUnreadableError as Kr, PerfLongFrameLine as Kt, NineSliceValue as L, SceneIdOf as Ln, Events$5 as Lr, PerfChangeEntry as Lt, WhyEntry as M, FlowGraph as Mn, FakeClock as Mr, PROBLEM_RULES as Mt, Display as N, FlowState as Nn, State$5 as Nr, PassKind as Nt, FilterSlot as O, FeatureTree as On, types_d_exports$4 as Or, OverlayWhat as Ot, HudPart as P, JournalEntry as Pn, types_d_exports$5 as Pr, PassRecord as Pt, Config$2 as Q, MotionHandle as Qn, Api$6 as Qr, PerfTelemetryLine as Qt, Overlay as R, TypeTag as Rn, Json as Rr, PerfCollectorLine as Rt, SceneDefinition as S, exit as Sn, SystemFor as Sr, FrameRecord as St, State$1 as T, type as Tn, Config$4 as Tr, MONITOR_SECTIONS as Tt, Sprite as U, Hint as Un, PlayerStateProvider as Ur, PerfGapLine as Ut, Shape as V, EffectOptions as Vn, types_d_exports$6 as Vr, PerfEventLine as Vt, SpriteBlend as W, NodeFx as Wn, ProviderCall as Wr, PerfHeaderLine as Wt, AdaptiveScale as X, Motion as Xn, RngApi as Xr, PerfSpikeLine as Xt, sprite as Y, Ease as Yn, StoreApi as Yr, PerfSampleLine as Yt, Api$1 as Z, MotionCause as Zn, RngState as Zr, PerfStartupLine as Zt, AnySceneProjection as _, State$3 as _n, Mut as _r, RetakeWhy as _t, Config as a, Config$8 as ai, ShaderWhat as an, TrackSegment as ar, PixiUniformGroup as at, Events$1 as b, contribution as bn, ResourceType as br, FrameReadResult as bt, LoadBundles as c, State$8 as ci, CanvasRestart as cn, AnyComponentType as cr, Under as ct, Manifest as d, types_d_exports$8 as di, BundlesOf as dn, ComponentSchema as dr, MonitorCounts as dt, Events$6 as ei, PoolTrimDetail as en, ProjectionMotion as er, PixiFilter as et, ReadyBundles as f, Config$9 as fi, Config$3 as fn, ComponentType as fr, RenderStats as ft, types_d_exports as g, Position as gn, FrameDiff as gr, FilterCache as gt, Usage as h, HudKeysOf as hn, EntitySnapshot as hr, ViewportSize as ht, BundleSpec as i, Api$7 as ii, ShaderEventDetail as in, TrackOptions as ir, PixiTexture as it, SyncApi as j, DefineNode as jn, Config$5 as jr, PERF_LOG_VERSION as jt, FilterSlotInputs as k, AnyFlow as kn, Api$4 as kr, PERF_CAUSES as kt, LoadReason as l, ThermalReading as li, DEMAND_REASONS as ln, AnyComponentValue as lr, types_d_exports$2 as lt, Tier as m, Require as mi, GameTypes as mn, Entity as mr, Point as mt, AssetsIo as n, State$7 as ni, ProblemRule as nn, ReducedMotion as nr, PixiModule as nt, DefineBundles as o, FrameRate as oi, WarmDetail as on, ViewHandle as or, PoolTrim as ot, State as p, Events$8 as pi, EmitterIdOf as pn, ComponentValue as pr, Orientation as pt, Transform as q, ChangeHook as qn, Snapshot as qr, PerfMarkLine as qt, BundleMap as r, types_d_exports$7 as ri, SHADER_WHATS as rn, SceneSwitch as rr, PixiSprite as rt, Events as s, RateChange as si, CANVAS_RESTARTS as sn, AnyComponent as sr, State$2 as st, Api as t, PauseReason as ti, ProblemEventDetail as tn, ProjectionSpec as tr, PixiGpuProgram as tt, LoadResult as u, Time as ui, Api$2 as un, ComponentHandle as ur, Captured as ut, Config$1 as v, TextStylesOf as vn, Narrowed as vr, WhyLive as vt, ScenesApi as w, to as wn, Api$3 as wr, LongFrameEntry as wt, LayerMap as x, defineFlow as xn, SystemDefinition as xr, FrameReadout as xt, DefineScene as y, types_d_exports$3 as yn, QueryTerm as yr, FrameColumns as yt, OverlayValue as z, Descriptor as zn, Root as zr, PerfCounts as zt };
@@ -1,7 +1,7 @@
1
- import { Br as PlayerStateProvider, Dr as ClockSource, En as AnyFlow, Fn as TypeTag, Fr as Json, Gr as SnapshotOf, Hr as SaveDoc, Nr as Config, Vr as ProviderCall, Z as Config$2, a as Config$3, d as Manifest, et as PixiModule, kr as FakeClock, ln as Config$1, n as AssetsIo, ut as Orientation, wn as FeaturePlugin } from "./types-DfHytzox.mjs";
2
- import { o as AudioContextLike, s as Config$4 } from "./types-DJCC9CAp.mjs";
3
- import { R as I18nApi, U as StringTable, W as TextKey } from "./types-CPWi_CLI.mjs";
4
- import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-DTHVVLFB.mjs";
1
+ import { Ar as ClockSource, Dn as FeaturePlugin, Gr as SaveDoc, Ir as Config, Jr as SnapshotOf, Mr as FakeClock, Q as Config$2, Rn as TypeTag, Rr as Json, Ur as PlayerStateProvider, Wr as ProviderCall, a as Config$3, d as Manifest, fn as Config$1, kn as AnyFlow, n as AssetsIo, nt as PixiModule, pt as Orientation } from "./types-CbVXXqPs.mjs";
2
+ import { o as AudioContextLike, s as Config$4 } from "./types-C5gLBKbm.mjs";
3
+ import { R as I18nApi, U as StringTable, W as TextKey } from "./types-OBpR0u05.mjs";
4
+ import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-Bn0pFiae.mjs";
5
5
  import { AnyPluginInstance } from "@moku-labs/core";
6
6
 
7
7
  //#region src/plugins/model/store/providers/memory.d.ts
@@ -72,6 +72,19 @@ type SystemName = "lifecycle" | "back" | "haptics" | "keepAwake" | "store";
72
72
  * ```
73
73
  */
74
74
  type SaveKind = "memory" | "local" | "store";
75
+ /**
76
+ * One `Info.plist` value of `native.ios.infoPlist`: a string, a boolean, an array or a dictionary,
77
+ * nested as deep as the key needs. A number, `null` or `undefined` is refused when the config is read.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * // config.ts of a game that talks to the Mac on the local network.
82
+ * const transport: PlistValue = { NSAllowsLocalNetworking: true }; // <dict><key>NSAllowsLocalNetworking</key><true/></dict>
83
+ * ```
84
+ */
85
+ type PlistValue = string | boolean | readonly PlistValue[] | {
86
+ readonly [key: string]: PlistValue;
87
+ };
75
88
  /**
76
89
  * What `config.ts` of a game holds: plain data, no call. The page, the native build and the shell
77
90
  * read it; the game logic never does.
@@ -82,7 +95,16 @@ type SaveKind = "memory" | "local" | "store";
82
95
  * import type { GameConfig } from "@moku-labs/game/app";
83
96
  * export default {
84
97
  * page: { title: "Лесной городок", lang: "ru", background: "#10161d", orientation: "portrait", icons: { favicon: "assets/icon.png" }, boot: { image: "assets/boot.png" } },
85
- * native: { name: "Лесной городок", identifier: "com.mokulabs.timber", icon: "assets/icon.png" },
98
+ * native: {
99
+ * name: "Лесной городок",
100
+ * identifier: "com.mokulabs.timber",
101
+ * icon: "assets/icon.png",
102
+ * signing: {
103
+ * android: { keystorePath: "~/keys/upload.jks", keystorePasswordEnv: "TIMBER_KEYSTORE_PASSWORD", keyAlias: "upload" },
104
+ * apple: { teamId: "ABCDE12345" }
105
+ * },
106
+ * ios: { infoPlist: { ITSAppUsesNonExemptEncryption: false }, privacyManifest: "ios/PrivacyInfo.xcprivacy" }
107
+ * },
86
108
  * system: ["lifecycle", "back", "haptics", "keepAwake"],
87
109
  * save: "memory",
88
110
  * assets: { layers: { shared: "ui" } }
@@ -125,7 +147,23 @@ type GameConfig = {
125
147
  /** The app name under the icon. */name: string; /** The bundle identifier, reverse DNS. */
126
148
  identifier: string; /** A 1024 px PNG, relative to the game folder. A placeholder by default. */
127
149
  icon?: string; /** The native targets a build makes. The target of the command by default. */
128
- targets?: readonly ("ios" | "android" | "macos")[];
150
+ targets?: readonly ("ios" | "android" | "macos")[]; /** How a store build signs. Names and identifiers only, never a secret. None by default. */
151
+ signing?: {
152
+ /** The upload key of a release build on Android. `--store` refuses Android without it. */android?: {
153
+ /** The keystore file: absolute, `~/...`, or relative to the game folder. */keystorePath: string; /** The name of the env var with the keystore password, never the password. */
154
+ keystorePasswordEnv: string; /** The name of the env var with the key password. The keystore's one by default. */
155
+ keyPasswordEnv?: string; /** The alias of the key in the keystore. */
156
+ keyAlias: string;
157
+ }; /** The Apple team. Keys stay in the env, Tauri reads them. `--store` refuses iOS without it. */
158
+ apple?: {
159
+ /** The Apple Developer team id. */teamId: string;
160
+ };
161
+ }; /** What an iOS app adds to its bundle. None by default. */
162
+ ios?: {
163
+ /** The lowest iOS the app runs on, `x.y` or `x.y.z`. Default `"26.0"`. */minimumVersion?: string; /** Keys merged into `Info.plist`. `page.orientation` wins a key it shares. */
164
+ infoPlist?: Readonly<Record<string, PlistValue>>; /** The privacy manifest, relative to the game folder. The bundle holds it as `PrivacyInfo.xcprivacy`. */
165
+ privacyManifest?: string;
166
+ };
129
167
  }; /** The system plugins the shell wires. Default `[]`, a web page with no shell. */
130
168
  system?: readonly SystemName[]; /** Where the save lives. Default `"memory"`. */
131
169
  save?: SaveKind; /** The asset build. Default: no layers. */
@@ -742,4 +780,4 @@ type SystemShell = {
742
780
  stop(): Promise<void>;
743
781
  };
744
782
  //#endregion
745
- export { SystemShellFactory as _, GameHandle as a, saveOf as b, MemoryProvider as c, SaveKind as d, Scenario as f, SystemName as g, SystemModules as h, GameDefinition as i, PageAgent as l, StartedPage as m, GameApp as n, GamePluginConfigs as o, ScreenSeams as p, GameConfig as r, HeadlessSeams as s, AnyGameApp as t, PageOptions as u, WithGameState as v, memory as y };
783
+ export { SystemName as _, GameHandle as a, memory as b, MemoryProvider as c, PlistValue as d, SaveKind as f, SystemModules as g, StartedPage as h, GameDefinition as i, PageAgent as l, ScreenSeams as m, GameApp as n, GamePluginConfigs as o, Scenario as p, GameConfig as r, HeadlessSeams as s, AnyGameApp as t, PageOptions as u, SystemShellFactory as v, saveOf as x, WithGameState as y };
@@ -1,5 +1,5 @@
1
- import { Fr as Json, Wr as Snapshot } from "./types-DfHytzox.mjs";
2
- import { t as HeadlessApp } from "./headless-B8JIqsZk.mjs";
1
+ import { Rr as Json, qr as Snapshot } from "./types-CbVXXqPs.mjs";
2
+ import { t as HeadlessApp } from "./headless-DtDdn5gg.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 ReducedMotion, Bn as Hint, Er as Api$5, Fr as Json, Hn as Answer, In as Descriptor, Jn as MotionCause, Kn as Ease, Un as AnchorTarget, Wn as ChangeHook, X as Api$3, Xn as NumericFields, Yn as MotionHandle, Zn as ProjectionMotion, ar as AnyComponentType, br as TagType, di as Require, dr as Entity, ft as ViewportSize, ir as AnyComponent, lr as ComponentType, or as AnyComponentValue, q as TransformValue, qn as Motion, rr as ViewHandle, s as Events$1, sn as Api$1, t as Api$4, ti as Api, xr as Api$2 } from "./types-DfHytzox.mjs";
1
+ import { $n as NumericFields, Cr as TagType, Gn as Answer, J as TransformValue, Kn as AnchorTarget, Qn as MotionHandle, Rr as Json, Un as Hint, Xn as Motion, Yn as Ease, Z as Api$3, Zn as MotionCause, cr as AnyComponentType, er as ProjectionMotion, fr as ComponentType, ht as ViewportSize, ii as Api, kr as Api$5, lr as AnyComponentValue, mi as Require, mr as Entity, nr as ReducedMotion, or as ViewHandle, qn as ChangeHook, s as Events$1, sr as AnyComponent, t as Api$4, un as Api$1, wr as Api$2, zn as Descriptor } from "./types-CbVXXqPs.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,9 +1,9 @@
1
- import { Er as Api$4, Mr as Api$2, X as Api, Yr as Api$3, xr as Api$1 } from "./types-DfHytzox.mjs";
2
- import { P as AnimApi, r as UiApi } from "./types-DJCC9CAp.mjs";
3
- import { N as InputApi } from "./types-CPWi_CLI.mjs";
4
- import { r as Repro } from "./headless-B8JIqsZk.mjs";
5
- import { a as InputOf, r as ControlApp } from "./types-DsRV-ph1.mjs";
6
- import { t as commands } from "./commands-DKjkHK5b.mjs";
1
+ import { Fr as Api$2, Qr as Api$3, Z as Api, kr as Api$4, wr as Api$1 } from "./types-CbVXXqPs.mjs";
2
+ import { P as AnimApi, r as UiApi } from "./types-C5gLBKbm.mjs";
3
+ import { N as InputApi } from "./types-OBpR0u05.mjs";
4
+ import { r as Repro } from "./headless-DtDdn5gg.mjs";
5
+ import { a as InputOf, r as ControlApp } from "./types-DNWWlVky.mjs";
6
+ import { t as commands } from "./commands-CeBF2nRY.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-B76IxxTL.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-Di8ecxYD.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
@@ -302,7 +302,7 @@ app.model.store.snapshot().session; // { rolls: 2 }
302
302
  await run.stop();
303
303
  ```
304
304
 
305
- `config.ts` keys and defaults: `page.title` (required, never empty), `page.lang` (`"en"`), `page.background` (`"#000000"`: the page behind the canvas, the `theme-color` meta and the native window; the canvas clear colour stays `pluginConfigs.renderer.background`), `page.orientation` (`"portrait"`, or `"landscape"`, `"any"`: the native build locks it), `page.icons: { favicon?, appleTouch? }` (files relative to the game, `<link>` tags), `page.head` (raw tags, verbatim), `page.boot: { image, width?, fadeMs? }` (absent by default; an `<img id="moku-boot">` centred over the canvas from the first paint until the first scene drew, then faded over `fadeMs`, `300`, and removed; `image` a file relative to the game, `width` `"40vmin"`), `native: { name, identifier, icon?, targets? }` (absent: no native build), `system` (`[]`; names `lifecycle`, `back`, `haptics`, `keepAwake`, `store`), `save` (`"memory"`, or `"local"`, `"store"`), `assets.layers` (`{}`; `{ shared: "ui" }` becomes `--layer shared=ui`), `debug.overlay` (`"closed"`, or `"pill"`, `"open"`: how the editor's overlay shows when a debug page starts; the page calls `app.debug.overlay.open({ mode })` right after the agents started; only a page with the agent reads it). A refused value throws, for example `[game] config.save is "disk".` or `[game] config.system names "tray", which the game shell does not wire.`
305
+ `config.ts` keys and defaults: `page.title` (required, never empty), `page.lang` (`"en"`), `page.background` (`"#000000"`: the page behind the canvas, the `theme-color` meta and the native window; the canvas clear colour stays `pluginConfigs.renderer.background`), `page.orientation` (`"portrait"`, or `"landscape"`, `"any"`: the native build locks it), `page.icons: { favicon?, appleTouch? }` (files relative to the game, `<link>` tags), `page.head` (raw tags, verbatim), `page.boot: { image, width?, fadeMs? }` (absent by default; an `<img id="moku-boot">` centred over the canvas from the first paint until the first scene drew, then faded over `fadeMs`, `300`, and removed; `image` a file relative to the game, `width` `"40vmin"`), `native: { name, identifier, icon?, targets?, signing?, ios? }` (absent: no native build; `signing.android: { keystorePath, keystorePasswordEnv, keyPasswordEnv?, keyAlias }`, the path absolute, `~/...` or relative to the game, the passwords by env var name only; `signing.apple: { teamId }`; `ios: { minimumVersion?, infoPlist?, privacyManifest? }`, the minimum `"26.0"` by default, `infoPlist` of `PlistValue`: strings, booleans, arrays, dictionaries, a number or `null` refused; the manifest relative to the game), `system` (`[]`; names `lifecycle`, `back`, `haptics`, `keepAwake`, `store`), `save` (`"memory"`, or `"local"`, `"store"`), `assets.layers` (`{}`; `{ shared: "ui" }` becomes `--layer shared=ui`), `debug.overlay` (`"closed"`, or `"pill"`, `"open"`: how the editor's overlay shows when a debug page starts; the page calls `app.debug.overlay.open({ mode })` right after the agents started; only a page with the agent reads it). A refused value throws, for example `[game] config.save is "disk".` or `[game] config.system names "tray", which the game shell does not wire.`
306
306
 
307
307
  ```ts
308
308
  // config.ts of a game in a native shell
@@ -342,7 +342,8 @@ Commands of the bin `moku-game` (bun). Every command takes `--root <dir>` (defau
342
342
  - `moku-game dev [--port 3000] [--packed]`: writes `.moku/index.html`, `script.ts` (the `moku:script` startup mark), `dev.ts` (sets `__MOKU_GAME_BUILD__` `"dev"`, the engine id `__MOKU_GAME_ENGINE__`, `__MOKU_GAME_CONTROL__`, `__MOKU_GAME_AGENT__` and last `__MOKU_GAME_DEV__`), `main.ts`, `assets-stamp.ts`, `bunfig.toml` (the hot plugin first, `__MOKU_GAME_DEV__`, `__MOKU_GAME_AGENT__` and `__MOKU_GAME_CONTROL__` defined `true`), runs Bun again under that bunfig in the game folder and serves `/`. It prints `› engine <id>` (and the patch file when there is one), then `› <folder>: dev server, raw assets. Ctrl+C stops it.` and then the bound URL alone on its own line, `http://localhost:3000/`. `--port 0` takes a free port. `--packed` serves `dist/assets`. A new or removed file in `tests/scenarios/` rewrites `main.ts`. On the raw files it keeps `generated/` fresh: it runs the scan of `keys` once before the page is written, and a save of an asset file (`.png`, `.webp`, `.fnt`, `.mp3`, `.m4a`) or of a `strings/<locale>.json` runs it again 100 ms after the last file event and prints `› keys: <path>` or `› keys: <path> and <n> more`; a folder that becomes or stops being a sub-feature (it gains or loses its door, `assets/`, `assets.ts` or `strings/`) scans too, `› keys: features/episodes/ep03/`; a changed or new string hot swaps through `generated/strings.<locale>.ts`, an asset file saved with new bytes swaps in the running page and a new or removed one reloads it, both through `.moku/assets-stamp.ts`, which `main.ts` imports (see "Hot swap"), and files answer `Cache-Control: no-store`. A failed scan is one warning `[game] keys: <message>` and the server runs on. A changed layer in `config.ts` needs a restart; `--packed` watches nothing. A taken port: `[game] dev: port 3000 is in use.` with `Pass --port 0 for a free port.` It watches the installed engine: 300 ms after a new version or dist it warns `[game] dev: the engine changed (<old id> -> <new id>), restarting the dev server.`, stops the child with SIGTERM, writes the page again with the new id and starts a new child (a fixed port keeps its URL, `--port 0` prints a new one); a patch file that changed while the engine did not is one warning that asks for `bun install`.
343
343
  - `moku-game build [--out dist/web]`: packs the assets, bundles the page minified with `__MOKU_GAME_DEV__`, `__MOKU_GAME_AGENT__` and `__MOKU_GAME_CONTROL__` defined `false` (no scenario, no agent, no `.dev` module, no `/control`, no engine id), every link `./`, and copies the pack beside it with `manifest.json` next to `index.html`. Every page marks `moku:script` first and `moku:main` first after its imports. A release page whose `.js` carries `"/__editor/hello"` or `"[moku-editor]"` (the editor's agent) fails with `[game] build: the release page carries the editor agent (…)` and its output folder is removed. Runs from any http sub-path and from Tauri, not from `file://`.
344
344
  - `moku-game build --debug[=read] [--editor host:port]`: a debug page, never shipped: the release page plus `@moku-labs/editor/agent/page` (resolved from the game, else `[game] build --debug needs @moku-labs/editor in the game.`) and the game's `.dev` modules, started after the app; DEV `false`, AGENT `true`, CONTROL `true` (`--debug`: every command, cheats too; `--debug=full` is an alias that prints one line) or `false` (`--debug=read`, the rare read-only page: read and cosmetic commands); `__MOKU_GAME_BUILD__` `debug-<UTC stamp>` for both, `__MOKU_GAME_ENGINE__` the engine id (`<version>+<dist hash>[.patch.<hash>]`, `+src` from sources), `__MOKU_GAME_EDITOR__` the `--editor` address (default `127.0.0.1:47600`); the title reads `<title> Debug`; no hot swap, no frame recorder, no audio journal, no scenario. It prints one warning naming the profile, the build id, the engine and the editor. `MOKU_NATIVE_PROFILE=store` with `--debug` is refused.
345
- - `moku-game native build <target> [--simulator] [--debug[=full] [--editor host:port]]`, `native dev <target>`, `native doctor [<target>]`, `native clean [<target>]`: one verb of `@moku-labs/native` (a dev dependency, `^0.3.2`) over `config.ts`. App name, identifier and icon from `native`, orientation and background colour from `page`; the web build is `moku-game build`, the dev server `moku-game dev --port 5173`; system rows for `back`, `haptics`, `store`; the Tauri project in `.moku/tauri`, the apps in `dist-native`; an Android app composes native's `shell` system first. `native build android --debug` builds a debug app (`debug: true` to native, which installs it beside the store app; the web build is `moku-game build --debug` with the same profile and `--editor`); other verbs and targets refuse `--debug`. `[game] config.ts has no native section.` without `native`.
345
+ - `moku-game native build <target> [--simulator] [--debug[=full] [--editor host:port]]`, `native dev <target>`, `native doctor [<target>]`, `native clean [<target>]`: one verb of `@moku-labs/native` (a dev dependency, `^0.3.12`) over `config.ts`. App name, identifier and icon from `native`, orientation and background colour from `page`; the web build is `moku-game build`, the dev server `moku-game dev --port 5173`; system rows for `back`, `haptics`, `store`; the Tauri project in `.moku/tauri`, the apps in `dist-native`; an Android app composes native's `shell` system first. `native build android --debug` builds a debug app (`debug: true` to native, which installs it beside the store app; the web build is `moku-game build --debug` with the same profile and `--editor`); other verbs and targets refuse `--debug`. `[game] config.ts has no native section.` without `native`.
346
+ - `moku-game native build <ios|android> --store --build-number <n>`: a store build, an `.aab` on Android (`aab: true` to native), an `.ipa` with `exportMethod: "app-store-connect"` on iOS. `app.version` from `package.json`, `app.buildNumber` from the flag, an integer from 1 to 2100000000, one number for both stores. Refused before `config.ts` is read: outside `native build`, with `--debug`, `--editor` or `--simulator`, on another target, without a valid number; `--build-number` without `--store`. Then every problem at once, before anything compiles, in one `[game] native --store: …` error, a line per problem: no signing block for the target, on Android a keystore that is not a file or an unset password variable (its name only, never a value), a `package.json` version that is not `x.y.z`, an identifier that ends in `.soak`, `.debug`, `.dev`, `.test` or `.staging`. On iOS it warns, and goes on, without `ios.privacyManifest` or `ITSAppUsesNonExemptEncryption` in `ios.infoPlist`. A build without `--store` runs no store check: `native build ios` is a device build. Every build takes a valid `package.json` version (else native's `0.1.0`), `app.keepScreenOn` from `keepAwake` in `system`, and on iOS the minimum `26.0`; a debug app leaves `signing.android` out and keeps the SDK key.
346
347
  - `moku-game keys [--check]`: `generated/assets.ts`, the compiled strings (`strings.ts`, `strings.<locale>.ts` for the top-level features and the layers, and `strings.<feature>.<locale>.ts` for every sub-feature with string files) and the dev manifest `generated/manifest.json` (a sub-feature's bundle carries its `dir` and `parent`); `dev` runs the same scan at start and on save and serves the manifest on `/manifest.json`, `visual` stops without it. `moku-game pack [--no-cache]`: `dist/assets`. Both pass the layers of `config.ts`.
347
348
  - `moku-game visual [--update] [--only <name>] [--no-pixels | --pixels] [--webgl] [--dir <path>] [--tests <file>] [--url <url>]`: runs `runVisualTests` with the default export of `tests/visual/index.ts`, `{ app, tests }` (`app` is a `VisualSetup` `{ app, page? }`: `export default { app: { app: fixtureApp }, tests }`), against `tests/visual/baselines/`. The flags go through `parseVisualArgv`. The pixel leg runs on a Mac only unless `--pixels`/`--no-pixels`; without `--url` the command writes its own page into `.moku/visual/` (the page of `dev` and of the editor in `.moku/` stays), runs Bun again under `.moku/visual/bunfig.toml` as `dev` does (hot plugin, `--serve-plugin`, `--preload`), and the child serves the page on a free port, then stops it. No `manifest.json`: `[game] visual: no manifest.json in "<game>".` Exit 0 when the report is ok, else 1. `[game] visual: <file> must export default { app, tests }.` for a missing module or another shape, a bare app factory too.
348
349
  - `preparePage(root, { agents?, preload?, servePlugins? })` of `@moku-labs/game/cli` writes the dev page of `moku-game dev` and resolves `{ html, bunfig, engine }` (both paths absolute; `engine` the `EngineFingerprint` whose `id` the page shows in `globalThis.__MOKU_GAME_ENGINE__`), for a server the caller starts: `bun --config=<bunfig>`. With agents the page also imports the game's `**/*.dev.ts` and hands them to the agents. It also writes the first, empty `.moku/assets-stamp.ts` when the game has none. The editor calls it: `await preparePage("games/timber", { agents: ["@moku-labs/editor/agent/page"] })`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/game",
3
- "version": "0.15.84",
3
+ "version": "0.15.86",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -127,7 +127,7 @@
127
127
  "peerDependencies": {
128
128
  "@moku-labs/common": "^0.3.4",
129
129
  "@moku-labs/core": "^1.7.1",
130
- "@moku-labs/native": "^0.3.9",
130
+ "@moku-labs/native": "^0.3.12",
131
131
  "@moku-labs/system": "^0.3.1",
132
132
  "pixi.js": "^8.22.0",
133
133
  "playwright-core": ">=1.50.0",
@@ -162,7 +162,7 @@
162
162
  "@moku-labs/ci": "1.5.7",
163
163
  "@moku-labs/common": "0.3.10",
164
164
  "@moku-labs/core": "1.7.6",
165
- "@moku-labs/native": "0.3.11",
165
+ "@moku-labs/native": "0.3.12",
166
166
  "@moku-labs/system": "0.3.7",
167
167
  "@types/bun": "1.4.2",
168
168
  "@vitest/coverage-istanbul": "4.0.18",