@kradle/challenges-sdk 0.12.0 → 0.13.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 (85) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/LLM_README.md +285 -192
  3. package/MIGRATION-0.13.md +109 -0
  4. package/README.md +97 -88
  5. package/dist/engine.d.ts +8 -0
  6. package/dist/engine.d.ts.map +1 -0
  7. package/dist/engine.js +17 -0
  8. package/dist/engine.js.map +1 -0
  9. package/dist/index.d.ts +19 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +42 -16
  12. package/dist/index.js.map +1 -1
  13. package/dist/runtime/builder.d.ts +33 -0
  14. package/dist/runtime/builder.d.ts.map +1 -0
  15. package/dist/runtime/builder.js +357 -0
  16. package/dist/runtime/builder.js.map +1 -0
  17. package/dist/runtime/errors.d.ts +61 -0
  18. package/dist/runtime/errors.d.ts.map +1 -0
  19. package/dist/runtime/errors.js +71 -0
  20. package/dist/runtime/errors.js.map +1 -0
  21. package/dist/runtime/reducer.d.ts +205 -0
  22. package/dist/runtime/reducer.d.ts.map +1 -0
  23. package/dist/runtime/reducer.js +2025 -0
  24. package/dist/runtime/reducer.js.map +1 -0
  25. package/dist/runtime/rules.d.ts +29 -0
  26. package/dist/runtime/rules.d.ts.map +1 -0
  27. package/dist/runtime/rules.js +23 -0
  28. package/dist/runtime/rules.js.map +1 -0
  29. package/dist/runtime/sandbox.d.ts +2 -1
  30. package/dist/runtime/sandbox.d.ts.map +1 -1
  31. package/dist/runtime/sandbox.js +7 -4
  32. package/dist/runtime/sandbox.js.map +1 -1
  33. package/dist/runtime/time.d.ts +33 -0
  34. package/dist/runtime/time.d.ts.map +1 -0
  35. package/dist/runtime/time.js +53 -0
  36. package/dist/runtime/time.js.map +1 -0
  37. package/dist/runtime/types.d.ts +963 -0
  38. package/dist/runtime/types.d.ts.map +1 -0
  39. package/dist/runtime/types.js +25 -0
  40. package/dist/runtime/types.js.map +1 -0
  41. package/dist/runtime/wire.d.ts +858 -0
  42. package/dist/runtime/wire.d.ts.map +1 -0
  43. package/dist/runtime/wire.js +28 -0
  44. package/dist/runtime/wire.js.map +1 -0
  45. package/dist/runtime/world.d.ts +58 -3
  46. package/dist/runtime/world.d.ts.map +1 -1
  47. package/dist/runtime/world.js +12 -0
  48. package/dist/runtime/world.js.map +1 -1
  49. package/dist/structures.d.ts +119 -0
  50. package/dist/structures.d.ts.map +1 -0
  51. package/dist/structures.js +279 -0
  52. package/dist/structures.js.map +1 -0
  53. package/dist/test/harness.d.ts +133 -29
  54. package/dist/test/harness.d.ts.map +1 -1
  55. package/dist/test/harness.js +191 -66
  56. package/dist/test/harness.js.map +1 -1
  57. package/dist/test/helpers.d.ts +3 -2
  58. package/dist/test/helpers.d.ts.map +1 -1
  59. package/dist/test/helpers.js +2 -2
  60. package/dist/test/helpers.js.map +1 -1
  61. package/package.json +28 -6
  62. package/dist/runtime/examples/capture-the-flag.d.ts +0 -33
  63. package/dist/runtime/examples/capture-the-flag.d.ts.map +0 -1
  64. package/dist/runtime/examples/capture-the-flag.js +0 -79
  65. package/dist/runtime/examples/capture-the-flag.js.map +0 -1
  66. package/dist/runtime/examples/climb.d.ts +0 -34
  67. package/dist/runtime/examples/climb.d.ts.map +0 -1
  68. package/dist/runtime/examples/climb.js +0 -54
  69. package/dist/runtime/examples/climb.js.map +0 -1
  70. package/dist/runtime/examples/four-bridges.d.ts +0 -107
  71. package/dist/runtime/examples/four-bridges.d.ts.map +0 -1
  72. package/dist/runtime/examples/four-bridges.js +0 -294
  73. package/dist/runtime/examples/four-bridges.js.map +0 -1
  74. package/dist/runtime/examples/herding.d.ts +0 -59
  75. package/dist/runtime/examples/herding.d.ts.map +0 -1
  76. package/dist/runtime/examples/herding.js +0 -181
  77. package/dist/runtime/examples/herding.js.map +0 -1
  78. package/dist/runtime/examples/skywars.d.ts +0 -116
  79. package/dist/runtime/examples/skywars.d.ts.map +0 -1
  80. package/dist/runtime/examples/skywars.js +0 -253
  81. package/dist/runtime/examples/skywars.js.map +0 -1
  82. package/dist/runtime/sdk.d.ts +0 -1038
  83. package/dist/runtime/sdk.d.ts.map +0 -1
  84. package/dist/runtime/sdk.js +0 -1271
  85. package/dist/runtime/sdk.js.map +0 -1
