@kradle/challenges-sdk 0.21.1 → 0.22.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.
- package/CHANGELOG.md +22 -1
- package/LLM_README.md +119 -11
- package/README.md +103 -3
- package/dist/engine.d.ts +1 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/runtime/dialog.d.ts +83 -0
- package/dist/runtime/dialog.d.ts.map +1 -0
- package/dist/runtime/dialog.js +95 -0
- package/dist/runtime/dialog.js.map +1 -0
- package/dist/runtime/reducer.d.ts +18 -1
- package/dist/runtime/reducer.d.ts.map +1 -1
- package/dist/runtime/reducer.js +120 -3
- package/dist/runtime/reducer.js.map +1 -1
- package/dist/runtime/types.d.ts +42 -3
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/types.js.map +1 -1
- package/dist/runtime/wire.d.ts +51 -1
- package/dist/runtime/wire.d.ts.map +1 -1
- package/dist/runtime/wire.js +1 -0
- package/dist/runtime/wire.js.map +1 -1
- package/dist/test/harness.d.ts +14 -0
- package/dist/test/harness.d.ts.map +1 -1
- package/dist/test/harness.js +23 -2
- package/dist/test/harness.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,26 @@ also hand-edit this file or the [Unreleased] section at any time.
|
|
|
17
17
|
|
|
18
18
|
## [Unreleased]
|
|
19
19
|
|
|
20
|
+
## [0.22.0] - 2026-10-14
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Use `g.dialog(player, definition)` to show a native Minecraft dialog during play. The player must be a connected human.
|
|
25
|
+
- `dialogResponse` returns `{ player, dialogId, buttonId, inputs }` once per display. Inputs support text, booleans, options, and number ranges.
|
|
26
|
+
- Use `g.clearDialog(player)` to close a dialog. Replacement, expiry, death, disconnect, and the game end invalidate its response.
|
|
27
|
+
- Dialogs accept 1-32 buttons and up to 16 inputs. The timeout defaults to 60 seconds and accepts one tick to one hour.
|
|
28
|
+
- Text agents receive no dialog. Escape closes the screen without a response. Use an explicit cancel button when the challenge needs a response.
|
|
29
|
+
- Use `g.command(cmd, name)` to get `{ name, ok, value?, error? }` through `commandResult`. Names are available during play, but not in `.setup`.
|
|
30
|
+
- A named `data get` returns NBT as JSON. Other commands return the vanilla integer result. Forked commands return the number of successful forks.
|
|
31
|
+
- JSON does not preserve NBT number types. NBT booleans become `0` or `1`. Values over 262,144 characters cause an error.
|
|
32
|
+
- The test helpers include `game.dialogResponse` and `game.commandResult`. A roster entry accepts `human: true`.
|
|
33
|
+
- Export `Dialog`, `DialogInput`, and `DialogValues` from the author API. The engine API also exports `DialogSpec` and `DialogValues`.
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- Add native dialog examples and input limits to the reference. A raw `/dialog` command does not create a `dialogResponse` event.
|
|
38
|
+
- Servers must support the selected response API. An unnamed `g.command(cmd)` retains its current behavior.
|
|
39
|
+
|
|
20
40
|
## [0.21.1] - 2026-10-14
|
|
21
41
|
|
|
22
42
|
### Changed
|
|
@@ -338,7 +358,8 @@ also hand-edit this file or the [Unreleased] section at any time.
|
|
|
338
358
|
- Voting primitives (`votedFor`, `promptVote`, `allVotesIn`, `assignDefaultVotes`) for challenges that use discuss-then-vote-then-act phases as an alternative to pad-based voting.
|
|
339
359
|
- Build-time validation of vote IDs and options against `KRADLE_CHALLENGE_VOTING_OPTIONS` (when set), matching the existing `getLocation`/`setEndState` pattern. `promptVote` also validates each announced option against the declared `votingOptions`.
|
|
340
360
|
|
|
341
|
-
[Unreleased]: https://github.com/Kradle-ai/challenges-sdk/compare/v0.
|
|
361
|
+
[Unreleased]: https://github.com/Kradle-ai/challenges-sdk/compare/v0.22.0...HEAD
|
|
362
|
+
[0.22.0]: https://github.com/Kradle-ai/challenges-sdk/compare/v0.21.1...v0.22.0
|
|
342
363
|
[0.21.1]: https://github.com/Kradle-ai/challenges-sdk/compare/v0.21.0...v0.21.1
|
|
343
364
|
[0.21.0]: https://github.com/Kradle-ai/challenges-sdk/compare/v0.20.0...v0.21.0
|
|
344
365
|
[0.20.0]: https://github.com/Kradle-ai/challenges-sdk/compare/v0.19.1...v0.20.0
|
package/LLM_README.md
CHANGED
|
@@ -13,13 +13,14 @@ This document is the API reference for AI agents that write Kradle challenges wi
|
|
|
13
13
|
7. [The Context](#the-context)
|
|
14
14
|
8. [Players and Entities](#players-and-entities)
|
|
15
15
|
9. [Structures](#structures)
|
|
16
|
-
10. [
|
|
17
|
-
11. [
|
|
18
|
-
12. [
|
|
19
|
-
13. [
|
|
20
|
-
14. [
|
|
21
|
-
15. [Common
|
|
22
|
-
16. [
|
|
16
|
+
10. [Native dialogs](#native-dialogs)
|
|
17
|
+
11. [Constraints](#constraints)
|
|
18
|
+
12. [Testing](#testing)
|
|
19
|
+
13. [Build and Run](#build-and-run)
|
|
20
|
+
14. [Complete Examples](#complete-examples)
|
|
21
|
+
15. [Common Patterns](#common-patterns)
|
|
22
|
+
16. [Common Gotchas](#common-gotchas)
|
|
23
|
+
17. [Tips for LLMs](#tips-for-llms)
|
|
23
24
|
|
|
24
25
|
---
|
|
25
26
|
|
|
@@ -63,6 +64,8 @@ A challenge folder holds `challenge.ts` (the rules), `config.ts` (the metadata a
|
|
|
63
64
|
|
|
64
65
|
**Effects.** `g.give`, `g.fill`, `g.teleport`, `g.say`... queue commands for the engine. They are applied on the next server tick and reported back as facts (a placed block comes back through the mirror). A refused effect arrives as `on.effectFailed`.
|
|
65
66
|
|
|
67
|
+
Use `g.dialog(player, definition)` and `g.clearDialog(player)` for [native dialogs](#native-dialogs).
|
|
68
|
+
|
|
66
69
|
**Phases.** Named stages of the game with their own `duration`, `until`, `enter`, `exit`, timed steps and handlers. A phase or end request from a callback applies after the callback returns: exit once, enter once.
|
|
67
70
|
|
|
68
71
|
**The result.** `outcome.scores` derives the scores after every reduction, `outcome.endWhen` ends the game, `outcome.winners` and `outcome.endState` classify it. The result is frozen before `onOver` and `judgeContext` see it.
|
|
@@ -161,6 +164,7 @@ The steps register behavior and return the same challenge object. Use one chain
|
|
|
161
164
|
| `container` | `{ at, block, items, changes, by?, removed }`: a container's contents changed. |
|
|
162
165
|
| `zoneEntered`, `zoneLeft` | `{ player, zone }` |
|
|
163
166
|
| `chat` | `{ player, text }` |
|
|
167
|
+
| `dialogResponse` | `{ player, dialogId, buttonId, inputs }`: one valid response to the current native dialog. |
|
|
164
168
|
| `animation` | `{ player, animation }`: `swing` or `swing_off`. |
|
|
165
169
|
| `gamemode` | `{ player, gamemode }` |
|
|
166
170
|
| `entitySpawned`, `entityChanged`, `entityRemoved` | `{ entity }`, `{ entity, was }`, `{ entity, cause, killer? }` |
|
|
@@ -168,6 +172,7 @@ The steps register behavior and return the same challenge object. Use one chain
|
|
|
168
172
|
| `walkDone` | `{ player, ok }` |
|
|
169
173
|
| `timer` | `{ name }` |
|
|
170
174
|
| `batchDone` | `{ name, ok, failed }` |
|
|
175
|
+
| `commandResult` | `{ name, ok, value?, error? }`: a command sent with `g.command(cmd, name)` returned. |
|
|
171
176
|
| `effectFailed` | `{ kind, detail, effect?, batch? }` |
|
|
172
177
|
| `custom` | `{ name, player?, data }` |
|
|
173
178
|
|
|
@@ -210,16 +215,46 @@ not in `say` or `tell`.
|
|
|
210
215
|
|
|
211
216
|
**Scores and roster.** `g.setScore(player, n)`, `g.addScore(player, delta)` (refused when `outcome.scores` exists), `g.eliminate(player)`, `g.random.int(lo, hi)`, `g.random.pick(items)`, `g.random.shuffle(items)`, `g.random.weighted(items)`.
|
|
212
217
|
|
|
213
|
-
**Effects.** `g.give(player, item, count?)` (`item` is an id or `{ id, count?, name?, lore?, enchantments?, damage?, components? }`; `components` is the raw item argument suffix such as `[enchantments={sharpness:1}]`, and a metadata field wins over the same component), `g.clear(player, item?, count?)`, `g.effect(player, { id, duration, amplifier? })`, `g.teleport(player, to)`, `g.kill(player)`, `g.gamemode(player, mode)`, `g.attribute(player, attribute, value)` (e.g. `minecraft:max_health`; no `generic.` prefix since Minecraft 1.21.2), `g.fill(from, to, block)`, `g.setBlock(at, block)` (`block` is an id or `{ id, props?, blockEntity? }`), `g.clone(from, to, dest, { mode? })` (copies the box so that its low corner lands at `dest`; `mode` is `replace`, `masked` or `move`; at most 32,768 blocks; `replace` and `masked` refuse an overlap, `move` accepts it), `g.summon(entity, at, { nbt? })`, `g.killEntities(types?)`, `g.time(value)`, `g.gamerule(rule, value)` (`rule` is a Minecraft 1.21.11+ id such as `minecraft:keep_inventory`; the old camelCase names are refused), `g.setSpawn(at)`, `g.worldBorder({ center?, size?, over? })`, `g.container(at, items)`, `g.command(cmd)` (runs a supported Minecraft command; see the command scope and limits below).
|
|
218
|
+
**Effects.** `g.give(player, item, count?)` (`item` is an id or `{ id, count?, name?, lore?, enchantments?, damage?, components? }`; `components` is the raw item argument suffix such as `[enchantments={sharpness:1}]`, and a metadata field wins over the same component), `g.clear(player, item?, count?)`, `g.effect(player, { id, duration, amplifier? })`, `g.teleport(player, to)`, `g.kill(player)`, `g.gamemode(player, mode)`, `g.attribute(player, attribute, value)` (e.g. `minecraft:max_health`; no `generic.` prefix since Minecraft 1.21.2), `g.fill(from, to, block)`, `g.setBlock(at, block)` (`block` is an id or `{ id, props?, blockEntity? }`), `g.clone(from, to, dest, { mode? })` (copies the box so that its low corner lands at `dest`; `mode` is `replace`, `masked` or `move`; at most 32,768 blocks; `replace` and `masked` refuse an overlap, `move` accepts it), `g.summon(entity, at, { nbt? })`, `g.killEntities(types?)`, `g.time(value)`, `g.gamerule(rule, value)` (`rule` is a Minecraft 1.21.11+ id such as `minecraft:keep_inventory`; the old camelCase names are refused), `g.setSpawn(at)`, `g.worldBorder({ center?, size?, over? })`, `g.container(at, items)`, `g.command(cmd, name?)` (runs a supported Minecraft command; with a name, `on.commandResult` reports what it returned; see the command scope and limits below).
|
|
219
|
+
|
|
220
|
+
Use `g.dialog(player, definition)` and `g.clearDialog(player)` for [native dialogs](#native-dialogs).
|
|
214
221
|
|
|
215
222
|
`g.command(cmd)` supports `data`, `dialog`, `difficulty`, `item`, `loot`, `rotate`, `swing`, `waypoint`, `spectate`, `seed`, `list`, `help`, and `version`.
|
|
216
223
|
It also supports the existing gameplay and block commands.
|
|
217
224
|
Vanilla command syntax and rules still apply.
|
|
218
225
|
Block and container changes reach the world observations, including closed containers, jukeboxes, lecterns, chiseled bookshelves, and decorated pots.
|
|
219
226
|
The typed `g.container` method does not accept jukeboxes, lecterns, chiseled bookshelves, or decorated pots.
|
|
220
|
-
The observations do not expose arbitrary NBT or command storage.
|
|
221
|
-
Native Minecraft clients show dialogs.
|
|
222
|
-
|
|
227
|
+
The observations do not expose arbitrary NBT or command storage; a named command can read them.
|
|
228
|
+
Native Minecraft clients show raw dialogs. Use `g.dialog` for button and input responses; text agents do not receive dialogs.
|
|
229
|
+
The printed text of a command does not return to the challenge. To read what a command returned, give it a name: `g.command(cmd, name)`.
|
|
230
|
+
`on.commandResult` then reports `{ name, ok, value?, error? }` on a later event.
|
|
231
|
+
`ok` is `false` when the command did nothing, failed, or was refused; `error` says why.
|
|
232
|
+
`value` is the NBT that a `data get` read, as JSON (an entity, a block entity, or command storage), or else the vanilla integer result (the count of `execute if entity`, for example).
|
|
233
|
+
A number loses its NBT type: `1b`, `1` and `1.0f` are all `1`, and a boolean in NBT is `0` or `1`. A value over 262,144 characters is an error.
|
|
234
|
+
A command that runs in several forks (`execute as @a run ...`) gives the count of the forks that succeeded, not the answer of one fork; `ok` is `true` when at least one succeeded.
|
|
235
|
+
The name is a free string: put what the handler needs in it (`"held:Steve"`). A name is available only while the game runs, not in `.setup`.
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
import { defineChallenge } from "@kradle/challenges-sdk";
|
|
239
|
+
import { config } from "./config";
|
|
240
|
+
|
|
241
|
+
export default defineChallenge(config, { life: "respawn" })
|
|
242
|
+
.on({
|
|
243
|
+
chat(g, { player, text }) {
|
|
244
|
+
if (text === "sword") g.command(`data get entity ${player.name} SelectedItem`, `held:${player.name}`);
|
|
245
|
+
},
|
|
246
|
+
commandResult(g, { name, ok, value, error }) {
|
|
247
|
+
if (!name.startsWith("held:")) return;
|
|
248
|
+
const holder = g.player(name.slice("held:".length));
|
|
249
|
+
if (!holder) return;
|
|
250
|
+
if (!ok) return g.tell(holder, `Nothing to read: ${error}`);
|
|
251
|
+
const item = value as { id: string; count: number };
|
|
252
|
+
g.tell(holder, `You hold ${item.count} ${item.id}`);
|
|
253
|
+
},
|
|
254
|
+
})
|
|
255
|
+
.outcome({ winners: () => [] });
|
|
256
|
+
```
|
|
257
|
+
|
|
223
258
|
Use absolute coordinates, or `execute at` for a position relative to an entity.
|
|
224
259
|
`place`, `tick`, and server control commands remain unavailable.
|
|
225
260
|
|
|
@@ -285,6 +320,79 @@ export default challenge;
|
|
|
285
320
|
|
|
286
321
|
---
|
|
287
322
|
|
|
323
|
+
## Native dialogs
|
|
324
|
+
|
|
325
|
+
Use `g.dialog(player, definition)` during play to show a native Minecraft dialog.
|
|
326
|
+
The player must have `human === true` and `connected === true`.
|
|
327
|
+
Text agents do not receive dialogs.
|
|
328
|
+
The server must support dialog responses.
|
|
329
|
+
|
|
330
|
+
```ts
|
|
331
|
+
import { defineChallenge } from "@kradle/challenges-sdk";
|
|
332
|
+
|
|
333
|
+
const challenge = defineChallenge({
|
|
334
|
+
name: "Upgrade choice",
|
|
335
|
+
challengeConfig: {},
|
|
336
|
+
roles: { player: { description: "Player", minParticipants: 1 } },
|
|
337
|
+
}, { life: "respawn" })
|
|
338
|
+
.start(g => {
|
|
339
|
+
for (const player of g.players) {
|
|
340
|
+
if (!player.human || !player.connected) continue;
|
|
341
|
+
g.dialog(player, {
|
|
342
|
+
id: "upgrade",
|
|
343
|
+
title: "Choose your upgrade",
|
|
344
|
+
inputs: [{ id: "label", type: "text", label: "Name", maxLength: 32 }],
|
|
345
|
+
buttons: [
|
|
346
|
+
{ id: "armor", label: "Better armor" },
|
|
347
|
+
{ id: "speed", label: "More speed" },
|
|
348
|
+
],
|
|
349
|
+
timeout: "60s",
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
})
|
|
353
|
+
.on({
|
|
354
|
+
dialogResponse(g, { player, dialogId, buttonId, inputs }) {
|
|
355
|
+
if (dialogId !== "upgrade") return;
|
|
356
|
+
g.log("Upgrade choice", { player, data: { buttonId, inputs } });
|
|
357
|
+
},
|
|
358
|
+
})
|
|
359
|
+
.outcome({ winners: () => [] });
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
`dialogResponse` supplies the authenticated player, the dialog ID, the button ID, and the input values.
|
|
363
|
+
`inputs` maps each input ID to a string, boolean, or number.
|
|
364
|
+
The server checks each value against the displayed field.
|
|
365
|
+
Challenge code must still check game rules before it grants an upgrade or changes a score.
|
|
366
|
+
|
|
367
|
+
| Input type | Fields | Response value |
|
|
368
|
+
| --- | --- | --- |
|
|
369
|
+
| `text` | `id`, `label`, optional `initial`, optional `maxLength` (default 32, maximum 1024) | String |
|
|
370
|
+
| `boolean` | `id`, `label`, optional `initial` (default false) | Boolean |
|
|
371
|
+
| `singleOption` | `id`, `label`, `options: [{ id, label }]`, optional `initial` option ID | Selected option ID |
|
|
372
|
+
| `numberRange` | `id`, `label`, `min`, `max`, optional `initial`, optional positive `step` | Number within the range |
|
|
373
|
+
|
|
374
|
+
Dialogs accept 1–32 buttons and up to 16 inputs. An option list accepts 1–32 options.
|
|
375
|
+
IDs contain 1–64 letters, digits, underscores, or hyphens. IDs must be unique within each list. The input ID `__proto__` is reserved.
|
|
376
|
+
Titles and labels accept up to 256 characters. Optional `body` text accepts up to 8192 characters.
|
|
377
|
+
Each definition accepts up to 32768 characters as JSON. Text fields accept up to 8192 characters in total.
|
|
378
|
+
Number sliders use Minecraft float precision. `step` controls the slider; challenge code can check additional number rules.
|
|
379
|
+
|
|
380
|
+
Each display accepts one response. A new `g.dialog` call replaces the previous dialog for that player.
|
|
381
|
+
`g.clearDialog(player)` closes the dialog and rejects later responses.
|
|
382
|
+
Death, disconnect, expiry, and the end of the game also remove the response route.
|
|
383
|
+
The timeout uses game ticks. It defaults to 60 seconds and accepts one tick to one hour.
|
|
384
|
+
The Escape key closes the screen without a response. The response route expires at its timeout.
|
|
385
|
+
Use a button with a cancel ID when challenge code needs an explicit cancel response.
|
|
386
|
+
|
|
387
|
+
Raw `/dialog` commands do not create `dialogResponse` events.
|
|
388
|
+
Use the typed methods for a dialog that needs responses. Do not mix raw dialog commands with the typed dialog for the same player.
|
|
389
|
+
|
|
390
|
+
For a harness test, declare a human with `{ role: "player", human: true }` in `game.begin`.
|
|
391
|
+
Use `game.dialogResponse(playerName, buttonId, inputs)` to submit a response to the current dialog.
|
|
392
|
+
Use `game.dispatch` with a `dialog_response` event to check old or malformed responses.
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
288
396
|
## Constraints
|
|
289
397
|
|
|
290
398
|
- Every callback is synchronous. A callback that returns a Promise is an error that ends the run.
|
package/README.md
CHANGED
|
@@ -215,8 +215,108 @@ It also supports the existing gameplay and block commands.
|
|
|
215
215
|
Vanilla command syntax and rules still apply.
|
|
216
216
|
Block and container changes reach the world observations, including closed containers, jukeboxes, lecterns, chiseled bookshelves, and decorated pots.
|
|
217
217
|
The typed `g.container` method does not accept jukeboxes, lecterns, chiseled bookshelves, or decorated pots.
|
|
218
|
-
The observations do not expose arbitrary NBT or command storage.
|
|
219
|
-
Native Minecraft clients show dialogs.
|
|
220
|
-
|
|
218
|
+
The observations do not expose arbitrary NBT or command storage; a named command can read them.
|
|
219
|
+
Native Minecraft clients show raw dialogs. Use `g.dialog` for button and input responses; text agents do not receive dialogs.
|
|
220
|
+
The printed text of a command does not return to the challenge. To read what a command returned, give it a name: `g.command(cmd, name)`.
|
|
221
|
+
`on.commandResult` then reports `{ name, ok, value?, error? }` on a later event.
|
|
222
|
+
`ok` is `false` when the command did nothing, failed, or was refused; `error` says why.
|
|
223
|
+
`value` is the NBT that a `data get` read, as JSON (an entity, a block entity, or command storage), or else the vanilla integer result (the count of `execute if entity`, for example).
|
|
224
|
+
A number loses its NBT type: `1b`, `1` and `1.0f` are all `1`, and a boolean in NBT is `0` or `1`. A value over 262,144 characters is an error.
|
|
225
|
+
A command that runs in several forks (`execute as @a run ...`) gives the count of the forks that succeeded, not the answer of one fork; `ok` is `true` when at least one succeeded.
|
|
226
|
+
The name is a free string: put what the handler needs in it (`"held:Steve"`). A name is available only while the game runs, not in `.setup`.
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
import { defineChallenge } from "@kradle/challenges-sdk";
|
|
230
|
+
import { config } from "./config";
|
|
231
|
+
|
|
232
|
+
export default defineChallenge(config, { life: "respawn" })
|
|
233
|
+
.on({
|
|
234
|
+
chat(g, { player, text }) {
|
|
235
|
+
if (text === "sword") g.command(`data get entity ${player.name} SelectedItem`, `held:${player.name}`);
|
|
236
|
+
},
|
|
237
|
+
commandResult(g, { name, ok, value, error }) {
|
|
238
|
+
if (!name.startsWith("held:")) return;
|
|
239
|
+
const holder = g.player(name.slice("held:".length));
|
|
240
|
+
if (!holder) return;
|
|
241
|
+
if (!ok) return g.tell(holder, `Nothing to read: ${error}`);
|
|
242
|
+
const item = value as { id: string; count: number };
|
|
243
|
+
g.tell(holder, `You hold ${item.count} ${item.id}`);
|
|
244
|
+
},
|
|
245
|
+
})
|
|
246
|
+
.outcome({ winners: () => [] });
|
|
247
|
+
```
|
|
248
|
+
|
|
221
249
|
Use absolute coordinates, or `execute at` for a position relative to an entity.
|
|
222
250
|
`place`, `tick`, and server control commands remain unavailable.
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
## Native dialogs
|
|
254
|
+
|
|
255
|
+
Use `g.dialog(player, definition)` during play to show a native Minecraft dialog.
|
|
256
|
+
The player must have `human === true` and `connected === true`.
|
|
257
|
+
Text agents do not receive dialogs.
|
|
258
|
+
The server must support dialog responses.
|
|
259
|
+
|
|
260
|
+
```ts
|
|
261
|
+
import { defineChallenge } from "@kradle/challenges-sdk";
|
|
262
|
+
|
|
263
|
+
const challenge = defineChallenge({
|
|
264
|
+
name: "Upgrade choice",
|
|
265
|
+
challengeConfig: {},
|
|
266
|
+
roles: { player: { description: "Player", minParticipants: 1 } },
|
|
267
|
+
}, { life: "respawn" })
|
|
268
|
+
.start(g => {
|
|
269
|
+
for (const player of g.players) {
|
|
270
|
+
if (!player.human || !player.connected) continue;
|
|
271
|
+
g.dialog(player, {
|
|
272
|
+
id: "upgrade",
|
|
273
|
+
title: "Choose your upgrade",
|
|
274
|
+
inputs: [{ id: "label", type: "text", label: "Name", maxLength: 32 }],
|
|
275
|
+
buttons: [
|
|
276
|
+
{ id: "armor", label: "Better armor" },
|
|
277
|
+
{ id: "speed", label: "More speed" },
|
|
278
|
+
],
|
|
279
|
+
timeout: "60s",
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
})
|
|
283
|
+
.on({
|
|
284
|
+
dialogResponse(g, { player, dialogId, buttonId, inputs }) {
|
|
285
|
+
if (dialogId !== "upgrade") return;
|
|
286
|
+
g.log("Upgrade choice", { player, data: { buttonId, inputs } });
|
|
287
|
+
},
|
|
288
|
+
})
|
|
289
|
+
.outcome({ winners: () => [] });
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
`dialogResponse` supplies the authenticated player, the dialog ID, the button ID, and the input values.
|
|
293
|
+
`inputs` maps each input ID to a string, boolean, or number.
|
|
294
|
+
The server checks each value against the displayed field.
|
|
295
|
+
Challenge code must still check game rules before it grants an upgrade or changes a score.
|
|
296
|
+
|
|
297
|
+
| Input type | Fields | Response value |
|
|
298
|
+
| --- | --- | --- |
|
|
299
|
+
| `text` | `id`, `label`, optional `initial`, optional `maxLength` (default 32, maximum 1024) | String |
|
|
300
|
+
| `boolean` | `id`, `label`, optional `initial` (default false) | Boolean |
|
|
301
|
+
| `singleOption` | `id`, `label`, `options: [{ id, label }]`, optional `initial` option ID | Selected option ID |
|
|
302
|
+
| `numberRange` | `id`, `label`, `min`, `max`, optional `initial`, optional positive `step` | Number within the range |
|
|
303
|
+
|
|
304
|
+
Dialogs accept 1–32 buttons and up to 16 inputs. An option list accepts 1–32 options.
|
|
305
|
+
IDs contain 1–64 letters, digits, underscores, or hyphens. IDs must be unique within each list. The input ID `__proto__` is reserved.
|
|
306
|
+
Titles and labels accept up to 256 characters. Optional `body` text accepts up to 8192 characters.
|
|
307
|
+
Each definition accepts up to 32768 characters as JSON. Text fields accept up to 8192 characters in total.
|
|
308
|
+
Number sliders use Minecraft float precision. `step` controls the slider; challenge code can check additional number rules.
|
|
309
|
+
|
|
310
|
+
Each display accepts one response. A new `g.dialog` call replaces the previous dialog for that player.
|
|
311
|
+
`g.clearDialog(player)` closes the dialog and rejects later responses.
|
|
312
|
+
Death, disconnect, expiry, and the end of the game also remove the response route.
|
|
313
|
+
The timeout uses game ticks. It defaults to 60 seconds and accepts one tick to one hour.
|
|
314
|
+
The Escape key closes the screen without a response. The response route expires at its timeout.
|
|
315
|
+
Use a button with a cancel ID when challenge code needs an explicit cancel response.
|
|
316
|
+
|
|
317
|
+
Raw `/dialog` commands do not create `dialogResponse` events.
|
|
318
|
+
Use the typed methods for a dialog that needs responses. Do not mix raw dialog commands with the typed dialog for the same player.
|
|
319
|
+
|
|
320
|
+
For a harness test, declare a human with `{ role: "player", human: true }` in `game.begin`.
|
|
321
|
+
Use `game.dialogResponse(playerName, buttonId, inputs)` to submit a response to the current dialog.
|
|
322
|
+
Use `game.dispatch` with a `dialog_response` event to check old or malformed responses.
|
package/dist/engine.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { type Duration, type Ticks, toTicks } from "./runtime/time.js";
|
|
|
5
5
|
export type { Action, BlockId, Box, Capability, ChatColor, ChatText, ContainerItem, Effect, EffectId, EndReason, EngineChallenge, EntityTypeId, Event, GameMode, GateEffect, ItemId, ItemMeta, ItemStack, Json, ManifestVote, Participant, PlayerSample, RuntimeManifest, SdkEndState, SlotChange, Status, TextComponent, TitleTimes, Vec3, } from "./runtime/wire.js";
|
|
6
6
|
export { ALL_CAPABILITIES, MINECRAFT_TARGET } from "./runtime/wire.js";
|
|
7
7
|
export type { ChunkMessage, Entity, EntityMove, Equipment, EquipmentChange, EquipmentSlot, Equipped, WorldState, } from "./runtime/world.js";
|
|
8
|
+
export type { DialogSpec, DialogValues } from "./runtime/dialog.js";
|
|
8
9
|
//# sourceMappingURL=engine.d.ts.map
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EACN,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,KAAK,KAAK,EACV,YAAY,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EACX,MAAM,EACN,OAAO,EACP,GAAG,EACH,UAAU,EACV,SAAS,EACT,QAAQ,EACR,aAAa,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,eAAe,EACf,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,IAAI,GACJ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EACX,YAAY,EACZ,MAAM,EACN,UAAU,EACV,SAAS,EACT,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,GACV,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EACN,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,KAAK,KAAK,EACV,YAAY,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EACX,MAAM,EACN,OAAO,EACP,GAAG,EACH,UAAU,EACV,SAAS,EACT,QAAQ,EACR,aAAa,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,eAAe,EACf,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,UAAU,EACV,MAAM,EACN,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,UAAU,EACV,MAAM,EACN,aAAa,EACb,UAAU,EACV,IAAI,GACJ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EACX,YAAY,EACZ,MAAM,EACN,UAAU,EACV,SAAS,EACT,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,GACV,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,4 +18,5 @@ export declare const below: (at: Vec3) => BlockPos;
|
|
|
18
18
|
export declare const above: (at: Vec3) => BlockPos;
|
|
19
19
|
/** `at` moved by `d` on each axis. */
|
|
20
20
|
export declare const offset: (at: Vec3, d: Partial<Vec3>) => Vec3;
|
|
21
|
+
export type { Dialog, DialogInput, DialogValues } from "./runtime/dialog.js";
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACrG,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACN,WAAW,EACX,SAAS,EACT,SAAS,EACT,KAAK,QAAQ,EACb,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,KAAK,EACV,KAAK,EACL,OAAO,GACP,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,UAAU,EACV,YAAY,EACZ,eAAe,EACf,GAAG,EACH,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,WAAW,EACX,cAAc,EACd,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,YAAY,EACZ,EAAE,EACF,QAAQ,EACR,QAAQ,EACR,KAAK,GACL,MAAM,oBAAoB,CAAC;AAC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BAAoB,CAAC;AAE9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,8EAA8E;AAC9E,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,KAAG,QAA4E,CAAC;AAClH,iGAAiG;AACjG,eAAO,MAAM,KAAK,GAAI,IAAI,IAAI,KAAG,QAAmF,CAAC;AACrH,wCAAwC;AACxC,eAAO,MAAM,KAAK,GAAI,IAAI,IAAI,KAAG,QAAmF,CAAC;AACrH,sCAAsC;AACtC,eAAO,MAAM,MAAM,GAAI,IAAI,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAG,IAIlD,CAAC;AAEH,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Duration } from "./time.js";
|
|
2
|
+
/** A field in a native Minecraft dialog. */
|
|
3
|
+
export type DialogInput = {
|
|
4
|
+
/** The input key in the response. Use letters, digits, underscores, or hyphens. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** The visible label. */
|
|
7
|
+
label: string;
|
|
8
|
+
} & DialogControl;
|
|
9
|
+
/** The native input control. */
|
|
10
|
+
type DialogControl =
|
|
11
|
+
/** A text field. */
|
|
12
|
+
{
|
|
13
|
+
/** A text field. */
|
|
14
|
+
type: "text";
|
|
15
|
+
/** The initial text; empty by default. */
|
|
16
|
+
initial?: string;
|
|
17
|
+
/** The maximum length, from 1 to 1024; 32 by default. */
|
|
18
|
+
maxLength?: number;
|
|
19
|
+
}
|
|
20
|
+
/** A checkbox. */
|
|
21
|
+
| {
|
|
22
|
+
/** A checkbox. */
|
|
23
|
+
type: "boolean";
|
|
24
|
+
/** The initial value; false by default. */
|
|
25
|
+
initial?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** An option list. */
|
|
28
|
+
| {
|
|
29
|
+
/** A list with one selected option. */
|
|
30
|
+
type: "singleOption";
|
|
31
|
+
/** The choices, from 1 to 32. */
|
|
32
|
+
options: {
|
|
33
|
+
/** The value in the response. */
|
|
34
|
+
id: string;
|
|
35
|
+
/** The visible text. */
|
|
36
|
+
label: string;
|
|
37
|
+
}[];
|
|
38
|
+
/** The initial option ID; the first option by default. */
|
|
39
|
+
initial?: string;
|
|
40
|
+
}
|
|
41
|
+
/** A number slider. */
|
|
42
|
+
| {
|
|
43
|
+
/** A number slider. */
|
|
44
|
+
type: "numberRange";
|
|
45
|
+
/** The minimum value. */
|
|
46
|
+
min: number;
|
|
47
|
+
/** The maximum value, greater than the minimum. */
|
|
48
|
+
max: number;
|
|
49
|
+
/** The initial value; the minimum by default. */
|
|
50
|
+
initial?: number;
|
|
51
|
+
/** The positive step size; continuous without it. */
|
|
52
|
+
step?: number;
|
|
53
|
+
};
|
|
54
|
+
/** A native Minecraft dialog with one response per display. */
|
|
55
|
+
export interface Dialog {
|
|
56
|
+
/** The dialog ID in the response. */
|
|
57
|
+
id: string;
|
|
58
|
+
/** The visible title, up to 256 characters. */
|
|
59
|
+
title: string;
|
|
60
|
+
/** Optional text below the title, up to 8192 characters. */
|
|
61
|
+
body?: string;
|
|
62
|
+
/** The input fields, at most 16. */
|
|
63
|
+
inputs?: DialogInput[];
|
|
64
|
+
/** The buttons, from 1 to 32. */
|
|
65
|
+
buttons: {
|
|
66
|
+
/** The button ID in the response. */
|
|
67
|
+
id: string;
|
|
68
|
+
/** The visible label. */
|
|
69
|
+
label: string;
|
|
70
|
+
}[];
|
|
71
|
+
/** The response window; 60 seconds by default, at most one hour. */
|
|
72
|
+
timeout?: Duration;
|
|
73
|
+
}
|
|
74
|
+
/** The values submitted through a native dialog. */
|
|
75
|
+
export type DialogValues = Record<string, string | boolean | number>;
|
|
76
|
+
/** A dialog without the author-facing duration. */
|
|
77
|
+
export type DialogSpec = Omit<Dialog, "timeout">;
|
|
78
|
+
/** Checks the author definition before the SDK sends it. */
|
|
79
|
+
export declare function validateDialog(value: unknown): asserts value is Dialog;
|
|
80
|
+
/** Checks the values before the SDK calls challenge code. */
|
|
81
|
+
export declare function validDialogValues(d: DialogSpec, values: unknown): values is DialogValues;
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/runtime/dialog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,4CAA4C;AAC5C,MAAM,MAAM,WAAW,GAAG;IACzB,mFAAmF;IACnF,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;CACd,GAAG,aAAa,CAAC;AAElB,gCAAgC;AAChC,KAAK,aAAa;AACjB,oBAAoB;AAClB;IACA,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;CAClB;AACH,kBAAkB;GAChB;IACA,kBAAkB;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;CACjB;AACH,sBAAsB;GACpB;IACA,uCAAuC;IACvC,IAAI,EAAE,cAAc,CAAC;IACrB,iCAAiC;IACjC,OAAO,EAAE;QACR,iCAAiC;QACjC,EAAE,EAAE,MAAM,CAAC;QACX,wBAAwB;QACxB,KAAK,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;CAChB;AACH,uBAAuB;GACrB;IACA,uBAAuB;IACvB,IAAI,EAAE,aAAa,CAAC;IACpB,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEL,+DAA+D;AAC/D,MAAM,WAAW,MAAM;IACtB,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,iCAAiC;IACjC,OAAO,EAAE;QACR,qCAAqC;QACrC,EAAE,EAAE,MAAM,CAAC;QACX,yBAAyB;QACzB,KAAK,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,oEAAoE;IACpE,OAAO,CAAC,EAAE,QAAQ,CAAC;CACnB;AAED,oDAAoD;AACpD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAErE,mDAAmD;AACnD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAOjD,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CA0CtE;AAED,6DAA6D;AAC7D,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,YAAY,CAkBxF"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateDialog = validateDialog;
|
|
4
|
+
exports.validDialogValues = validDialogValues;
|
|
5
|
+
const errors_js_1 = require("./errors.js");
|
|
6
|
+
const id = (v) => typeof v === "string" && /^[a-zA-Z0-9_-]{1,64}$/.test(v);
|
|
7
|
+
const text = (v, max = 256) => typeof v === "string" && v.length <= max;
|
|
8
|
+
const finiteFloat = (v) => typeof v === "number" && Number.isFinite(Math.fround(v));
|
|
9
|
+
const object = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
|
|
10
|
+
/** Checks the author definition before the SDK sends it. */
|
|
11
|
+
function validateDialog(value) {
|
|
12
|
+
const fail = () => {
|
|
13
|
+
throw (0, errors_js_1.apiError)("bad_dialog", "dialog: invalid definition, IDs, or input limits");
|
|
14
|
+
};
|
|
15
|
+
if (!object(value) || !id(value.id) || !text(value.title) || (value.body !== undefined && !text(value.body, 8192)))
|
|
16
|
+
fail();
|
|
17
|
+
const d = value;
|
|
18
|
+
if (!Array.isArray(d.buttons) || d.buttons.length < 1 || d.buttons.length > 32)
|
|
19
|
+
fail();
|
|
20
|
+
if (new Set(d.buttons.map((b) => b?.id)).size !== d.buttons.length)
|
|
21
|
+
fail();
|
|
22
|
+
for (const b of d.buttons)
|
|
23
|
+
if (!object(b) || !id(b.id) || !text(b.label))
|
|
24
|
+
fail();
|
|
25
|
+
if (d.inputs !== undefined && (!Array.isArray(d.inputs) || d.inputs.length > 16))
|
|
26
|
+
fail();
|
|
27
|
+
const inputs = d.inputs ?? [];
|
|
28
|
+
if (new Set(inputs.map((i) => i?.id)).size !== inputs.length)
|
|
29
|
+
fail();
|
|
30
|
+
for (const i of inputs) {
|
|
31
|
+
if (!object(i) || !id(i.id) || i.id === "__proto__" || !text(i.label))
|
|
32
|
+
fail();
|
|
33
|
+
switch (i.type) {
|
|
34
|
+
case "text": {
|
|
35
|
+
const max = i.maxLength ?? 32;
|
|
36
|
+
if (!Number.isInteger(max) || max < 1 || max > 1024 || (i.initial !== undefined && !text(i.initial, max)))
|
|
37
|
+
fail();
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
case "boolean":
|
|
41
|
+
if (i.initial !== undefined && typeof i.initial !== "boolean")
|
|
42
|
+
fail();
|
|
43
|
+
break;
|
|
44
|
+
case "singleOption":
|
|
45
|
+
if (!Array.isArray(i.options) || i.options.length < 1 || i.options.length > 32)
|
|
46
|
+
fail();
|
|
47
|
+
if (new Set(i.options.map((o) => o?.id)).size !== i.options.length)
|
|
48
|
+
fail();
|
|
49
|
+
for (const o of i.options)
|
|
50
|
+
if (!object(o) || !id(o.id) || !text(o.label))
|
|
51
|
+
fail();
|
|
52
|
+
if (i.initial !== undefined && !i.options.some((o) => o.id === i.initial))
|
|
53
|
+
fail();
|
|
54
|
+
break;
|
|
55
|
+
case "numberRange":
|
|
56
|
+
if (!finiteFloat(i.min) || !finiteFloat(i.max) || Math.fround(i.min) >= Math.fround(i.max))
|
|
57
|
+
fail();
|
|
58
|
+
if (i.initial !== undefined && (!finiteFloat(i.initial) || i.initial < i.min || i.initial > i.max))
|
|
59
|
+
fail();
|
|
60
|
+
if (i.step !== undefined && (!finiteFloat(i.step) || Math.fround(i.step) <= 0))
|
|
61
|
+
fail();
|
|
62
|
+
break;
|
|
63
|
+
default:
|
|
64
|
+
fail();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (inputs.reduce((sum, i) => sum + (i.type === "text" ? (i.maxLength ?? 32) : 0), 0) > 8192)
|
|
68
|
+
fail();
|
|
69
|
+
if (JSON.stringify(d).length > 32768)
|
|
70
|
+
fail();
|
|
71
|
+
}
|
|
72
|
+
/** Checks the values before the SDK calls challenge code. */
|
|
73
|
+
function validDialogValues(d, values) {
|
|
74
|
+
if (!object(values))
|
|
75
|
+
return false;
|
|
76
|
+
const inputs = d.inputs ?? [];
|
|
77
|
+
if (Object.keys(values).length !== inputs.length)
|
|
78
|
+
return false;
|
|
79
|
+
return inputs.every((i) => {
|
|
80
|
+
if (!Object.hasOwn(values, i.id))
|
|
81
|
+
return false;
|
|
82
|
+
const v = values[i.id];
|
|
83
|
+
switch (i.type) {
|
|
84
|
+
case "text":
|
|
85
|
+
return text(v, i.maxLength ?? 32);
|
|
86
|
+
case "boolean":
|
|
87
|
+
return typeof v === "boolean";
|
|
88
|
+
case "singleOption":
|
|
89
|
+
return typeof v === "string" && i.options.some((o) => o.id === v);
|
|
90
|
+
case "numberRange":
|
|
91
|
+
return finiteFloat(v) && v >= Math.fround(i.min) && v <= Math.fround(i.max);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/runtime/dialog.ts"],"names":[],"mappings":";;AA0FA,wCA0CC;AAGD,8CAkBC;AAzJD,2CAAuC;AAoFvC,MAAM,EAAE,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjG,MAAM,IAAI,GAAG,CAAC,CAAU,EAAE,GAAG,GAAG,GAAG,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC;AAC9F,MAAM,WAAW,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1G,MAAM,MAAM,GAAG,CAAC,CAAU,EAAgC,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtH,4DAA4D;AAC5D,SAAgB,cAAc,CAAC,KAAc;IAC5C,MAAM,IAAI,GAAG,GAAU,EAAE;QACxB,MAAM,IAAA,oBAAQ,EAAC,YAAY,EAAE,kDAAkD,CAAC,CAAC;IAClF,CAAC,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,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AAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC9E,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DialogSpec } from "./dialog.js";
|
|
1
2
|
import { type Duration, type Ticks } from "./time.js";
|
|
2
3
|
import type { BlockSpec, BlockState, ChallengeConfig, Handlers, Outcome, PhaseSpec, StateDecl, World } from "./types.js";
|
|
3
4
|
import type { Action, BlockId, Box, Capability, Effect, EndReason, Event, ItemId, ItemStack, Json, RuntimeManifest, Status, Vec3 } from "./wire.js";
|
|
@@ -171,6 +172,13 @@ export interface State {
|
|
|
171
172
|
} & Vec3>;
|
|
172
173
|
/** Pending named batches: transport id to public name. */
|
|
173
174
|
batches: Record<string, string>;
|
|
175
|
+
/** Named commands that wait for their result, by request id. */
|
|
176
|
+
commands: Record<string, {
|
|
177
|
+
/** The name given to `g.command`. */
|
|
178
|
+
name: string;
|
|
179
|
+
/** The transport id of the batch the command went out in. */
|
|
180
|
+
batch?: string;
|
|
181
|
+
}>;
|
|
174
182
|
/** The containers the mirror holds, by "x,y,z": the block and its slots. */
|
|
175
183
|
containers: Record<string, {
|
|
176
184
|
/** The container's block id. */
|
|
@@ -180,7 +188,16 @@ export interface State {
|
|
|
180
188
|
}>;
|
|
181
189
|
/** The world mirror. */
|
|
182
190
|
world: WorldState;
|
|
183
|
-
/** The
|
|
191
|
+
/** The current native dialog for each participant. */
|
|
192
|
+
dialogs: Record<string, {
|
|
193
|
+
/** The unique display ID. */
|
|
194
|
+
requestId: string;
|
|
195
|
+
/** The displayed fields and buttons. */
|
|
196
|
+
dialog: DialogSpec;
|
|
197
|
+
/** The first tick that refuses a response. */
|
|
198
|
+
expires: number;
|
|
199
|
+
}>;
|
|
200
|
+
/** The next request id (walks, batches, commands, dialogs). */
|
|
184
201
|
nextId: number;
|
|
185
202
|
/** The winners once the game ended. */
|
|
186
203
|
winners: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/runtime/reducer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/runtime/reducer.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAe,KAAK,UAAU,EAAqC,MAAM,aAAa,CAAC;AAG9F,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAW,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAEX,SAAS,EACT,UAAU,EACV,eAAe,EAGf,QAAQ,EAIR,OAAO,EACP,SAAS,EAGT,SAAS,EAET,KAAK,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EACX,MAAM,EACN,OAAO,EACP,GAAG,EACH,UAAU,EAIV,MAAM,EACN,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACT,IAAI,EAIJ,eAAe,EAEf,MAAM,EAEN,IAAI,EACJ,MAAM,WAAW,CAAC;AACnB,OAAO,EAON,KAAK,SAAS,EAed,KAAK,UAAU,EAKf,MAAM,YAAY,CAAC;AAIpB,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,uEAAuE;AACvE,eAAO,MAAM,eAAe,QAAQ,CAAC;AACrC,uEAAuE;AACvE,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAK3C,wDAAwD;AACxD,MAAM,MAAM,WAAW,GAAG,QAAQ,CACjC,eAAe,EACf,OAAO,EACP,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtB,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CACrB,CAAC;AAEF,KAAK,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAC7C,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