@moku-labs/game 0.15.28 → 0.15.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/app/page.d.mts +1 -1
  2. package/dist/app/page.mjs +1 -1
  3. package/dist/app/system.d.mts +3 -3
  4. package/dist/app.d.mts +3 -3
  5. package/dist/app.mjs +1 -1
  6. package/dist/assets.d.mts +1 -1
  7. package/dist/{commands-BJ4gG5WZ.d.mts → commands-BUfZJUx6.d.mts} +31 -31
  8. package/dist/control.d.mts +4 -4
  9. package/dist/control.mjs +2 -2
  10. package/dist/{define-CVYadV_I.d.mts → define-CE1uxbe9.d.mts} +2 -2
  11. package/dist/{headless-DBYmnluy.d.mts → headless-f31cEZ7f.d.mts} +1 -1
  12. package/dist/{index-Dn_v0Fqs.d.mts → index-B2GejbLf.d.mts} +26 -23
  13. package/dist/index.d.mts +4 -4
  14. package/dist/index.mjs +1 -1
  15. package/dist/inspect.d.mts +16 -16
  16. package/dist/inspect.mjs +2 -2
  17. package/dist/jsx-dev-runtime.d.mts +1 -1
  18. package/dist/jsx-runtime.d.mts +1 -1
  19. package/dist/{run-DRcc2SKF.mjs → run-DyL8rl2P.mjs} +15 -43
  20. package/dist/{runtime-DnjJ4Zo9.d.mts → runtime-HwTBjkIL.d.mts} +1 -1
  21. package/dist/{session-CeKgO2hy.mjs → session-DuZfGZWk.mjs} +20 -1
  22. package/dist/{sources-ncFMQIus.mjs → sources-DM5Zcl4o.mjs} +8 -17
  23. package/dist/{src-DPvSTM8O.mjs → src-B4JjsuEy.mjs} +1704 -603
  24. package/dist/testing.d.mts +4 -4
  25. package/dist/testing.mjs +1 -1
  26. package/dist/{types-bEJEga5m.d.mts → types-BAp9HdR4.d.mts} +10 -2
  27. package/dist/{types-Bsa1nFyU.d.mts → types-BWRJcZ3n.d.mts} +4 -4
  28. package/dist/{types-DTetCcBC.d.mts → types-CgE5L_7f.d.mts} +2 -2
  29. package/dist/{types-C_nC_M4p.d.mts → types-D27I4Q7b.d.mts} +312 -22
  30. package/dist/{types-C76NQm-h.d.mts → types-DjQkfbfZ.d.mts} +2 -2
  31. package/dist/{visual-BMRHt4IB.d.mts → visual-f6mtELhG.d.mts} +6 -6
  32. package/dist/visual.d.mts +1 -1
  33. package/dist/visual.mjs +2 -2
  34. package/llms.txt +12 -11
  35. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { a as sheetAlone, p as graphHash } from "./capture-PTJXDpxK.mjs";
2
2
  import { a as isDev, i as isControl, n as controlRefused, o as notInstalled, r as isAgent, t as controlReadOnly } from "./dev-BNndV-hU.mjs";
3
3
  import { n as reproBookmark } from "./headless-Bxxl_mQX.mjs";
4
- import { a as readTarget, i as isProjectionTarget, n as isTainted, o as inputOrEmpty, r as recordCheat, s as defineCommand } from "./session-CeKgO2hy.mjs";
4
+ import { a as readTarget, i as isProjectionTarget, l as inputSchema, n as isTainted, o as inputOrEmpty, r as recordCheat, s as defineCommand } from "./session-DuZfGZWk.mjs";
5
5
  //#region src/plugins/anim/control.ts