@@ -0,0 +1,279 @@
1
+ "use strict";
2
+ // Structures: `@kradle/challenges-sdk/structures`. A template of blocks to place and to compare
3
+ // against the world mirror, with rotations. Pure functions over the read-only context.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.defineStructure = defineStructure;
6
+ exports.compareStructure = compareStructure;
7
+ exports.placeStructure = placeStructure;
8
+ exports.structureBox = structureBox;
9
+ const errors_js_1 = require("./runtime/errors.js");
10
+ const reducer_js_1 = require("./runtime/reducer.js");
11
+ const AIR = "minecraft:air";
12
+ // ---------------------------------------------------------------- the rotation table
13
+ const FACING = { north: "east", east: "south", south: "west", west: "north" };
14
+ /** A jigsaw's `orientation` (`north_up`, `up_east`, ...): each horizontal part turns, `up` and `down` stay. */
15
+ const rotateOrientation = (v) => v
16
+ .split("_")
17
+ .map((part) => FACING[part] ?? part)
18
+ .join("_");
19
+ const AXIS = { x: "z", z: "x", y: "y" };
20
+ /** Rail shapes, one quarter turn clockwise. */
21
+ const RAIL_SHAPE = {
22
+ north_south: "east_west",
23
+ east_west: "north_south",
24
+ ascending_north: "ascending_east",
25
+ ascending_east: "ascending_south",
26
+ ascending_south: "ascending_west",
27
+ ascending_west: "ascending_north",
28
+ north_east: "south_east",
29
+ south_east: "south_west",
30
+ south_west: "north_west",
31
+ north_west: "north_east",
32
+ };
33
+ /** Stair shapes: the left/right side swaps with each quarter turn keep their names, the direction is in `facing`. */
34
+ const STAIR_SHAPE = new Set(["straight", "inner_left", "inner_right", "outer_left", "outer_right"]);
35
+ /** The four side-connection properties of fences, walls, panes and redstone (`north=true`...). */
36
+ const SIDES = ["north", "east", "south", "west"];
37
+ const SIDE_NEXT = { north: "east", east: "south", south: "west", west: "north" };
38
+ /** Rotates one block state a quarter turn clockwise, or throws for a property the table does not know. */
39
+ function rotateState(spec) {
40
+ if (typeof spec === "string" || !spec.props)
41
+ return spec;
42
+ const out = {};
43
+ const pending = {};
44
+ for (const [k, v] of Object.entries(spec.props)) {
45
+ if (k === "facing") {
46
+ if (v === "up" || v === "down")
47
+ out[k] = v;
48
+ else if (FACING[v])
49
+ out[k] = FACING[v];
50
+ else
51
+ throw (0, errors_js_1.apiError)("bad_rotation", `facing=${v} cannot rotate`);
52
+ }
53
+ else if (k === "axis")
54
+ out[k] = AXIS[v] ?? v;
55
+ else if (k === "rotation")
56
+ out[k] = String((Number(v) + 4) % 16);
57
+ else if (k === "shape" && RAIL_SHAPE[v])
58
+ out[k] = RAIL_SHAPE[v];
59
+ else if (k === "shape" && STAIR_SHAPE.has(v))
60
+ out[k] = v;
61
+ else if (k === "orientation")
62
+ out[k] = rotateOrientation(v);
63
+ else if (SIDES.includes(k))
64
+ pending[SIDE_NEXT[k]] = v;
65
+ else
66
+ out[k] = v;
67
+ }
68
+ return {
69
+ id: spec.id,
70
+ props: { ...out, ...pending },
71
+ ...(spec.blockEntity !== undefined ? { blockEntity: spec.blockEntity } : {}),
72
+ };
73
+ }
74
+ function rotateMatch(match, times) {
75
+ if (match === undefined || typeof match === "function")
76
+ return match;
77
+ let spec = typeof match === "string" ? match : match.props ? { id: match.id, props: match.props } : { id: match.id };
78
+ for (let i = 0; i < times; i++)
79
+ spec = rotateState(spec);
80
+ return typeof spec === "string" ? spec : spec.props ? { id: spec.id, props: spec.props } : { id: spec.id };
81
+ }
82
+ /** The directional properties the table knows; anything else with a direction is refused at definition. */
83
+ const KNOWN = new Set(["facing", "axis", "rotation", "shape", "orientation", ...SIDES]);
84
+ const DIRECTIONAL_VALUES = new Set(["north", "east", "south", "west"]);
85
+ function assertRotatable(spec, symbol) {
86
+ if (typeof spec === "string" || !spec.props)
87
+ return;
88
+ for (const [k, v] of Object.entries(spec.props)) {
89
+ if (KNOWN.has(k))
90
+ continue;
91
+ if (DIRECTIONAL_VALUES.has(v)) {
92
+ throw (0, errors_js_1.definitionError)("bad_rotation", `palette "${symbol}": the property ${k}=${v} is directional and the rotation table does not know it`, {
93
+ path: `palette.${symbol}`,
94
+ value: k,
95
+ });
96
+ }
97
+ }
98
+ }
99
+ // ---------------------------------------------------------------- define, compare, place
100
+ /** A block state string (`minecraft:oak_stairs[facing=east]`) as `{ id, props }`, so its properties rotate and match one by one. */
101
+ function normalizeSpec(spec) {
102
+ if (typeof spec !== "string" || !spec.includes("["))
103
+ return spec;
104
+ const { id, props } = (0, reducer_js_1.parseBlockState)(spec);
105
+ return { id, props: { ...props } };
106
+ }
107
+ /** The same for a match: a state string becomes a property match; a function stays. */
108
+ function normalizeMatch(match) {
109
+ if (typeof match === "function" || typeof match !== "string" || !match.includes("["))
110
+ return match;
111
+ const { id, props } = (0, reducer_js_1.parseBlockState)(match);
112
+ return { id, props: { ...props } };
113
+ }
114
+ /**
115
+ * Builds a structure from text layers and a palette. Throws a definition error on an unknown symbol or a
116
+ * ragged layer. A block state string in the palette is read as `{ id, props }`: its properties rotate with
117
+ * the structure, and a cell matches when the block has those properties (more properties are fine).
118
+ */
119
+ function defineStructure(decl) {
120
+ const air = decl.air ?? ".";
121
+ const ignore = decl.ignore ?? "?";
122
+ const cells = [];
123
+ let sx = 0;
124
+ let sz = 0;
125
+ decl.layers.forEach((layer, y) => {
126
+ layer.forEach((row, z) => {
127
+ if (layer[0] !== undefined && row.length !== layer[0].length) {
128
+ throw (0, errors_js_1.definitionError)("bad_layer", `layers[${y}]: every row needs the same length`, { path: `layers.${y}` });
129
+ }
130
+ sz = Math.max(sz, layer.length);
131
+ sx = Math.max(sx, row.length);
132
+ [...row].forEach((symbol, x) => {
133
+ if (symbol === ignore)
134
+ return;
135
+ if (symbol === air) {
136
+ cells.push({ x, y, z, place: AIR, match: undefined });
137
+ return;
138
+ }
139
+ const entry = decl.palette[symbol];
140
+ if (!entry) {
141
+ throw (0, errors_js_1.definitionError)("bad_symbol", `layers[${y}][${z}]: the symbol "${symbol}" is not in the palette`, {
142
+ path: `layers.${y}.${z}`,
143
+ value: symbol,
144
+ allowed: Object.keys(decl.palette),
145
+ });
146
+ }
147
+ const placeSpec = normalizeSpec(entry.place);
148
+ const match = entry.match !== undefined
149
+ ? normalizeMatch(entry.match)
150
+ : typeof placeSpec === "string"
151
+ ? placeSpec
152
+ : placeSpec.props
153
+ ? { id: placeSpec.id, props: placeSpec.props }
154
+ : { id: placeSpec.id };
155
+ if (decl.rotations) {
156
+ assertRotatable(placeSpec, symbol);
157
+ if (typeof match !== "function")
158
+ assertRotatable(match, symbol);
159
+ }
160
+ cells.push({ x, y, z, place: placeSpec, match });
161
+ });
162
+ });
163
+ });
164
+ return { cells, size: { x: sx, y: decl.layers.length, z: sz }, rotations: decl.rotations === true };
165
+ }
166
+ /** A structure cell's world position for a rotation (clockwise seen from above); the rotated footprint keeps its minimum corner at `origin`. */
167
+ function place(cell, origin, rotation, size) {
168
+ const ox = Math.floor(origin.x);
169
+ const oy = Math.floor(origin.y);
170
+ const oz = Math.floor(origin.z);
171
+ let x = cell.x;
172
+ let z = cell.z;
173
+ const w = size.x - 1;
174
+ const d = size.z - 1;
175
+ if (rotation === 90)
176
+ [x, z] = [d - z, cell.x];
177
+ else if (rotation === 180)
178
+ [x, z] = [w - cell.x, d - z];
179
+ else if (rotation === 270)
180
+ [x, z] = [z, w - cell.x];
181
+ return { x: ox + x, y: oy + cell.y, z: oz + z };
182
+ }
183
+ function matches(actual, match) {
184
+ if (match === undefined)
185
+ return actual.id === AIR;
186
+ if (typeof match === "function")
187
+ return match(actual);
188
+ if (typeof match === "string") {
189
+ const i = match.indexOf("[");
190
+ if (i < 0)
191
+ return actual.id === match;
192
+ return blockString(actual) === match;
193
+ }
194
+ if (actual.id !== match.id)
195
+ return false;
196
+ return Object.entries(match.props ?? {}).every(([k, v]) => actual.props[k] === v);
197
+ }
198
+ function blockString(state) {
199
+ const entries = Object.entries(state.props);
200
+ if (entries.length === 0)
201
+ return state.id;
202
+ return `${state.id}[${entries.map(([k, v]) => `${k}=${v}`).join(",")}]`;
203
+ }
204
+ function compareAt(g, s, origin, rotation) {
205
+ const turns = rotation / 90;
206
+ const mismatched = [];
207
+ const unknown = [];
208
+ let matched = 0;
209
+ for (const cell of s.cells) {
210
+ const at = place(cell, origin, rotation, s.size);
211
+ const actual = g.blockStateAt(at);
212
+ if (actual === undefined) {
213
+ unknown.push(at);
214
+ continue;
215
+ }
216
+ const match = rotateMatch(cell.match, turns);
217
+ if (matches(actual, match))
218
+ matched += 1;
219
+ else
220
+ mismatched.push({ ...at, expected: match ?? "air", actual });
221
+ }
222
+ return { complete: mismatched.length === 0 && unknown.length === 0, matched, mismatched, unknown, rotation };
223
+ }
224
+ /**
225
+ * Compares the structure with the world at `origin`. `rotation: "any"` tries 0, 90, 180 and 270 in that
226
+ * order and returns the first complete report, else the one with the fewest mismatches (the lowest angle on
227
+ * a tie). Unknown cells (an unloaded chunk) are reported, never counted as mismatches.
228
+ */
229
+ function compareStructure(g, s, origin, opts = {}) {
230
+ const rotation = opts.rotation ?? 0;
231
+ if (rotation !== 0 && !s.rotations) {
232
+ throw (0, errors_js_1.apiError)("bad_rotation", "compareStructure: the structure was defined without rotations");
233
+ }
234
+ if (rotation !== "any")
235
+ return compareAt(g, s, origin, rotation);
236
+ let best;
237
+ for (const r of [0, 90, 180, 270]) {
238
+ const report = compareAt(g, s, origin, r);
239
+ if (report.complete)
240
+ return report;
241
+ if (!best || report.mismatched.length < best.mismatched.length)
242
+ best = report;
243
+ }
244
+ return best;
245
+ }
246
+ /** Queues one `setBlock` per cell of the structure at `origin`, with the rotation. Ignored cells are left alone. */
247
+ function placeStructure(g, s, origin, opts = {}) {
248
+ const rotation = opts.rotation ?? 0;
249
+ if (rotation !== 0 && !s.rotations) {
250
+ throw (0, errors_js_1.apiError)("bad_rotation", "placeStructure: the structure was defined without rotations");
251
+ }
252
+ const turns = rotation / 90;
253
+ for (const cell of s.cells) {
254
+ let spec = cell.place;
255
+ for (let i = 0; i < turns; i++)
256
+ spec = rotateState(spec);
257
+ g.setBlock(place(cell, origin, rotation, s.size), spec);
258
+ }
259
+ }
260
+ /** The world positions of the structure's cells at `origin`, for a bounding box or a zone. */
261
+ function structureBox(s, origin, rotation = 0) {
262
+ const corners = [
263
+ place({ x: 0, y: 0, z: 0 }, origin, rotation, s.size),
264
+ place({ x: s.size.x - 1, y: s.size.y - 1, z: s.size.z - 1 }, origin, rotation, s.size),
265
+ ];
266
+ return {
267
+ from: {
268
+ x: Math.min(corners[0].x, corners[1].x),
269
+ y: Math.min(corners[0].y, corners[1].y),
270
+ z: Math.min(corners[0].z, corners[1].z),
271
+ },
272
+ to: {
273
+ x: Math.max(corners[0].x, corners[1].x),
274
+ y: Math.max(corners[0].y, corners[1].y),
275
+ z: Math.max(corners[0].z, corners[1].z),
276
+ },
277
+ };
278
+ }
279
+ //# sourceMappingURL=structures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structures.js","sourceRoot":"","sources":["../src/structures.ts"],"names":[],"mappings":";AAAA,gGAAgG;AAChG,uFAAuF;;AAmNvF,0CA6CC;AAgED,4CAqBC;AAGD,wCAmBC;AAGD,oCA0BC;AAtYD,mDAAgE;AAChE,qDAAuD;AAsGvD,MAAM,GAAG,GAAY,eAAe,CAAC;AAErC,sFAAsF;AAEtF,MAAM,MAAM,GAA2B,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACtG,+GAA+G;AAC/G,MAAM,iBAAiB,GAAG,CAAC,CAAS,EAAU,EAAE,CAC/C,CAAC;KACC,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;KACnC,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,MAAM,IAAI,GAA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AI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvC;KACD,CAAC;AACH,CAAC"}
@@ -1,6 +1,10 @@
1
- import { type Action, type GameMode, type AnyChallenge, type Block, type Box, type Capability, type Duration, type Effect, type EntityType, type Event, type Json, type Marker, type PlayerSample, type Vec3 } from "../runtime/sdk.js";
2
- /** The state type of a challenge, as `init()` returns it. */
3
- export type StateOf<Ch extends AnyChallenge> = ReturnType<Ch["init"]>;
1
+ import type { AnyChallenge } from "../runtime/builder.js";
2
+ import type { State } from "../runtime/reducer.js";
3
+ import { type Duration } from "../runtime/time.js";
4
+ import type { DeepReadonly } from "../runtime/types.js";
5
+ import { type Action, type BlockId, type Box, type Capability, type Effect, type EntityTypeId, type Event, type GameMode, type ItemId, type Json, type Marker, type PlayerSample, type SlotChange, type Vec3 } from "../runtime/wire.js";
6
+ /** The full reducer state, as a test reads it. */
7
+ export type ReducerState = DeepReadonly<State>;
4
8
  /** JSON with sorted keys, so key order never counts as a difference. */
