@datamoc/mw_games 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/CHANGELOG.md +192 -0
  2. package/README.md +15 -0
  3. package/api-surface.json +14942 -0
  4. package/dist/actors/StatBlock.d.ts +2 -4
  5. package/dist/actors/StatBlock.d.ts.map +1 -1
  6. package/dist/actors/StatBlock.js +2 -4
  7. package/dist/actors/StatBlock.js.map +1 -1
  8. package/dist/ai/Heuristics.d.ts +1 -1
  9. package/dist/ai/Heuristics.js +1 -1
  10. package/dist/ai/Suggest.d.ts +54 -0
  11. package/dist/ai/Suggest.d.ts.map +1 -0
  12. package/dist/ai/Suggest.js +48 -0
  13. package/dist/ai/Suggest.js.map +1 -0
  14. package/dist/ai/index.d.ts +2 -0
  15. package/dist/ai/index.d.ts.map +1 -1
  16. package/dist/ai/index.js +1 -0
  17. package/dist/ai/index.js.map +1 -1
  18. package/dist/assets/index.d.ts +1 -0
  19. package/dist/assets/index.d.ts.map +1 -1
  20. package/dist/assets/index.js.map +1 -1
  21. package/dist/core/Blob.d.ts.map +1 -1
  22. package/dist/core/Blob.js +2 -8
  23. package/dist/core/Blob.js.map +1 -1
  24. package/dist/core/Grid.d.ts +115 -0
  25. package/dist/core/Grid.d.ts.map +1 -1
  26. package/dist/core/Grid.js +125 -0
  27. package/dist/core/Grid.js.map +1 -1
  28. package/dist/core/HttpTransport.d.ts +14 -0
  29. package/dist/core/HttpTransport.d.ts.map +1 -1
  30. package/dist/core/HttpTransport.js +14 -0
  31. package/dist/core/HttpTransport.js.map +1 -1
  32. package/dist/core/Random.d.ts +63 -13
  33. package/dist/core/Random.d.ts.map +1 -1
  34. package/dist/core/Random.js +28 -25
  35. package/dist/core/Random.js.map +1 -1
  36. package/dist/core/Replay.d.ts +28 -4
  37. package/dist/core/Replay.d.ts.map +1 -1
  38. package/dist/core/Replay.js +38 -9
  39. package/dist/core/Replay.js.map +1 -1
  40. package/dist/core/ReplayFile.d.ts +197 -0
  41. package/dist/core/ReplayFile.d.ts.map +1 -0
  42. package/dist/core/ReplayFile.js +257 -0
  43. package/dist/core/ReplayFile.js.map +1 -0
  44. package/dist/core/index.d.ts +9 -5
  45. package/dist/core/index.d.ts.map +1 -1
  46. package/dist/core/index.js +4 -2
  47. package/dist/core/index.js.map +1 -1
  48. package/dist/headless/index.d.ts +87 -0
  49. package/dist/headless/index.d.ts.map +1 -0
  50. package/dist/headless/index.js +87 -0
  51. package/dist/headless/index.js.map +1 -0
  52. package/dist/mw_games.global.js +113 -113
  53. package/dist/mwl/index.d.ts +1 -1
  54. package/dist/mwl/index.d.ts.map +1 -1
  55. package/dist/mwl/index.js.map +1 -1
  56. package/dist/roguelike/Level.d.ts +1 -1
  57. package/dist/roguelike/Level.d.ts.map +1 -1
  58. package/dist/roguelike/Level.js +3 -21
  59. package/dist/roguelike/Level.js.map +1 -1
  60. package/dist/roguelike/Targeting.d.ts.map +1 -1
  61. package/dist/roguelike/Targeting.js +2 -1
  62. package/dist/roguelike/Targeting.js.map +1 -1
  63. package/dist/rpg/index.d.ts +1 -1
  64. package/dist/rpg/index.d.ts.map +1 -1
  65. package/dist/simulation/Training.d.ts +77 -0
  66. package/dist/simulation/Training.d.ts.map +1 -1
  67. package/dist/simulation/Training.js +87 -0
  68. package/dist/simulation/Training.js.map +1 -1
  69. package/dist/simulation/index.d.ts +2 -2
  70. package/dist/simulation/index.d.ts.map +1 -1
  71. package/dist/simulation/index.js +1 -1
  72. package/dist/simulation/index.js.map +1 -1
  73. package/dist/two-d/pixi-interop.d.ts +24 -1
  74. package/dist/two-d/pixi-interop.d.ts.map +1 -1
  75. package/dist/two-d/pixi-interop.js +23 -1
  76. package/dist/two-d/pixi-interop.js.map +1 -1
  77. package/dist/two-d/render/Beam.d.ts +93 -0
  78. package/dist/two-d/render/Beam.d.ts.map +1 -0
  79. package/dist/two-d/render/Beam.js +154 -0
  80. package/dist/two-d/render/Beam.js.map +1 -0
  81. package/dist/two-d/render/Flights.d.ts +79 -0
  82. package/dist/two-d/render/Flights.d.ts.map +1 -0
  83. package/dist/two-d/render/Flights.js +120 -0
  84. package/dist/two-d/render/Flights.js.map +1 -0
  85. package/dist/two-d/render/Particles.d.ts +48 -0
  86. package/dist/two-d/render/Particles.d.ts.map +1 -1
  87. package/dist/two-d/render/Particles.js +59 -1
  88. package/dist/two-d/render/Particles.js.map +1 -1
  89. package/dist/two-d/render/index.d.ts +6 -2
  90. package/dist/two-d/render/index.d.ts.map +1 -1
  91. package/dist/two-d/render/index.js +2 -0
  92. package/dist/two-d/render/index.js.map +1 -1
  93. package/dist/two-d/ui/MessageLog.d.ts +28 -0
  94. package/dist/two-d/ui/MessageLog.d.ts.map +1 -1
  95. package/dist/two-d/ui/MessageLog.js +23 -6
  96. package/dist/two-d/ui/MessageLog.js.map +1 -1
  97. package/dist/two-d/ui/TextPrompt.d.ts +115 -0
  98. package/dist/two-d/ui/TextPrompt.d.ts.map +1 -0
  99. package/dist/two-d/ui/TextPrompt.js +227 -0
  100. package/dist/two-d/ui/TextPrompt.js.map +1 -0
  101. package/dist/two-d/ui/index.d.ts +4 -2
  102. package/dist/two-d/ui/index.d.ts.map +1 -1
  103. package/dist/two-d/ui/index.js +2 -1
  104. package/dist/two-d/ui/index.js.map +1 -1
  105. package/dist/version.d.ts +1 -1
  106. package/dist/version.js +1 -1
  107. package/package.json +16 -3
  108. package/sbom.cdx.json +6 -6
  109. package/tools/audit-adoptions.d.mts +65 -0
  110. package/tools/audit-adoptions.mjs +252 -0
  111. package/tools/browser-driver.d.mts +78 -0
  112. package/tools/browser-driver.mjs +642 -0