6
6
  /**
7
7
  * @file anim plugin — the anim command of the `/control` door: switch reduced motion. Dev and
@@ -54,7 +54,7 @@ const reducedMotionCommand = defineCommand({
54
54
  const muteCommand = defineCommand({
55
55
  id: "game.mute",
56
56
  title: "Mute",
57
- input: { muted: "boolean" },
57
+ input: inputSchema(["muted", "boolean"]),
58
58
  effect: "cosmetic",
59
59
  run: (app, { muted }) => {
60
60
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_AGENT__ === "undefined" || !__MOKU_GAME_AGENT__)) throw controlRefused();
@@ -91,10 +91,7 @@ const muteCommand = defineCommand({
91
91
  const filterCommand = defineCommand({
92
92
  id: "game.filter",
93
93
  title: "Filter kind on or off",
94
- input: {
95
- kind: "string",
96
- on: "boolean"
97
- },
94
+ input: inputSchema(["kind", "string"], ["on", "boolean"]),
98
95
  effect: "cosmetic",
99
96
  run: (app, { kind, on }) => {
100
97
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_AGENT__ === "undefined" || !__MOKU_GAME_AGENT__)) throw controlRefused();
@@ -148,10 +145,7 @@ function readPath(value) {
148
145
  const dragCommand = defineCommand({
149
146
  id: "game.drag",
150
147
  title: "Drag",
151
- input: {
152
- from: "json",
153
- to: "json"
154
- },
148
+ input: inputSchema(["from", "json"], ["to", "json"]),
155
149
  effect: "route",
156
150
  run: (app, { from, to }) => {
157
151
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
@@ -173,7 +167,7 @@ const dragCommand = defineCommand({
173
167
  const traceCommand = defineCommand({
174
168
  id: "game.trace",
175
169
  title: "Trace",
176
- input: { path: "json" },
170
+ input: inputSchema(["path", "json"]),
177
171
  effect: "route",
178
172
  run: (app, { path }) => {
179
173
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
@@ -195,10 +189,7 @@ const traceCommand = defineCommand({
195
189
  const keyCommand = defineCommand({
196
190
  id: "game.key",
197
191
  title: "Press a key",
198
- input: {
199
- key: "string",
200
- shift: "boolean?"
201
- },
192
+ input: inputSchema(["key", "string"], ["shift", "boolean?"]),
202
193
  effect: "route",
203
194
  run: (app, { key, shift = false }) => {
204
195
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
@@ -789,12 +780,7 @@ async function captureDiff(app, options, diff, raw) {
789
780
  const captureCommand = defineCommand({
790
781
  id: "game.capture",
791
782
  title: "Capture",
792
- input: {
793
- legend: "boolean?",
794
- layers: "json?",
795
- sheet: "json?",
796
- diff: "json?"
797
- },
783
+ input: inputSchema(["legend", "boolean?"], ["layers", "json?"], ["sheet", "json?"], ["diff", "json?"]),
798
784
  effect: "read",
799
785
  run: (app, input) => {
800
786
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_AGENT__ === "undefined" || !__MOKU_GAME_AGENT__)) throw controlRefused();
@@ -834,12 +820,7 @@ const captureCommand = defineCommand({
834
820
  const debugCommand = defineCommand({
835
821
  id: "game.debug",
836
822
  title: "Debug drawing",
837
- input: {
838
- nineSlice: "boolean?",
839
- verifyFrames: "boolean?",
840
- kept: "boolean?",
841
- overdraw: "boolean?"
842
- },
823
+ input: inputSchema(["nineSlice", "boolean?"], ["verifyFrames", "boolean?"], ["kept", "boolean?"], ["overdraw", "boolean?"]),
843
824
  effect: "cosmetic",
844
825
  run: (app, { nineSlice, verifyFrames, kept, overdraw }) => {
845
826
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_AGENT__ === "undefined" || !__MOKU_GAME_AGENT__)) throw controlRefused();
@@ -901,10 +882,7 @@ function checkScale(scale) {
901
882
  const stepCommand = defineCommand({
902
883
  id: "game.step",
903
884
  title: "Step frames",
904
- input: {
905
- frames: "number",
906
- deltaMs: "number?"
907
- },
885
+ input: inputSchema(["frames", "number"], ["deltaMs", "number?"]),
908
886
  effect: "cosmetic",
909
887
  run: (app, { frames, deltaMs = FRAME_MS }) => {
910
888
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_AGENT__ === "undefined" || !__MOKU_GAME_AGENT__)) throw controlRefused();
@@ -930,7 +908,7 @@ const stepCommand = defineCommand({
930
908
  const timeScaleCommand = defineCommand({
931
909
  id: "game.timeScale",
932
910
  title: "Time scale",
933
- input: { scale: "number" },
911
+ input: inputSchema(["scale", "number"]),
934
912
  effect: "cosmetic",
935
913
  run: (app, { scale }) => {
936
914
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_AGENT__ === "undefined" || !__MOKU_GAME_AGENT__)) throw controlRefused();
@@ -960,7 +938,7 @@ const timeScaleCommand = defineCommand({
960
938
  const frameRateCommand = defineCommand({
961
939
  id: "game.frameRate",
962
940
  title: "Frame rate",
963
- input: { fps: "number?" },
941
+ input: inputSchema(["fps", "number?"]),
964
942
  effect: "cosmetic",
965
943
  run: (app, { fps }) => {
966
944
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_AGENT__ === "undefined" || !__MOKU_GAME_AGENT__)) throw controlRefused();
@@ -1189,10 +1167,7 @@ function startBookmark(app, save) {
1189
1167
  const answerCommand = defineCommand({
1190
1168
  id: "game.answer",
1191
1169
  title: "Answer",
1192
- input: {
1193
- intent: "string",
1194
- payload: "json?"
1195
- },
1170
+ input: inputSchema(["intent", "string"], ["payload", "json?"]),
1196
1171
  effect: "route",
1197
1172
  run: (app, { intent, payload }) => {
1198
1173
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
@@ -1219,7 +1194,7 @@ const answerCommand = defineCommand({
1219
1194
  const walkCommand = defineCommand({
1220
1195
  id: "game.walk",
1221
1196
  title: "Walk a route",
1222
- input: { route: "json" },
1197
+ input: inputSchema(["route", "json"]),
1223
1198
  effect: "route",
1224
1199
  run: (app, { route }) => {
1225
1200
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
@@ -1285,10 +1260,7 @@ const bookmarkCommand = defineCommand({
1285
1260
  const restoreCommand = defineCommand({
1286
1261
  id: "game.restore",
1287
1262
  title: "Restore",
1288
- input: {
1289
- bookmark: "json?",
1290
- repro: "json?"
1291
- },
1263
+ input: inputSchema(["bookmark", "json?"], ["repro", "json?"]),
1292
1264
  effect: "raw",
1293
1265
  run: (app, input) => {
1294
1266
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
@@ -1344,7 +1316,7 @@ const saveExportCommand = defineCommand({
1344
1316
  const saveImportCommand = defineCommand({
1345
1317
  id: "game.saveImport",
1346
1318
  title: "Import a save",
1347
- input: { save: "json" },
1319
+ input: inputSchema(["save", "json"]),
1348
1320
  effect: "raw",
1349
1321
  run: async (app, { save }) => {
1350
1322
  if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
@@ -1,4 +1,4 @@
1
- import { _ as UiIntrinsicElements, a as JsxChild, t as DescriptionNode } from "./types-bEJEga5m.mjs";
1
+ import { _ as UiIntrinsicElements, a as JsxChild, t as DescriptionNode } from "./types-BAp9HdR4.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. */
@@ -13,6 +13,25 @@ function checkId(kind, id) {
13
13
  throw new Error(`[game] The ${kind} id "${id}" is not a dotted name.\n Name it like "game.position": camelCase words joined by dots.`);
14
14
  }