5
9
  export declare const canonical: (v: unknown) => string;
6
10
  /**
@@ -15,61 +19,115 @@ export declare const canonical: (v: unknown) => string;
15
19
  export declare function sandboxed<Ch extends AnyChallenge>(challenge: Ch): Promise<Ch>;
16
20
  /** A roster entry: the role, or the role with the player's position and sample fields before the first tick. */
17
21
  export type RosterEntry = string | ({
22
+ /** The role id. */
18
23
  role: string;
24
+ /** Where the player stands at `begin`; `defaultPosition(i)` without it. */
19
25
  at?: Vec3;
20
26
  } & Partial<Omit<PlayerSample, "name" | "participant" | "pos">>);
27
+ /** Where `begin` puts a participant without an `at`: a row along x, two blocks apart. */
28
+ export declare const defaultPosition: (index: number) => Vec3;
29
+ /** A fake engine around one challenge: feeds events, keeps the state, records the actions. */
21
30
  export declare class Game<Ch extends AnyChallenge> {
22
31
  readonly challenge: Ch;
23
- state: StateOf<Ch>;
32
+ /** The whole reducer state: the SDK's fields, the players, the votes, the mirror. */
33
+ reducerState: State;
34
+ /** Every event dispatched so far. */
24
35
  log: Event[];
36
+ /** Every action returned so far. */
25
37
  actions: Action[];
38
+ /** The actions of the last dispatch. */
26
39
  last: Action[];
27
- /** The harness's tick step, a test setting: server ticks arrive in steps of 4 here (the arena sends every 2 ticks by default). */
40
+ /** The harness's tick step, a test setting. The arena sends every server tick, so the default is 1. */
28
41
  step: number;
29
42
  private attempts;
30
43
  /** The state this game started from: `init()`, or the checkpoint of `resume`. `replay` starts here. */
31
44
  private readonly origin;
32
45
  /** Inventory slots the fake players used, per player and item, for this game only. */
33
46
  private readonly slots;
34
- constructor(challenge: Ch, state?: StateOf<Ch>);
47
+ constructor(challenge: Ch, state?: State);
48
+ /** The shared challenge data (`g.state` in a rule). */
49
+ get state(): Record<string, unknown>;
50
+ /** The current phase; `null` before the first entry and without phases. */
51
+ get phase(): string | null;
52
+ /** The run's stage. */
53
+ get status(): State["status"];
54
+ /** One participant's reducer record: observations, `state`, `score`. */
55
+ participant(name: string): State["players"][string];
56
+ /** One reduction. Asserts that `reduce` did not mutate its input. */
35
57
  dispatch(event: Event): Action[];
36
58
  /** Ticks in steps of `step`, and lands exactly on `serverTick` (the last step is shorter when needed). */
37
59
  tickTo(serverTick: number): void;
60
+ /** Advances `n` engine steps of `step` ticks each. */
38
61
  tick(n?: number): void;
39
62
  /** Advance by a duration: "35s", "2m", or ticks. */
40
63
  after(d: Duration | number): void;
41
64
  /** Advance until `d` after game start. */
42
65
  at(d: Duration | number): void;
43
66
  /**
44
- * run_started, every join, the first tick, and the setup confirmation when the
45
- * challenge has a setup. A roster entry is a role (`{ alice: "climber" }`), or the
46
- * role with the player's position and sample fields (`{ alice: { role: "climber",
47
- * at: { x: 0, y: -60, z: 0 } } }`): the first tick then carries that sample, so
48
- * `start` and the setup see the position, as they do in the arena. Without `at`
49
- * the position stays null until the first `moveTo`.
67
+ * run_started, every join, the first tick with every participant's position, and the setup
68
+ * confirmations when the challenge has a setup. A roster entry is a role (`{ alice: "climber" }`),
69
+ * or the role with the player's position and sample fields (`{ alice: { role: "climber",
70
+ * at: { x: 0, y: -60, z: 0 } } }`). Without `at` a participant gets `defaultPosition(i)`, so the
71
+ * initializers and `start` see a position, as they do in the arena. `positions: false` sends no
72
+ * sample: the run stays in CONNECTING until a test moves every player.
50
73
  */
51
74
  begin(seed: number, participants: Record<string, RosterEntry>, opts?: {
75
+ /** The run's parameter values over the declared defaults. */
52
76
  params?: Record<string, Json>;
77
+ /** What the engine supplies; every capability without it. */
53
78
  capabilities?: Capability[];
79
+ /** `false`: the first setup batch fails. */
54
80
  setupOk?: boolean;
81
+ /** `false`: no position sample; the run stays in CONNECTING until a test moves every player. */
82
+ positions?: boolean;
83
+ /** The coordinates of the declared locations, by name. */
55
84
  locations?: Record<string, Vec3>;
85
+ /** The tagged entities the engine read before the game. */
56
86
  markers?: Marker[];
57
87
  }): this;
88
+ /** Answers every pending setup batch in order (each confirmation may send the next one), from the reducer state. */
89
+ confirmSetup(ok?: boolean): void;
90
+ /** Answers a named batch (`g.batch(name, ...)`): the engine ran it, with the failed effects listed. */
91
+ batchResult(name: string, ok: boolean, failed?: Array<{
92
+ /** The effect's index in the batch. */
93
+ index: number;
94
+ /** Why it failed. */
95
+ detail: string;
96
+ }>): void;
97
+ /** A scripted participant. */
58
98
  player(name: string): Fake<Ch>;
99
+ /** A custom server event, with its JSON data. */
59
100
  custom(name: string, data: Json, player?: string): Action[];
60
101
  /** Loads the chunks that cover `box` into the mirror: `block` inside the box, air around it. */
61
- terrain(box: Box, block: Block, minY?: number, height?: number): Action[];
102
+ terrain(box: Box, block: BlockId, minY?: number, height?: number): Action[];
103
+ /** Loads an all-air chunk column at chunk coordinates (`cx`, `cz`). */
104
+ loadChunk(cx: number, cz: number, minY?: number): Action[];
105
+ /** The engine unloaded a chunk: its blocks and containers leave the mirror. */
106
+ unloadChunk(cx: number, cz: number): Action[];
62
107
  /** Blocks changed on the server, by anyone or anything. */
63
108
  setBlocks(changes: Array<Vec3 & {
64
- block: Block;
109
+ /** The block state now. */
110
+ block: BlockId;
111
+ /** The player who did it, when one did. */
65
112
  by?: string;
113
+ /** What changed it (break, place, fill, ...). */
114
+ cause?: string;
66
115
  }>): Action[];
67
- spawnEntity(id: string, type: EntityType, at: Vec3, extra?: Partial<Omit<Extract<Event, {
116
+ /** The engine filled a box (the plugin's own fill). */
117
+ fillBlocks(from: Vec3, to: Vec3, block: BlockId): Action[];
118
+ /** A non-player entity appeared. */
119
+ spawnEntity(id: string, type: EntityTypeId, at: Vec3, extra?: Partial<Omit<Extract<Event, {
68
120
  type: "entity_spawned";
69
121
  }>, "type" | "id" | "entity" | "at">>): Action[];
122
+ /** An entity's reported fields changed. */
123
+ changeEntity(id: string, fields: Omit<Extract<Event, {
124
+ type: "entity_changed";
125
+ }>, "type" | "id">): Action[];
70
126
  /** Entities moved: they arrive with the next tick, so this advances one engine step. */
71
127
  moveEntities(moves: Array<{
128
+ /** The entity id. */
72
129
  id: string;
130
+ /** The new position. */
73
131
  pos: Vec3;
74
132
  }>): Action[];
75
133
  /**
@@ -78,33 +136,51 @@ export declare class Game<Ch extends AnyChallenge> {
78
136
  * A handler that reads another player's position sees this tick for everyone.
79
137
  */
80
138
  sample(players: Array<{
139
+ /** The player's name. */
81
140
  name: string;
82
141
  } & Partial<Omit<PlayerSample, "name" | "participant">>>, entities?: Array<{
142
+ /** The entity id. */
83
143
  id: string;
144
+ /** The new position. */
84
145
  pos: Vec3;
85
146
  }>): Action[];
147
+ /** An entity left the world. */
86
148
  removeEntity(id: string, cause?: "died" | "removed", killer?: string): Action[];
87
149
  /**
88
- * The contents of a declared container, as the engine reports them: `items` is the whole
89
- * content (item to count), laid out one item per slot. `by` names the player who had it open;
90
- * `initial` marks the first snapshot (no handler fires for it).
150
+ * A container's contents as the engine reports them: `items` is the whole content (item id to
151
+ * count), one item per slot. `by` names the player who moved the items when the engine is certain;
152
+ * `initial` marks the first snapshot (no handler fires); `removed` reports the block gone.
91
153
  */
92
154
  container(at: Vec3, items: Record<string, number>, opts?: {
155
+ /** The player who moved the items, when the engine is certain. */
93
156
  by?: string;
94
- block?: Block;
157
+ /** The container block; a chest by default. */
158
+ block?: BlockId;
159
+ /** `true`: the first snapshot of the container. */
95
160
  initial?: boolean;
161
+ /** `true`: the container block is gone. */
162
+ removed?: boolean;
96
163
  }): Action[];
97
164
  /** A game mode change reported by the engine (the `gamemode` event). */
98
165
  setGamemode(name: string, gamemode: GameMode): Action[];
99
166
  /** A non-participant player's sample (the watcher, a spectator), with the next tick. */
100
167
  other(name: string, sample: Omit<PlayerSample, "name" | "participant">): Action[];
168
+ /** The engine refused one effect. */
169
+ effectFailed(kind: string, detail: string, effect?: Effect, batch?: {
170
+ /** The batch's transport id (`batch:<n>`). */
171
+ id: string;
172
+ /** The effect's position in the batch. */
173
+ index: number;
174
+ }): Action[];
101
175
  /**
102
176
  * The engine's answer to a walk: the last one requested, or the last one for
103
177
  * `player` (or with `id`) when several are in flight. A walk that was already
104
178
  * answered is skipped.
105
179
  */
106
180
  walkResult(ok: boolean, detail?: string, which?: {
181
+ /** The walk of this player. */
107
182
  player?: string;
183
+ /** The walk with this request id. */
108
184
  id?: string;
109
185
  }): void;
110
186
  /** Actions of the last reduction, by type. */
@@ -127,6 +203,16 @@ export declare class Game<Ch extends AnyChallenge> {
127
203
  announcements(to?: string): string[];
128
204
  /** Every announcement of the run, public and private. */
129
205
  said(): string[];
206
+ /** The `game_over` action, once the game ended. */
207
+ result(): Extract<Action, {
208
+ type: "game_over";
209
+ }> | undefined;
210
+ /** Every log line of the run. */
211
+ logs(): Extract<Action, {
212
+ type: "log";
213
+ }>[];
214
+ /** The last value of every metric, global (`""` player key) and per player. */
215
+ metrics(): Record<string, Record<string, number>>;
130
216
  /**
131
217
  * The same log through the same reducer instance, from the state this game
132
218
  * started with (`init()`, or the checkpoint of `resume`), gives the same final
@@ -135,8 +221,11 @@ export declare class Game<Ch extends AnyChallenge> {
135
221
  * provides. A test calls it; `dispatch` does not.
136
222
  */
137
223
  replay(): void;
224
+ /** The state as a JSON string; `Game.resume` continues from it. */
138
225
  checkpoint(): string;
226
+ /** A game that continues from a checkpoint, as the arena does after a worker restart. */
139
227
  static resume<Ch extends AnyChallenge>(challenge: Ch, json: string): Game<Ch>;
228
+ /** A fresh attempt id for a vote or give request. */
140
229
  nextAttempt(): string;
141
230
  /** The slot a fake player's item occupies: the one the state shows, else the next free one, for this game only. */
142
231
  slotFor(name: string, item: string): number;
@@ -146,31 +235,46 @@ export declare class Fake<Ch extends AnyChallenge> {
146
235
  private readonly g;
147
236
  readonly name: string;
148
237
  constructor(g: Game<Ch>, name: string);
238
+ /** One position sample, as one server tick would carry it. */
149
239
  moveTo(to: Partial<Vec3> & {
240
+ /** The height; `x` and `z` keep the last sample's values without them. */
150
241
  y: number;
151
- }, extrema?: {
152
- maxY?: number;
153
- minY?: number;
154
242
  }): Action[];
155
- vote(voteId: string, option: string): {
243
+ /** A vote request, as the arena forwards it. `round` stamps the round the arena saw; default: the current one. */
244
+ vote(voteId: string, option: string, round?: number): {
245
+ /** Whether the reducer accepted the vote. */
156
246
  accepted: boolean;
247
+ /** The reducer's feedback to the voter, on a refusal. */
157
248
  feedback?: string | undefined;
158
249
  };
250
+ /** A public chat line. */
159
251
  says(text: string): Action[];
252
+ /** An arm swing: a mining or attack attempt. */
160
253
  swings(animation?: "swing" | "swing_off"): Action[];
254
+ /** Damage taken; `attacker` names another participant. */
161
255
  hurt(amount: number, cause: string, attacker?: string): Action[];
256
+ /** A death; `killer` names another participant. */
162
257
  dies(cause?: string, killer?: string): Action[];
258
+ /** A respawn after a death. */
163
259
  respawns(): Action[];
164
- picksUp(item: `minecraft:${string}`, count?: number, at?: Vec3): Action[];
260
+ /** The player connected. */
261
+ joins(): Action[];
262
+ /** The player disconnected. */
263
+ leaves(): Action[];
264
+ /** An item picked up from the ground. */
265
+ picksUp(item: ItemId, count?: number, at?: Vec3): Action[];
165
266
  /** The player's inventory now holds `count` of `item`: one slot per item name, in this game. */
166
- has(item: `minecraft:${string}`, count: number): Action[];
267
+ setInventory(item: ItemId, count: number, meta?: Omit<SlotChange, "slot" | "item" | "count">): Action[];
167
268
  /** Walks into the declared zone (its first corner); the SDK derives the edge. */
168
269
  enters(zone: string): Action[];
169
270
  /** Walks 100 blocks under the declared zone's first corner. */
170
- leaves(zone: string): Action[];
171
- uses(block: `minecraft:${string}`, at: Vec3, item?: `minecraft:${string}`): Action[];
172
- breaks(block: `minecraft:${string}`, at: Vec3): Action[];
173
- places(block: `minecraft:${string}`, at: Vec3): Action[];
271
+ exits(zone: string): Action[];
272
+ /** A right-click on a block; `item` is what the hand held. */
273
+ uses(block: BlockId, at: Vec3, item?: ItemId): Action[];
274
+ /** Breaks the block: the engine reports the state that was there and what is there now (air by default). */
275
+ breaks(block: BlockId, at: Vec3, after?: BlockId): Action[];
276
+ /** Places the block: the engine reports the placed state and the one it replaced (air by default). */
277
+ places(block: BlockId, at: Vec3, replaced?: BlockId): Action[];
174
278
  private zone;
175
279
  }
176
280
  //# sourceMappingURL=harness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../src/test/harness.ts"],"names":[],"mappings":"AAOA,OAAO,EACN,KAAK,MAAM,EACX,KAAK,QAAQ,EAEb,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,GAAG,EAER,KAAK,UAAU,EAEf,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,MAAM,EACX,KAAK,YAAY,EAEjB,KAAK,IAAI,EACT,MAAM,mBAAmB,CAAC;AAE3B,6DAA6D;AAC7D,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,YAAY,IAAI,UAAU,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AAEtE,wEAAwE;AACxE,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,KAAG,MAGrC,CAAC;AA2BH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