@kradle/cli 0.0.17 → 0.1.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/README.md +62 -65
- package/dist/commands/agent/list.d.ts +4 -0
- package/dist/commands/agent/list.js +6 -4
- package/dist/commands/challenge/build.d.ts +9 -1
- package/dist/commands/challenge/build.js +40 -12
- package/dist/commands/challenge/create.d.ts +5 -1
- package/dist/commands/challenge/create.js +17 -18
- package/dist/commands/challenge/delete.d.ts +4 -1
- package/dist/commands/challenge/delete.js +5 -5
- package/dist/commands/challenge/list.d.ts +5 -0
- package/dist/commands/challenge/list.js +9 -10
- package/dist/commands/challenge/run.d.ts +8 -1
- package/dist/commands/challenge/run.js +13 -8
- package/dist/commands/challenge/watch.d.ts +4 -1
- package/dist/commands/challenge/watch.js +8 -8
- package/dist/commands/{evaluation → experiment}/create.d.ts +4 -0
- package/dist/commands/{evaluation → experiment}/create.js +22 -21
- package/dist/commands/{evaluation → experiment}/list.js +17 -19
- package/dist/commands/{evaluation → experiment}/run.d.ts +4 -1
- package/dist/commands/experiment/run.js +61 -0
- package/dist/commands/init.js +2 -2
- package/dist/lib/api-client.d.ts +29 -10
- package/dist/lib/api-client.js +81 -37
- package/dist/lib/arguments.d.ts +3 -2
- package/dist/lib/arguments.js +5 -3
- package/dist/lib/challenge.d.ts +13 -18
- package/dist/lib/challenge.js +58 -62
- package/dist/lib/experiment/experimenter.d.ts +87 -0
- package/dist/lib/{evaluation/evaluator.js → experiment/experimenter.js} +74 -72
- package/dist/lib/{evaluation → experiment}/index.d.ts +1 -1
- package/dist/lib/{evaluation → experiment}/index.js +1 -1
- package/dist/lib/{evaluation → experiment}/runner.js +2 -1
- package/dist/lib/{evaluation → experiment}/tui.d.ts +1 -1
- package/dist/lib/{evaluation → experiment}/tui.js +3 -3
- package/dist/lib/{evaluation → experiment}/types.d.ts +6 -4
- package/dist/lib/{evaluation → experiment}/types.js +4 -3
- package/dist/lib/flags.d.ts +47 -0
- package/dist/lib/flags.js +63 -0
- package/dist/lib/schemas.d.ts +32 -0
- package/dist/lib/schemas.js +8 -0
- package/dist/lib/utils.d.ts +9 -10
- package/dist/lib/utils.js +12 -12
- package/oclif.manifest.json +342 -64
- package/package.json +5 -6
- package/static/challenge.ts +12 -13
- package/static/experiment_template.ts +114 -0
- package/static/project_template/dev.env +5 -5
- package/static/project_template/prod.env +4 -4
- package/static/project_template/tsconfig.json +1 -1
- package/dist/commands/challenge/multi-upload.d.ts +0 -6
- package/dist/commands/challenge/multi-upload.js +0 -80
- package/dist/commands/evaluation/run.js +0 -61
- package/dist/lib/config.d.ts +0 -12
- package/dist/lib/config.js +0 -49
- package/dist/lib/evaluation/evaluator.d.ts +0 -88
- package/static/evaluation_template.ts +0 -69
- /package/dist/commands/{evaluation → experiment}/list.d.ts +0 -0
- /package/dist/lib/{evaluation → experiment}/runner.d.ts +0 -0
package/oclif.manifest.json
CHANGED
|
@@ -49,7 +49,27 @@
|
|
|
49
49
|
"examples": [
|
|
50
50
|
"<%= config.bin %> <%= command.id %>"
|
|
51
51
|
],
|
|
52
|
-
"flags": {
|
|
52
|
+
"flags": {
|
|
53
|
+
"api-key": {
|
|
54
|
+
"description": "Kradle API key",
|
|
55
|
+
"env": "KRADLE_API_KEY",
|
|
56
|
+
"name": "api-key",
|
|
57
|
+
"required": true,
|
|
58
|
+
"hasDynamicHelp": false,
|
|
59
|
+
"multiple": false,
|
|
60
|
+
"type": "option"
|
|
61
|
+
},
|
|
62
|
+
"api-url": {
|
|
63
|
+
"description": "Kradle Web API URL",
|
|
64
|
+
"env": "KRADLE_API_URL",
|
|
65
|
+
"name": "api-url",
|
|
66
|
+
"required": true,
|
|
67
|
+
"default": "https://api.kradle.ai/v0",
|
|
68
|
+
"hasDynamicHelp": false,
|
|
69
|
+
"multiple": false,
|
|
70
|
+
"type": "option"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
53
73
|
"hasDynamicHelp": false,
|
|
54
74
|
"hiddenAliases": [],
|
|
55
75
|
"id": "agent:list",
|
|
@@ -69,24 +89,69 @@
|
|
|
69
89
|
"challenge:build": {
|
|
70
90
|
"aliases": [],
|
|
71
91
|
"args": {
|
|
72
|
-
"
|
|
73
|
-
"description": "Challenge slug to build",
|
|
74
|
-
"name": "
|
|
75
|
-
"required":
|
|
92
|
+
"challengeSlug": {
|
|
93
|
+
"description": "Challenge slug to build and upload. Can be used multiple times to build and upload multiple challenges at once. Incompatible with --all flag.",
|
|
94
|
+
"name": "challengeSlug",
|
|
95
|
+
"required": false
|
|
76
96
|
}
|
|
77
97
|
},
|
|
78
98
|
"description": "Build and upload challenge datapack and config",
|
|
79
99
|
"examples": [
|
|
80
|
-
"<%= config.bin %> <%= command.id %> my-challenge"
|
|
100
|
+
"<%= config.bin %> <%= command.id %> my-challenge",
|
|
101
|
+
"<%= config.bin %> <%= command.id %> my-challenge my-other-challenge",
|
|
102
|
+
"<%= config.bin %> <%= command.id %> --all"
|
|
81
103
|
],
|
|
82
|
-
"flags": {
|
|
104
|
+
"flags": {
|
|
105
|
+
"all": {
|
|
106
|
+
"char": "a",
|
|
107
|
+
"description": "Build all challenges in the challenges directory",
|
|
108
|
+
"name": "all",
|
|
109
|
+
"allowNo": false,
|
|
110
|
+
"type": "boolean"
|
|
111
|
+
},
|
|
112
|
+
"public": {
|
|
113
|
+
"char": "p",
|
|
114
|
+
"description": "Upload challenges as public.",
|
|
115
|
+
"name": "public",
|
|
116
|
+
"allowNo": false,
|
|
117
|
+
"type": "boolean"
|
|
118
|
+
},
|
|
119
|
+
"api-key": {
|
|
120
|
+
"description": "Kradle API key",
|
|
121
|
+
"env": "KRADLE_API_KEY",
|
|
122
|
+
"name": "api-key",
|
|
123
|
+
"required": true,
|
|
124
|
+
"hasDynamicHelp": false,
|
|
125
|
+
"multiple": false,
|
|
126
|
+
"type": "option"
|
|
127
|
+
},
|
|
128
|
+
"api-url": {
|
|
129
|
+
"description": "Kradle Web API URL",
|
|
130
|
+
"env": "KRADLE_API_URL",
|
|
131
|
+
"name": "api-url",
|
|
132
|
+
"required": true,
|
|
133
|
+
"default": "https://api.kradle.ai/v0",
|
|
134
|
+
"hasDynamicHelp": false,
|
|
135
|
+
"multiple": false,
|
|
136
|
+
"type": "option"
|
|
137
|
+
},
|
|
138
|
+
"challenges-path": {
|
|
139
|
+
"description": "Absolute path to the challenges directory",
|
|
140
|
+
"env": "KRADLE_CHALLENGES_PATH",
|
|
141
|
+
"name": "challenges-path",
|
|
142
|
+
"default": "~/Documents/kradle-studio/challenges",
|
|
143
|
+
"hasDynamicHelp": false,
|
|
144
|
+
"multiple": false,
|
|
145
|
+
"type": "option"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
83
148
|
"hasDynamicHelp": false,
|
|
84
149
|
"hiddenAliases": [],
|
|
85
150
|
"id": "challenge:build",
|
|
86
151
|
"pluginAlias": "@kradle/cli",
|
|
87
152
|
"pluginName": "@kradle/cli",
|
|
88
153
|
"pluginType": "core",
|
|
89
|
-
"strict":
|
|
154
|
+
"strict": false,
|
|
90
155
|
"enableJsonFlag": false,
|
|
91
156
|
"isESM": true,
|
|
92
157
|
"relativePath": [
|
|
@@ -99,9 +164,9 @@
|
|
|
99
164
|
"challenge:create": {
|
|
100
165
|
"aliases": [],
|
|
101
166
|
"args": {
|
|
102
|
-
"
|
|
167
|
+
"challengeSlug": {
|
|
103
168
|
"description": "Challenge slug to create",
|
|
104
|
-
"name": "
|
|
169
|
+
"name": "challengeSlug",
|
|
105
170
|
"required": true
|
|
106
171
|
}
|
|
107
172
|
},
|
|
@@ -116,6 +181,44 @@
|
|
|
116
181
|
"name": "verbose",
|
|
117
182
|
"allowNo": false,
|
|
118
183
|
"type": "boolean"
|
|
184
|
+
},
|
|
185
|
+
"api-key": {
|
|
186
|
+
"description": "Kradle API key",
|
|
187
|
+
"env": "KRADLE_API_KEY",
|
|
188
|
+
"name": "api-key",
|
|
189
|
+
"required": true,
|
|
190
|
+
"hasDynamicHelp": false,
|
|
191
|
+
"multiple": false,
|
|
192
|
+
"type": "option"
|
|
193
|
+
},
|
|
194
|
+
"api-url": {
|
|
195
|
+
"description": "Kradle Web API URL",
|
|
196
|
+
"env": "KRADLE_API_URL",
|
|
197
|
+
"name": "api-url",
|
|
198
|
+
"required": true,
|
|
199
|
+
"default": "https://api.kradle.ai/v0",
|
|
200
|
+
"hasDynamicHelp": false,
|
|
201
|
+
"multiple": false,
|
|
202
|
+
"type": "option"
|
|
203
|
+
},
|
|
204
|
+
"challenges-path": {
|
|
205
|
+
"description": "Absolute path to the challenges directory",
|
|
206
|
+
"env": "KRADLE_CHALLENGES_PATH",
|
|
207
|
+
"name": "challenges-path",
|
|
208
|
+
"default": "~/Documents/kradle-studio/challenges",
|
|
209
|
+
"hasDynamicHelp": false,
|
|
210
|
+
"multiple": false,
|
|
211
|
+
"type": "option"
|
|
212
|
+
},
|
|
213
|
+
"web-url": {
|
|
214
|
+
"description": "Kradle Web URL, used to display the run URL",
|
|
215
|
+
"env": "KRADLE_WEB_URL",
|
|
216
|
+
"name": "web-url",
|
|
217
|
+
"required": true,
|
|
218
|
+
"default": "https://kradle.ai",
|
|
219
|
+
"hasDynamicHelp": false,
|
|
220
|
+
"multiple": false,
|
|
221
|
+
"type": "option"
|
|
119
222
|
}
|
|
120
223
|
},
|
|
121
224
|
"hasDynamicHelp": false,
|
|
@@ -137,9 +240,9 @@
|
|
|
137
240
|
"challenge:delete": {
|
|
138
241
|
"aliases": [],
|
|
139
242
|
"args": {
|
|
140
|
-
"
|
|
243
|
+
"challengeSlug": {
|
|
141
244
|
"description": "Challenge slug to delete",
|
|
142
|
-
"name": "
|
|
245
|
+
"name": "challengeSlug",
|
|
143
246
|
"required": true
|
|
144
247
|
}
|
|
145
248
|
},
|
|
@@ -155,6 +258,34 @@
|
|
|
155
258
|
"name": "yes",
|
|
156
259
|
"allowNo": false,
|
|
157
260
|
"type": "boolean"
|
|
261
|
+
},
|
|
262
|
+
"api-key": {
|
|
263
|
+
"description": "Kradle API key",
|
|
264
|
+
"env": "KRADLE_API_KEY",
|
|
265
|
+
"name": "api-key",
|
|
266
|
+
"required": true,
|
|
267
|
+
"hasDynamicHelp": false,
|
|
268
|
+
"multiple": false,
|
|
269
|
+
"type": "option"
|
|
270
|
+
},
|
|
271
|
+
"api-url": {
|
|
272
|
+
"description": "Kradle Web API URL",
|
|
273
|
+
"env": "KRADLE_API_URL",
|
|
274
|
+
"name": "api-url",
|
|
275
|
+
"required": true,
|
|
276
|
+
"default": "https://api.kradle.ai/v0",
|
|
277
|
+
"hasDynamicHelp": false,
|
|
278
|
+
"multiple": false,
|
|
279
|
+
"type": "option"
|
|
280
|
+
},
|
|
281
|
+
"challenges-path": {
|
|
282
|
+
"description": "Absolute path to the challenges directory",
|
|
283
|
+
"env": "KRADLE_CHALLENGES_PATH",
|
|
284
|
+
"name": "challenges-path",
|
|
285
|
+
"default": "~/Documents/kradle-studio/challenges",
|
|
286
|
+
"hasDynamicHelp": false,
|
|
287
|
+
"multiple": false,
|
|
288
|
+
"type": "option"
|
|
158
289
|
}
|
|
159
290
|
},
|
|
160
291
|
"hasDynamicHelp": false,
|
|
@@ -180,7 +311,36 @@
|
|
|
180
311
|
"examples": [
|
|
181
312
|
"<%= config.bin %> <%= command.id %>"
|
|
182
313
|
],
|
|
183
|
-
"flags": {
|
|
314
|
+
"flags": {
|
|
315
|
+
"api-key": {
|
|
316
|
+
"description": "Kradle API key",
|
|
317
|
+
"env": "KRADLE_API_KEY",
|
|
318
|
+
"name": "api-key",
|
|
319
|
+
"required": true,
|
|
320
|
+
"hasDynamicHelp": false,
|
|
321
|
+
"multiple": false,
|
|
322
|
+
"type": "option"
|
|
323
|
+
},
|
|
324
|
+
"api-url": {
|
|
325
|
+
"description": "Kradle Web API URL",
|
|
326
|
+
"env": "KRADLE_API_URL",
|
|
327
|
+
"name": "api-url",
|
|
328
|
+
"required": true,
|
|
329
|
+
"default": "https://api.kradle.ai/v0",
|
|
330
|
+
"hasDynamicHelp": false,
|
|
331
|
+
"multiple": false,
|
|
332
|
+
"type": "option"
|
|
333
|
+
},
|
|
334
|
+
"challenges-path": {
|
|
335
|
+
"description": "Absolute path to the challenges directory",
|
|
336
|
+
"env": "KRADLE_CHALLENGES_PATH",
|
|
337
|
+
"name": "challenges-path",
|
|
338
|
+
"default": "~/Documents/kradle-studio/challenges",
|
|
339
|
+
"hasDynamicHelp": false,
|
|
340
|
+
"multiple": false,
|
|
341
|
+
"type": "option"
|
|
342
|
+
}
|
|
343
|
+
},
|
|
184
344
|
"hasDynamicHelp": false,
|
|
185
345
|
"hiddenAliases": [],
|
|
186
346
|
"id": "challenge:list",
|
|
@@ -197,36 +357,12 @@
|
|
|
197
357
|
"list.js"
|
|
198
358
|
]
|
|
199
359
|
},
|
|
200
|
-
"challenge:multi-upload": {
|
|
201
|
-
"aliases": [],
|
|
202
|
-
"args": {},
|
|
203
|
-
"description": "Interactively select and upload multiple challenges",
|
|
204
|
-
"examples": [
|
|
205
|
-
"<%= config.bin %> <%= command.id %>"
|
|
206
|
-
],
|
|
207
|
-
"flags": {},
|
|
208
|
-
"hasDynamicHelp": false,
|
|
209
|
-
"hiddenAliases": [],
|
|
210
|
-
"id": "challenge:multi-upload",
|
|
211
|
-
"pluginAlias": "@kradle/cli",
|
|
212
|
-
"pluginName": "@kradle/cli",
|
|
213
|
-
"pluginType": "core",
|
|
214
|
-
"strict": true,
|
|
215
|
-
"enableJsonFlag": false,
|
|
216
|
-
"isESM": true,
|
|
217
|
-
"relativePath": [
|
|
218
|
-
"dist",
|
|
219
|
-
"commands",
|
|
220
|
-
"challenge",
|
|
221
|
-
"multi-upload.js"
|
|
222
|
-
]
|
|
223
|
-
},
|
|
224
360
|
"challenge:run": {
|
|
225
361
|
"aliases": [],
|
|
226
362
|
"args": {
|
|
227
|
-
"
|
|
363
|
+
"challengeSlug": {
|
|
228
364
|
"description": "Challenge slug to run",
|
|
229
|
-
"name": "
|
|
365
|
+
"name": "challengeSlug",
|
|
230
366
|
"required": true
|
|
231
367
|
}
|
|
232
368
|
},
|
|
@@ -242,6 +378,71 @@
|
|
|
242
378
|
"name": "studio",
|
|
243
379
|
"allowNo": false,
|
|
244
380
|
"type": "boolean"
|
|
381
|
+
},
|
|
382
|
+
"open": {
|
|
383
|
+
"char": "o",
|
|
384
|
+
"description": "Open the run URL in the browser",
|
|
385
|
+
"name": "open",
|
|
386
|
+
"allowNo": false,
|
|
387
|
+
"type": "boolean"
|
|
388
|
+
},
|
|
389
|
+
"api-key": {
|
|
390
|
+
"description": "Kradle API key",
|
|
391
|
+
"env": "KRADLE_API_KEY",
|
|
392
|
+
"name": "api-key",
|
|
393
|
+
"required": true,
|
|
394
|
+
"hasDynamicHelp": false,
|
|
395
|
+
"multiple": false,
|
|
396
|
+
"type": "option"
|
|
397
|
+
},
|
|
398
|
+
"api-url": {
|
|
399
|
+
"description": "Kradle Web API URL",
|
|
400
|
+
"env": "KRADLE_API_URL",
|
|
401
|
+
"name": "api-url",
|
|
402
|
+
"required": true,
|
|
403
|
+
"default": "https://api.kradle.ai/v0",
|
|
404
|
+
"hasDynamicHelp": false,
|
|
405
|
+
"multiple": false,
|
|
406
|
+
"type": "option"
|
|
407
|
+
},
|
|
408
|
+
"challenges-path": {
|
|
409
|
+
"description": "Absolute path to the challenges directory",
|
|
410
|
+
"env": "KRADLE_CHALLENGES_PATH",
|
|
411
|
+
"name": "challenges-path",
|
|
412
|
+
"default": "~/Documents/kradle-studio/challenges",
|
|
413
|
+
"hasDynamicHelp": false,
|
|
414
|
+
"multiple": false,
|
|
415
|
+
"type": "option"
|
|
416
|
+
},
|
|
417
|
+
"web-url": {
|
|
418
|
+
"description": "Kradle Web URL, used to display the run URL",
|
|
419
|
+
"env": "KRADLE_WEB_URL",
|
|
420
|
+
"name": "web-url",
|
|
421
|
+
"required": true,
|
|
422
|
+
"default": "https://kradle.ai",
|
|
423
|
+
"hasDynamicHelp": false,
|
|
424
|
+
"multiple": false,
|
|
425
|
+
"type": "option"
|
|
426
|
+
},
|
|
427
|
+
"studio-url": {
|
|
428
|
+
"description": "Kradle Studio URL, used to display the run URL in Studio",
|
|
429
|
+
"env": "KRADLE_STUDIO_URL",
|
|
430
|
+
"name": "studio-url",
|
|
431
|
+
"required": true,
|
|
432
|
+
"default": "kradle://open",
|
|
433
|
+
"hasDynamicHelp": false,
|
|
434
|
+
"multiple": false,
|
|
435
|
+
"type": "option"
|
|
436
|
+
},
|
|
437
|
+
"studio-api-url": {
|
|
438
|
+
"description": "Kradle Studio API URL, used to communicate with the Studio API",
|
|
439
|
+
"env": "KRADLE_STUDIO_API_URL",
|
|
440
|
+
"name": "studio-api-url",
|
|
441
|
+
"required": true,
|
|
442
|
+
"default": "http://localhost:2999/api/v0",
|
|
443
|
+
"hasDynamicHelp": false,
|
|
444
|
+
"multiple": false,
|
|
445
|
+
"type": "option"
|
|
245
446
|
}
|
|
246
447
|
},
|
|
247
448
|
"hasDynamicHelp": false,
|
|
@@ -263,9 +464,9 @@
|
|
|
263
464
|
"challenge:watch": {
|
|
264
465
|
"aliases": [],
|
|
265
466
|
"args": {
|
|
266
|
-
"
|
|
467
|
+
"challengeSlug": {
|
|
267
468
|
"description": "Challenge slug to watch",
|
|
268
|
-
"name": "
|
|
469
|
+
"name": "challengeSlug",
|
|
269
470
|
"required": true
|
|
270
471
|
}
|
|
271
472
|
},
|
|
@@ -279,6 +480,34 @@
|
|
|
279
480
|
"name": "verbose",
|
|
280
481
|
"allowNo": false,
|
|
281
482
|
"type": "boolean"
|
|
483
|
+
},
|
|
484
|
+
"api-key": {
|
|
485
|
+
"description": "Kradle API key",
|
|
486
|
+
"env": "KRADLE_API_KEY",
|
|
487
|
+
"name": "api-key",
|
|
488
|
+
"required": true,
|
|
489
|
+
"hasDynamicHelp": false,
|
|
490
|
+
"multiple": false,
|
|
491
|
+
"type": "option"
|
|
492
|
+
},
|
|
493
|
+
"api-url": {
|
|
494
|
+
"description": "Kradle Web API URL",
|
|
495
|
+
"env": "KRADLE_API_URL",
|
|
496
|
+
"name": "api-url",
|
|
497
|
+
"required": true,
|
|
498
|
+
"default": "https://api.kradle.ai/v0",
|
|
499
|
+
"hasDynamicHelp": false,
|
|
500
|
+
"multiple": false,
|
|
501
|
+
"type": "option"
|
|
502
|
+
},
|
|
503
|
+
"challenges-path": {
|
|
504
|
+
"description": "Absolute path to the challenges directory",
|
|
505
|
+
"env": "KRADLE_CHALLENGES_PATH",
|
|
506
|
+
"name": "challenges-path",
|
|
507
|
+
"default": "~/Documents/kradle-studio/challenges",
|
|
508
|
+
"hasDynamicHelp": false,
|
|
509
|
+
"multiple": false,
|
|
510
|
+
"type": "option"
|
|
282
511
|
}
|
|
283
512
|
},
|
|
284
513
|
"hasDynamicHelp": false,
|
|
@@ -297,23 +526,43 @@
|
|
|
297
526
|
"watch.js"
|
|
298
527
|
]
|
|
299
528
|
},
|
|
300
|
-
"
|
|
529
|
+
"experiment:create": {
|
|
301
530
|
"aliases": [],
|
|
302
531
|
"args": {
|
|
303
532
|
"name": {
|
|
304
|
-
"description": "Name of the
|
|
533
|
+
"description": "Name of the experiment",
|
|
305
534
|
"name": "name",
|
|
306
535
|
"required": true
|
|
307
536
|
}
|
|
308
537
|
},
|
|
309
|
-
"description": "Create a new
|
|
538
|
+
"description": "Create a new experiment",
|
|
310
539
|
"examples": [
|
|
311
|
-
"<%= config.bin %> <%= command.id %> my-
|
|
540
|
+
"<%= config.bin %> <%= command.id %> my-experiment"
|
|
312
541
|
],
|
|
313
|
-
"flags": {
|
|
542
|
+
"flags": {
|
|
543
|
+
"api-key": {
|
|
544
|
+
"description": "Kradle API key",
|
|
545
|
+
"env": "KRADLE_API_KEY",
|
|
546
|
+
"name": "api-key",
|
|
547
|
+
"required": true,
|
|
548
|
+
"hasDynamicHelp": false,
|
|
549
|
+
"multiple": false,
|
|
550
|
+
"type": "option"
|
|
551
|
+
},
|
|
552
|
+
"api-url": {
|
|
553
|
+
"description": "Kradle Web API URL",
|
|
554
|
+
"env": "KRADLE_API_URL",
|
|
555
|
+
"name": "api-url",
|
|
556
|
+
"required": true,
|
|
557
|
+
"default": "https://api.kradle.ai/v0",
|
|
558
|
+
"hasDynamicHelp": false,
|
|
559
|
+
"multiple": false,
|
|
560
|
+
"type": "option"
|
|
561
|
+
}
|
|
562
|
+
},
|
|
314
563
|
"hasDynamicHelp": false,
|
|
315
564
|
"hiddenAliases": [],
|
|
316
|
-
"id": "
|
|
565
|
+
"id": "experiment:create",
|
|
317
566
|
"pluginAlias": "@kradle/cli",
|
|
318
567
|
"pluginName": "@kradle/cli",
|
|
319
568
|
"pluginType": "core",
|
|
@@ -323,21 +572,21 @@
|
|
|
323
572
|
"relativePath": [
|
|
324
573
|
"dist",
|
|
325
574
|
"commands",
|
|
326
|
-
"
|
|
575
|
+
"experiment",
|
|
327
576
|
"create.js"
|
|
328
577
|
]
|
|
329
578
|
},
|
|
330
|
-
"
|
|
579
|
+
"experiment:list": {
|
|
331
580
|
"aliases": [],
|
|
332
581
|
"args": {},
|
|
333
|
-
"description": "List all
|
|
582
|
+
"description": "List all experiments",
|
|
334
583
|
"examples": [
|
|
335
584
|
"<%= config.bin %> <%= command.id %>"
|
|
336
585
|
],
|
|
337
586
|
"flags": {},
|
|
338
587
|
"hasDynamicHelp": false,
|
|
339
588
|
"hiddenAliases": [],
|
|
340
|
-
"id": "
|
|
589
|
+
"id": "experiment:list",
|
|
341
590
|
"pluginAlias": "@kradle/cli",
|
|
342
591
|
"pluginName": "@kradle/cli",
|
|
343
592
|
"pluginType": "core",
|
|
@@ -347,30 +596,30 @@
|
|
|
347
596
|
"relativePath": [
|
|
348
597
|
"dist",
|
|
349
598
|
"commands",
|
|
350
|
-
"
|
|
599
|
+
"experiment",
|
|
351
600
|
"list.js"
|
|
352
601
|
]
|
|
353
602
|
},
|
|
354
|
-
"
|
|
603
|
+
"experiment:run": {
|
|
355
604
|
"aliases": [],
|
|
356
605
|
"args": {
|
|
357
606
|
"name": {
|
|
358
|
-
"description": "Name of the
|
|
607
|
+
"description": "Name of the experiment to run",
|
|
359
608
|
"name": "name",
|
|
360
609
|
"required": true
|
|
361
610
|
}
|
|
362
611
|
},
|
|
363
|
-
"description": "Run an
|
|
612
|
+
"description": "Run an experiment. If the experiment had an ongoing version, it will resume from the last state.",
|
|
364
613
|
"examples": [
|
|
365
|
-
"<%= config.bin %> <%= command.id %> my-
|
|
366
|
-
"<%= config.bin %> <%= command.id %> my-
|
|
367
|
-
"<%= config.bin %> <%= command.id %> my-
|
|
614
|
+
"<%= config.bin %> <%= command.id %> my-experiment",
|
|
615
|
+
"<%= config.bin %> <%= command.id %> my-experiment --new-version",
|
|
616
|
+
"<%= config.bin %> <%= command.id %> my-experiment --max-concurrent 10"
|
|
368
617
|
],
|
|
369
618
|
"flags": {
|
|
370
|
-
"new": {
|
|
619
|
+
"new-version": {
|
|
371
620
|
"char": "n",
|
|
372
|
-
"description": "Start a new
|
|
373
|
-
"name": "new",
|
|
621
|
+
"description": "Start a new version of the experiment",
|
|
622
|
+
"name": "new-version",
|
|
374
623
|
"allowNo": false,
|
|
375
624
|
"type": "boolean"
|
|
376
625
|
},
|
|
@@ -382,11 +631,40 @@
|
|
|
382
631
|
"hasDynamicHelp": false,
|
|
383
632
|
"multiple": false,
|
|
384
633
|
"type": "option"
|
|
634
|
+
},
|
|
635
|
+
"api-key": {
|
|
636
|
+
"description": "Kradle API key",
|
|
637
|
+
"env": "KRADLE_API_KEY",
|
|
638
|
+
"name": "api-key",
|
|
639
|
+
"required": true,
|
|
640
|
+
"hasDynamicHelp": false,
|
|
641
|
+
"multiple": false,
|
|
642
|
+
"type": "option"
|
|
643
|
+
},
|
|
644
|
+
"api-url": {
|
|
645
|
+
"description": "Kradle Web API URL",
|
|
646
|
+
"env": "KRADLE_API_URL",
|
|
647
|
+
"name": "api-url",
|
|
648
|
+
"required": true,
|
|
649
|
+
"default": "https://api.kradle.ai/v0",
|
|
650
|
+
"hasDynamicHelp": false,
|
|
651
|
+
"multiple": false,
|
|
652
|
+
"type": "option"
|
|
653
|
+
},
|
|
654
|
+
"web-url": {
|
|
655
|
+
"description": "Kradle Web URL, used to display the run URL",
|
|
656
|
+
"env": "KRADLE_WEB_URL",
|
|
657
|
+
"name": "web-url",
|
|
658
|
+
"required": true,
|
|
659
|
+
"default": "https://kradle.ai",
|
|
660
|
+
"hasDynamicHelp": false,
|
|
661
|
+
"multiple": false,
|
|
662
|
+
"type": "option"
|
|
385
663
|
}
|
|
386
664
|
},
|
|
387
665
|
"hasDynamicHelp": false,
|
|
388
666
|
"hiddenAliases": [],
|
|
389
|
-
"id": "
|
|
667
|
+
"id": "experiment:run",
|
|
390
668
|
"pluginAlias": "@kradle/cli",
|
|
391
669
|
"pluginName": "@kradle/cli",
|
|
392
670
|
"pluginType": "core",
|
|
@@ -396,10 +674,10 @@
|
|
|
396
674
|
"relativePath": [
|
|
397
675
|
"dist",
|
|
398
676
|
"commands",
|
|
399
|
-
"
|
|
677
|
+
"experiment",
|
|
400
678
|
"run.js"
|
|
401
679
|
]
|
|
402
680
|
}
|
|
403
681
|
},
|
|
404
|
-
"version": "0.0
|
|
682
|
+
"version": "0.1.0"
|
|
405
683
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kradle/cli",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "Kradle's CLI. Manage challenges,
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Kradle's CLI. Manage challenges, experiments, agents and more!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli"
|
|
7
7
|
],
|
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
"watch": "rm -rf dist && tsc --watch",
|
|
26
26
|
"lint": "biome check .",
|
|
27
27
|
"format": "biome format --write . && biome check --write .",
|
|
28
|
-
"prepack": "
|
|
29
|
-
"postpack": "sh scripts/postpack.sh",
|
|
28
|
+
"prepack": "npm run build && npm run version",
|
|
30
29
|
"version": "oclif manifest && oclif readme && git add README.md"
|
|
31
30
|
},
|
|
32
31
|
"dependencies": {
|
|
@@ -76,8 +75,8 @@
|
|
|
76
75
|
"agent": {
|
|
77
76
|
"description": "Manage agents"
|
|
78
77
|
},
|
|
79
|
-
"
|
|
80
|
-
"description": "Manage and run
|
|
78
|
+
"experiment": {
|
|
79
|
+
"description": "Manage and run experiments"
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
}
|
package/static/challenge.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
1
2
|
import { Actions, createChallenge, DEFAULT_CHALLENGE_PATH } from "@kradle/challenges";
|
|
2
|
-
import { config } from "./config.ts";
|
|
3
3
|
|
|
4
|
-
// Extract challenge name from
|
|
5
|
-
const challenge_name =
|
|
4
|
+
// Extract challenge name from folder name
|
|
5
|
+
const challenge_name = path.basename(path.dirname(import.meta.url));
|
|
6
6
|
const GAME_DURATION = 2 * 60 * 20; // 2 minutes
|
|
7
7
|
|
|
8
8
|
createChallenge({
|
|
@@ -13,20 +13,19 @@ createChallenge({
|
|
|
13
13
|
custom_variables: {},
|
|
14
14
|
})
|
|
15
15
|
.events(() => ({
|
|
16
|
-
start_challenge: {
|
|
17
|
-
|
|
16
|
+
start_challenge: () => {
|
|
17
|
+
Actions.announce({ message: ["Challenge starting!"] });
|
|
18
|
+
Actions.setTime({ time: "day" });
|
|
18
19
|
},
|
|
19
|
-
init_participants: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
Actions.setAttribute({ attribute_: "minecraft:generic.max_health", value: 20, target: "all" }),
|
|
23
|
-
],
|
|
20
|
+
init_participants: () => {
|
|
21
|
+
Actions.clear({ target: "all" });
|
|
22
|
+
Actions.setAttribute({ attribute_: "minecraft:generic.max_health", value: 20, target: "all" });
|
|
24
23
|
},
|
|
25
|
-
end_challenge: {
|
|
26
|
-
|
|
24
|
+
end_challenge: () => {
|
|
25
|
+
Actions.announce({ message: ["Challenge ended!"] });
|
|
27
26
|
},
|
|
28
27
|
}))
|
|
29
28
|
.end_condition(({ alive_players }) => alive_players.equalTo(0))
|
|
30
29
|
.win_conditions(({ has_never_died }, { all }) => ({
|
|
31
30
|
[all]: has_never_died.equalTo(1),
|
|
32
|
-
}));
|
|
31
|
+
}));
|