15
15
  /**
16
+ * Builds the input schema of a door without an object literal (F77). A literal such as
17
+ * `{ x: "number", y: "number" }` shares V8's hidden shape with the game's points and stores
18
+ * strings where they store numbers: V8 turns the fields of that shape tagged, and every fractional
19
+ * write into any `{ x, y }` then boxes a heap number. An object without a prototype is a
20
+ * dictionary and shares no shape with anything.
21
+ *
22
+ * @param entries - The fields, each `[name, kind]`.
23
+ * @returns The schema, an object without a prototype.
24
+ * @example
25
+ * ```ts
26
+ * inputSchema(["x", "number"], ["y", "number"]); // { x: "number", y: "number" }, no prototype
27
+ * ```
28
+ */
29
+ function inputSchema(...entries) {
30
+ const schema = Object.create(null);
31
+ for (const [name, kind] of entries) schema[name] = kind;
32
+ return schema;
33
+ }
34
+ /**
16
35
  * Declares a source: a read-only view the editor lists, reads and watches. The types flow from
17
36
  * the object: the input from `input`, the app from the `read` parameter, the output from its
18
37
  * result.
@@ -199,4 +218,4 @@ function recordCheat(app, id, input, frame) {
199
218
  sessions.set(app, session);
200
219
  }
201
220
  //#endregion
202
- export { readTarget as a, defineSource as c, isProjectionTarget as i, isTainted as n, inputOrEmpty as o, recordCheat as r, defineCommand as s, cheatsOf as t };
221
+ export { readTarget as a, defineSource as c, isProjectionTarget as i, inputSchema as l, isTainted as n, inputOrEmpty as o, recordCheat as r, defineCommand as s, cheatsOf as t };
@@ -1,6 +1,6 @@
1
1
  import { F as rootPoseOf, H as Shape, R as NineSlice, Y as Layer, j as parentOf, n as drawnRect, s as Box } from "./visual-ClVRMUAi.mjs";
2
2
  import { o as notInstalled } from "./dev-BNndV-hU.mjs";
3
- import { a as readTarget, c as defineSource, n as isTainted, o as inputOrEmpty, t as cheatsOf } from "./session-CeKgO2hy.mjs";
3
+ import { a as readTarget, c as defineSource, l as inputSchema, n as isTainted, o as inputOrEmpty, t as cheatsOf } from "./session-DuZfGZWk.mjs";
4
4
  //#region src/plugins/flow/doors/read.ts
5
5
  /**
6
6
  * @file flow/doors — `read` and `watch`, the `/inspect` side. Neither changes the game.
@@ -117,7 +117,7 @@ const assetsSource = defineSource({
117
117
  const soundsSource = defineSource({
118
118
  id: "game.sounds",
119
119
  title: "Sounds",
120
- input: { last: "number?" },
120
+ input: inputSchema(["last", "number?"]),
121
121
  changes: "frame",
122
122
  read: (app, { last }) => {
123
123
  if (app.audio === void 0) throw notInstalled("game.sounds", "audioPlugin");
@@ -283,10 +283,7 @@ const renderSource = defineSource({
283
283
  const atSource = defineSource({
284
284
  id: "game.at",
285
285
  title: "Under a point",
286
- input: {
287
- x: "number",
288
- y: "number"
289
- },
286
+ input: inputSchema(["x", "number"], ["y", "number"]),
290
287
  changes: "frame",
291
288
  read: (app, { x, y }) => {
292
289
  const point = app.renderer.viewport.toReference(x, y);
@@ -516,10 +513,7 @@ function carries(entity, component) {
516
513
  const entitiesSource = defineSource({
517
514
  id: "game.entities",
518
515
  title: "Entities",
519
- input: {
520
- owner: "string?",
521
- component: "string?"
522
- },
516
+ input: inputSchema(["owner", "string?"], ["component", "string?"]),
523
517
  changes: "frame",
524
518
  read: (app, { owner, component }) => app.world.ecs.snapshot().entities.filter((entity) => (owner === void 0 || entity.owner.name === owner) && (component === void 0 || carries(entity, component)))
525
519
  });
@@ -569,7 +563,7 @@ const projectionsSource = defineSource({
569
563
  const explainSource = defineSource({
570
564
  id: "game.explain",
571
565
  title: "Entity",
572
- input: { entity: "number" },
566
+ input: inputSchema(["entity", "number"]),
573
567
  changes: "frame",
574
568
  read: (app, { entity }) => {
575
569
  const row = app.world.ecs.snapshot().entities.find((candidate) => candidate.id === entity);
@@ -602,10 +596,7 @@ const explainSource = defineSource({
602
596
  const diffSource = defineSource({
603
597
  id: "game.diff",
604
598
  title: "Frame diff",
605
- input: {
606
- from: "number",
607
- to: "number"
608
- },
599
+ input: inputSchema(["from", "number"], ["to", "number"]),
609
600
  changes: "frame",
610
601
  read: (app, { from, to }) => app.world.ecs.diff(from, to)
611
602
  });
@@ -719,7 +710,7 @@ const positionSource = defineSource({
719
710
  const historySource = defineSource({
720
711
  id: "game.history",
721
712
  title: "History",
722
- input: { last: "number?" },
713
+ input: inputSchema(["last", "number?"]),
723
714
  changes: "edge",
724
715
  read: (app, { last }) => {
725
716
  const entries = app.flow.history();
@@ -771,7 +762,7 @@ const cheatsSource = defineSource({
771
762
  const logSource = defineSource({
772
763
  id: "game.log",
773
764
  title: "Log",
774
- input: { level: "string?" },
765
+ input: inputSchema(["level", "string?"]),
775
766
  changes: "frame",
776
767
  read: (app, { level }) => {
777
768
  const entries = app.log.trace();