kradle 0.6.6 → 0.6.8
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/README.md +44 -8
- package/dist/commands/challenge/build.d.ts +4 -2
- package/dist/commands/challenge/build.js +40 -9
- package/dist/commands/challenge/run.d.ts +7 -0
- package/dist/commands/challenge/run.js +112 -4
- package/dist/config/releases/arena-minecraft.d.ts +1 -0
- package/dist/config/releases/arena-minecraft.js +2 -0
- package/dist/lib/api-client.d.ts +13 -0
- package/dist/lib/api-client.js +12 -0
- package/dist/lib/challenge.d.ts +12 -0
- package/dist/lib/challenge.js +29 -18
- package/dist/lib/local-runner.d.ts +62 -0
- package/dist/lib/local-runner.js +432 -0
- package/dist/lib/schemas.d.ts +1 -0
- package/dist/lib/schemas.js +1 -0
- package/dist/lib/validator.js +2 -0
- package/oclif.manifest.json +89 -58
- package/package.json +1 -1
- package/static/ai_docs/LLM_CLI_REFERENCE.md +53 -11
|
@@ -119,11 +119,12 @@ kradle challenge create my-first-challenge
|
|
|
119
119
|
|
|
120
120
|
### `kradle challenge build <name>`
|
|
121
121
|
|
|
122
|
-
Builds a challenge datapack, validates it, and uploads
|
|
122
|
+
Builds a challenge datapack locally, validates it, and optionally uploads to the cloud.
|
|
123
123
|
|
|
124
124
|
**Usage:**
|
|
125
125
|
```bash
|
|
126
126
|
kradle challenge build <challenge-name>
|
|
127
|
+
kradle challenge build <challenge-name> --no-upload
|
|
127
128
|
kradle challenge build <challenge-name> --public
|
|
128
129
|
kradle challenge build <challenge-name> --no-validate
|
|
129
130
|
kradle challenge build --all
|
|
@@ -140,21 +141,24 @@ kradle challenge build --all --public
|
|
|
140
141
|
|------|-------|-------------|---------|
|
|
141
142
|
| `--all` | `-a` | Build all local challenges | false |
|
|
142
143
|
| `--public` | `-p` | Set visibility to public after upload | false |
|
|
143
|
-
| `--no-validate` | | Skip datapack validation
|
|
144
|
+
| `--no-validate` | | Skip datapack validation | false |
|
|
145
|
+
| `--no-upload` | | Build locally only (skip cloud config/datapack upload) | false |
|
|
146
|
+
|
|
147
|
+
`--public` is incompatible with `--no-upload`.
|
|
144
148
|
|
|
145
149
|
**What it does:**
|
|
146
|
-
1.
|
|
147
|
-
2. Executes `challenge.ts` to generate the datapack
|
|
150
|
+
1. Executes `challenge.ts` to generate the datapack
|
|
148
151
|
- Passes `KRADLE_CHALLENGE_END_STATES` env var containing a JSON array of end state keys from `config.endStates` (e.g., `["victory", "defeat"]`)
|
|
149
152
|
- Passes `KRADLE_CHALLENGE_ROLES` env var containing a JSON array of role names from `config.roles` (e.g., `["attacker", "defender"]`)
|
|
150
153
|
- Passes `KRADLE_CHALLENGE_LOCATIONS` env var containing a JSON array of location keys from `config.challengeConfig.locations` (e.g., `["spawn", "goal"]`)
|
|
151
154
|
- The `@kradle/challenges-sdk` uses these to register valid end states, roles, and locations at build time
|
|
152
|
-
|
|
155
|
+
2. Validates the datapack using Spyglass engine (unless `--no-validate`)
|
|
153
156
|
- Checks `.mcfunction` files for syntax errors, invalid commands, JSON text components
|
|
154
|
-
- **Errors block
|
|
157
|
+
- **Errors block command completion** - fix them before the build can finish
|
|
155
158
|
- Auto-detects Minecraft version from `pack.mcmeta` `pack_format`
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
3. If upload is enabled (default), creates challenge in cloud if needed
|
|
160
|
+
4. If upload is enabled (default), uploads `config.ts` metadata to cloud
|
|
161
|
+
5. If upload is enabled (default), compresses and uploads datapack to cloud storage
|
|
158
162
|
|
|
159
163
|
**Validation Output:**
|
|
160
164
|
```
|
|
@@ -164,7 +168,7 @@ data/kradle/functions/init.mcfunction:5:1 warning: Unused objective
|
|
|
164
168
|
|
|
165
169
|
Found 1 error, 1 warning
|
|
166
170
|
|
|
167
|
-
Error: Validation failed with 1 error(s).
|
|
171
|
+
Error: Validation failed with 1 error(s). Build aborted.
|
|
168
172
|
```
|
|
169
173
|
|
|
170
174
|
**Examples:**
|
|
@@ -172,6 +176,9 @@ Error: Validation failed with 1 error(s). Upload aborted.
|
|
|
172
176
|
# Build single challenge (with validation)
|
|
173
177
|
kradle challenge build my-challenge
|
|
174
178
|
|
|
179
|
+
# Build local datapack only (no cloud upload)
|
|
180
|
+
kradle challenge build my-challenge --no-upload
|
|
181
|
+
|
|
175
182
|
# Build and make public
|
|
176
183
|
kradle challenge build my-challenge --public
|
|
177
184
|
|
|
@@ -410,11 +417,13 @@ When no agents are specified, the command enters interactive mode:
|
|
|
410
417
|
| Flag | Short | Description |
|
|
411
418
|
|------|-------|-------------|
|
|
412
419
|
| `--studio` | `-s` | Run in local studio environment instead of production |
|
|
420
|
+
| `--local` | `-l` | Run locally using Docker (spins up MC server + arena-minecraft containers) |
|
|
421
|
+
| `--arena-image` | | Override arena-minecraft Docker image URL (env: `KRADLE_ARENA_IMAGE`) |
|
|
413
422
|
| `--no-open` | | Don't open the run URL in the browser |
|
|
414
423
|
| `--no-wait` | | Don't wait for completion (fire and forget) |
|
|
415
424
|
| `--no-summary` | | Don't wait for the AI-generated summary |
|
|
416
425
|
|
|
417
|
-
**Behavior:**
|
|
426
|
+
**Behavior (remote, default):**
|
|
418
427
|
1. Parses inline agents or enters interactive mode for agent selection
|
|
419
428
|
2. Creates a run with the challenge and specified participants
|
|
420
429
|
3. Opens the run URL in the browser (unless `--no-open`)
|
|
@@ -423,6 +432,31 @@ When no agents are specified, the command enters interactive mode:
|
|
|
423
432
|
|
|
424
433
|
**Terminal states:** The polling stops when the run reaches: `finished`, `game_over`, `error`, `completed`, `cancelled`, `timeout`, or `failed`.
|
|
425
434
|
|
|
435
|
+
**Behavior (local, with `--local`):**
|
|
436
|
+
1. Parses inline agents or enters interactive mode for agent selection
|
|
437
|
+
2. Fetches challenge config from the API
|
|
438
|
+
3. Builds the challenge datapack locally (with validation)
|
|
439
|
+
4. Creates a real backend job (`env: "studio"`) — returns full job object with agent configs, participant IDs, etc.
|
|
440
|
+
5. Downloads the challenge world from the cloud
|
|
441
|
+
6. Starts a Minecraft server Docker container (`marctv/minecraft-papermc-server:1.20.4`)
|
|
442
|
+
7. Starts an arena-minecraft Docker container (shares MC server network), passing the full backend job response
|
|
443
|
+
8. All players who join the MC server are automatically OP'd (via an auto-op datapack)
|
|
444
|
+
9. Streams arena logs to stdout until the run completes
|
|
445
|
+
10. Ctrl+C triggers graceful shutdown (arena `/shutdown` endpoint, then container stop/remove)
|
|
446
|
+
|
|
447
|
+
**Local mode requirements:**
|
|
448
|
+
- Docker Desktop must be running (Docker is only checked when `--local` is used)
|
|
449
|
+
- The challenge must exist locally (with `challenge.ts` and `config.ts`)
|
|
450
|
+
- First run pulls images which may take several minutes
|
|
451
|
+
- The agent URL is derived from the API URL (e.g., `dev-api.kradle.ai` → `dev-agents.kradle.ai`)
|
|
452
|
+
|
|
453
|
+
**Local mode incompatibilities:** `--local` cannot be combined with `--studio`, `--no-open`, `--no-wait`, `--screenshots`, or `--record`.
|
|
454
|
+
|
|
455
|
+
**Arena image override:** The `--arena-image` flag (or `KRADLE_ARENA_IMAGE` env var) allows testing dev or staging arena builds:
|
|
456
|
+
- Dev: `us-central1-docker.pkg.dev/mckradle-3c267/dev-arenas/minecraft:<sha>`
|
|
457
|
+
- Staging: `us-central1-docker.pkg.dev/kradle-staging/staging-arenas/minecraft:<sha>`
|
|
458
|
+
- Prod (default): `us-central1-docker.pkg.dev/kradle-prod-449119/prod-arenas/minecraft:<sha>`
|
|
459
|
+
|
|
426
460
|
**Examples:**
|
|
427
461
|
```bash
|
|
428
462
|
# Interactive mode - prompts for agent selection
|
|
@@ -447,6 +481,13 @@ kradle challenge run my-challenge team-kradle:gemini-3-flash --no-open
|
|
|
447
481
|
|
|
448
482
|
# Fire and forget (don't wait for completion)
|
|
449
483
|
kradle challenge run my-challenge team-kradle:gemini-3-flash --no-wait
|
|
484
|
+
|
|
485
|
+
# Run locally with Docker
|
|
486
|
+
kradle challenge run my-challenge --local team-kradle:gemini-3-flash,team-kradle:grok-4-1-fast
|
|
487
|
+
|
|
488
|
+
# Run locally with a dev arena image
|
|
489
|
+
kradle challenge run my-challenge --local \
|
|
490
|
+
--arena-image us-central1-docker.pkg.dev/mckradle-3c267/dev-arenas/minecraft:abc1234
|
|
450
491
|
```
|
|
451
492
|
|
|
452
493
|
---
|
|
@@ -1274,13 +1315,14 @@ kradle challenge build --all --public
|
|
|
1274
1315
|
|---------|-------------|
|
|
1275
1316
|
| `kradle init` | Initialize new project |
|
|
1276
1317
|
| `kradle challenge create <name>` | Create new challenge |
|
|
1277
|
-
| `kradle challenge build <name>` | Build
|
|
1318
|
+
| `kradle challenge build <name>` | Build challenge (uploads by default) |
|
|
1278
1319
|
| `kradle challenge build --all` | Build all challenges |
|
|
1279
1320
|
| `kradle challenge delete <name>` | Delete challenge |
|
|
1280
1321
|
| `kradle challenge list` | List all challenges |
|
|
1281
1322
|
| `kradle challenge pull [name]` | Pull challenge from cloud |
|
|
1282
1323
|
| `kradle challenge watch <name>` | Watch and auto-rebuild |
|
|
1283
1324
|
| `kradle challenge run <name>` | Run challenge and wait for completion |
|
|
1325
|
+
| `kradle challenge run <name> --local` | Run challenge locally using Docker |
|
|
1284
1326
|
| `kradle challenge runs list` | List recent runs |
|
|
1285
1327
|
| `kradle challenge runs get <run-id>` | Get details and logs for a run |
|
|
1286
1328
|
| `kradle experiment create <name>` | Create new experiment |
|