@@ -0,0 +1,87 @@
1
+ /**
2
+ * The blessed renderer-free entry: every `mwg` module that loads in bare Node, in one
3
+ * import, with no DOM or WebGL globals.
4
+ *
5
+ * A game rule that never touches a renderer should never have to discover, by accident,
6
+ * which subpaths load without one. Importing this entry is the declaration: if it loads,
7
+ * the game logic is headless; if a rule needs anything outside it, that dependency is
8
+ * renderer-bound and belongs in presentation, not in the rule.
9
+ *
10
+ * Membership is the set `REFERENCE.md` documents as renderer-free, minus `three-d`
11
+ * (renderer-free of Pixi but needing Babylon at import, an optional peer a plain
12
+ * `npm test` run has no reason to have installed), plus the two renderer-free asset
13
+ * halves (`assetPaths`, `assetBinary` - path resolution and byte caching with no
14
+ * renderer, beside the Pixi-backed `assets` loader). Deliberately excluded: the Lua
15
+ * runtimes (`mwl/fengari`, `ai/lua`), which carry their own load contracts, and every
16
+ * `two-d/*` module (Pixi by documentation, enforced by test).
17
+ *
18
+ * `threads` rides along (simulation's async rollouts and `ai` training spawn through
19
+ * it, and it loads with no renderer - its worker host is a call-time concern, not an
20
+ * import-time one, handled inside `threads.spawn` itself).
21
+ *
22
+ * `tests/headless-smoke.test.ts` is the proof: it imports this entry in plain Node
23
+ * with no DOM/WebGL globals, walks the reachable import graph for a renderer leak,
24
+ * and runs a seeded scenario through it twice for the same result.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * import {
29
+ * actors,
30
+ * ai,
31
+ * assetBinary,
32
+ * assetPaths,
33
+ * audio,
34
+ * battle,
35
+ * board,
36
+ * core,
37
+ * i18n,
38
+ * mwl,
39
+ * roguelike,
40
+ * rpg,
41
+ * simulation,
42
+ * testing,
43
+ * world,
44
+ * } from '@datamoc/mw_games/headless';
45
+ *
46
+ * // deterministic rules with no renderer: a seeded stream plus one headless scenario
47
+ * const random = new core.Generator(7);
48
+ * const result = simulation.runScenario({
49
+ * state: { value: 0 },
50
+ * commands: [1, 2, 3],
51
+ * random,
52
+ * step: (state, command, rng) => ({
53
+ * state: { value: state.value + command + rng.int(2) },
54
+ * events: [],
55
+ * status: 'ready' as const,
56
+ * }),
57
+ * });
58
+ *
59
+ * // every other member rides the same entry: content, rules, saves, and the two
60
+ * // renderer-free asset halves (path resolution and byte caching with no loader)
61
+ * const tables = mwl.MWL_SCHEMA_10;
62
+ * const present = assetPaths.has('tiles/grass.png');
63
+ * const cached = assetBinary.isBinaryLoaded('sfx/hit.mp3');
64
+ * const check = { actors, ai, audio, battle, board, i18n, roguelike, rpg, testing, world };
65
+ * void result;
66
+ * void tables;
67
+ * void present;
68
+ * void cached;
69
+ * void check;
70
+ * ```
71
+ */
72
+ export * as core from '../core/index.ts';
73
+ export * as simulation from '../simulation/index.ts';
74
+ export * as mwl from '../mwl/index.ts';
75
+ export * as i18n from '../i18n/index.ts';
76
+ export * as actors from '../actors/index.ts';
77
+ export * as world from '../world/index.ts';
78
+ export * as battle from '../battle/index.ts';
79
+ export * as roguelike from '../roguelike/index.ts';
80
+ export * as board from '../board/index.ts';
81
+ export * as audio from '../audio/index.ts';
82
+ export * as rpg from '../rpg/index.ts';
83
+ export * as ai from '../ai/index.ts';
84
+ export * as testing from '../testing/index.ts';
85
+ export * as assetPaths from '../assets/paths.ts';
86
+ export * as assetBinary from '../assets/binary.ts';
87
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/headless/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * The blessed renderer-free entry: every `mwg` module that loads in bare Node, in one
3
+ * import, with no DOM or WebGL globals.
4
+ *
5
+ * A game rule that never touches a renderer should never have to discover, by accident,
6
+ * which subpaths load without one. Importing this entry is the declaration: if it loads,
7
+ * the game logic is headless; if a rule needs anything outside it, that dependency is
8
+ * renderer-bound and belongs in presentation, not in the rule.
9
+ *
10
+ * Membership is the set `REFERENCE.md` documents as renderer-free, minus `three-d`
11
+ * (renderer-free of Pixi but needing Babylon at import, an optional peer a plain
12
+ * `npm test` run has no reason to have installed), plus the two renderer-free asset
13
+ * halves (`assetPaths`, `assetBinary` - path resolution and byte caching with no
14
+ * renderer, beside the Pixi-backed `assets` loader). Deliberately excluded: the Lua
15
+ * runtimes (`mwl/fengari`, `ai/lua`), which carry their own load contracts, and every
16
+ * `two-d/*` module (Pixi by documentation, enforced by test).
17
+ *
18
+ * `threads` rides along (simulation's async rollouts and `ai` training spawn through
19
+ * it, and it loads with no renderer - its worker host is a call-time concern, not an
20
+ * import-time one, handled inside `threads.spawn` itself).
21
+ *
22
+ * `tests/headless-smoke.test.ts` is the proof: it imports this entry in plain Node
23
+ * with no DOM/WebGL globals, walks the reachable import graph for a renderer leak,
24
+ * and runs a seeded scenario through it twice for the same result.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * import {
29
+ * actors,
30
+ * ai,
31
+ * assetBinary,
32
+ * assetPaths,
33
+ * audio,
34
+ * battle,
35
+ * board,
36
+ * core,
37
+ * i18n,
38
+ * mwl,
39
+ * roguelike,
40
+ * rpg,
41
+ * simulation,
42
+ * testing,
43
+ * world,
44
+ * } from '@datamoc/mw_games/headless';
45
+ *
46
+ * // deterministic rules with no renderer: a seeded stream plus one headless scenario
47
+ * const random = new core.Generator(7);
48
+ * const result = simulation.runScenario({
49
+ * state: { value: 0 },
50
+ * commands: [1, 2, 3],
51
+ * random,
52
+ * step: (state, command, rng) => ({
53
+ * state: { value: state.value + command + rng.int(2) },
54
+ * events: [],
55
+ * status: 'ready' as const,
56
+ * }),
57
+ * });
58
+ *
59
+ * // every other member rides the same entry: content, rules, saves, and the two
60
+ * // renderer-free asset halves (path resolution and byte caching with no loader)
61
+ * const tables = mwl.MWL_SCHEMA_10;
62
+ * const present = assetPaths.has('tiles/grass.png');
63
+ * const cached = assetBinary.isBinaryLoaded('sfx/hit.mp3');
64
+ * const check = { actors, ai, audio, battle, board, i18n, roguelike, rpg, testing, world };
65
+ * void result;
66
+ * void tables;
67
+ * void present;
68
+ * void cached;
69
+ * void check;
70
+ * ```
71
+ */
72
+ export * as core from '../core/index.js';
73
+ export * as simulation from '../simulation/index.js';
74
+ export * as mwl from '../mwl/index.js';
75
+ export * as i18n from '../i18n/index.js';
76
+ export * as actors from '../actors/index.js';
77
+ export * as world from '../world/index.js';
78
+ export * as battle from '../battle/index.js';
79
+ export * as roguelike from '../roguelike/index.js';
80
+ export * as board from '../board/index.js';
81
+ export * as audio from '../audio/index.js';
82
+ export * as rpg from '../rpg/index.js';
83
+ export * as ai from '../ai/index.js';
84
+ export * as testing from '../testing/index.js';
85
+ export * as assetPaths from '../assets/paths.js';
86
+ export * as assetBinary from '../assets/binary.js';
87
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/headless/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC"}