@seriousgaming/sdk-tools 1.10.0 → 1.12.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/dist/agent/guidance.md +35 -23
- package/dist/{cli-F2D4GGUA.js → cli-2BKEIIA3.js} +66 -0
- package/dist/{cli-NQSL2CIH.js → cli-2QGTDHRX.js} +21 -21
- package/dist/{cli-33MZSPPK.js → cli-2SDG3SZ7.js} +21 -21
- package/dist/{cli-CLO7HKEQ.js → cli-2VXP34R5.js} +5 -3
- package/dist/{cli-P3NUTOPK.js → cli-2W4B6PD5.js} +1 -1
- package/dist/{cli-SOO6SEIS.js → cli-2X7DKSXN.js} +28 -25
- package/dist/{cli-LNEZ6KDW.js → cli-2ZP4N7HK.js} +19 -19
- package/dist/{cli-5O7XENQY.js → cli-3GJYZH4C.js} +5 -5
- package/dist/{cli-NAZTYKZT.js → cli-3GO3M2MX.js} +30 -14
- package/dist/{cli-YZJBFKRI.js → cli-3LDLUNME.js} +17 -17
- package/dist/{cli-J42N4PJG.js → cli-3WY6L2WP.js} +31 -29
- package/dist/{cli-WG7MAOCS.js → cli-44MBABRD.js} +25 -25
- package/dist/{cli-MGZYQDCH.js → cli-4IO7MKLR.js} +20 -20
- package/dist/{cli-HNDFANQG.js → cli-4U2PY7W3.js} +1 -1
- package/dist/{cli-4JNF3O5N.js → cli-4WI4LTBI.js} +2 -2
- package/dist/{cli-OTBCA54D.js → cli-55EIGGZK.js} +1 -1
- package/dist/{cli-5TKPT3CY.js → cli-5AQV6FTL.js} +18 -18
- package/dist/{cli-KNXY43YV.js → cli-5CW7BEU7.js} +3 -3
- package/dist/{cli-5V4N4BR4.js → cli-5JUVHNZF.js} +12 -12
- package/dist/{cli-F3YJKP6D.js → cli-5KERL6HV.js} +9 -4
- package/dist/{cli-HN442ZVK.js → cli-5KSA24NQ.js} +24 -24
- package/dist/{cli-5VZBFMCK.js → cli-5PIFO3EN.js} +8 -0
- package/dist/{cli-IQBY7Z7Q.js → cli-5QN2Z43X.js} +20 -20
- package/dist/cli-5XSPAA5X.js +69 -0
- package/dist/{cli-QW7VXL2V.js → cli-62KAYGXO.js} +20 -20
- package/dist/{cli-TDLIPYKT.js → cli-6IMV5ZZU.js} +26 -26
- package/dist/{cli-UULZSQBV.js → cli-6KWCIAN2.js} +764 -66
- package/dist/{cli-2ANX6E3A.js → cli-6NWETIX5.js} +20 -20
- package/dist/{cli-EXUPHPDJ.js → cli-774W3MN5.js} +26 -26
- package/dist/cli-7BUD3VAD.js +16 -0
- package/dist/{cli-7NUFHMGE.js → cli-7KEP57S7.js} +12 -12
- package/dist/{cli-6CYAOUYT.js → cli-7OYFJMA6.js} +18 -18
- package/dist/{cli-ILHHJR2S.js → cli-7ZNEDQ3G.js} +20 -20
- package/dist/{cli-5RRPUL6V.js → cli-AFK6OUID.js} +12 -12
- package/dist/{cli-A3AJQZEN.js → cli-AIYQFWXN.js} +25 -25
- package/dist/{cli-B5DWKRZ4.js → cli-ARAAEWIQ.js} +2 -2
- package/dist/cli-AVQYV3N4.js +36 -0
- package/dist/{cli-35GV2F6R.js → cli-B54Z6CXH.js} +16 -16
- package/dist/{cli-467VRXGP.js → cli-B5TC4MEL.js} +5 -5
- package/dist/{cli-5Z4D3F6Y.js → cli-BCXGOLU3.js} +3 -3
- package/dist/{cli-G2GLW5Z4.js → cli-BHAODVTZ.js} +1 -1
- package/dist/{cli-XR3O2YTV.js → cli-BPS2JG74.js} +20 -20
- package/dist/{cli-W3RG2MRI.js → cli-BVO55SR2.js} +2 -2
- package/dist/{cli-PYAST3G5.js → cli-CFH3JZP5.js} +21 -21
- package/dist/{cli-VZVHS5AP.js → cli-CTK2OIK6.js} +20 -20
- package/dist/{cli-ATWJCB2G.js → cli-CW5MV4VX.js} +4 -4
- package/dist/{cli-TCQJL2GY.js → cli-D5VOSJZ7.js} +1 -1
- package/dist/{cli-KIZTASLL.js → cli-DAEPMK7A.js} +5 -5
- package/dist/{cli-44CM2AH2.js → cli-DAHR7PKB.js} +1 -1
- package/dist/{cli-XW3JLRSA.js → cli-DWDSBTYL.js} +1 -1
- package/dist/cli-DYSDPGXW.js +95 -0
- package/dist/{cli-GRSQRFRG.js → cli-DZCLRZXJ.js} +9 -2
- package/dist/{cli-RSF5R3HC.js → cli-EJ47IE45.js} +28 -25
- package/dist/{cli-QDBYFITU.js → cli-EK4OSJHA.js} +2 -2
- package/dist/{cli-GO64NABP.js → cli-FCJHNXDA.js} +1 -1
- package/dist/{cli-ZNQBF4Z3.js → cli-FNESSE3L.js} +1 -1
- package/dist/{cli-MUOLHQNL.js → cli-FTLH4WCE.js} +17 -17
- package/dist/{cli-JHLWBRXB.js → cli-FYV77YS2.js} +18 -18
- package/dist/cli-GMJX6Q4Q.js +36 -0
- package/dist/{cli-7JUNA74L.js → cli-GRBVNGDW.js} +1 -1
- package/dist/{cli-XKAIDYIE.js → cli-HAFCFY77.js} +33 -19
- package/dist/{cli-OXLOGXT3.js → cli-HCJLYI24.js} +3 -3
- package/dist/{cli-HHRP6FP6.js → cli-HCXS5EXU.js} +25 -25
- package/dist/cli-HEUNNHDH.js +36 -0
- package/dist/{cli-36GABN2A.js → cli-HNUTIWDZ.js} +19 -19
- package/dist/{cli-JXQLHJO2.js → cli-HXT25ETJ.js} +244 -243
- package/dist/{cli-5EH4WTH4.js → cli-IGEL7UJQ.js} +5 -5
- package/dist/{cli-JMNPMDXH.js → cli-IO32YA5N.js} +26 -26
- package/dist/cli-IPTGZDBB.js +36 -0
- package/dist/{cli-L54SXUK6.js → cli-J25TYFKB.js} +19 -19
- package/dist/{cli-CQ4ZR3ZQ.js → cli-J7XYMEMX.js} +20 -20
- package/dist/{cli-5DWR7RPQ.js → cli-JC5OJRID.js} +2 -2
- package/dist/{cli-25SJZI7N.js → cli-JD563OF4.js} +126 -27
- package/dist/{cli-JAVMRERQ.js → cli-JRJF2WHU.js} +20 -20
- package/dist/{cli-UQC46YSV.js → cli-JTFLIMIG.js} +3 -3
- package/dist/{cli-2AH6D32V.js → cli-K2BSJ2PK.js} +2 -2
- package/dist/{cli-XB5PI2XT.js → cli-K4QTYMN2.js} +25 -25
- package/dist/{cli-5SHG2M7E.js → cli-KFJDD4C4.js} +20 -20
- package/dist/{cli-WW54THXN.js → cli-KVQ2JPVD.js} +1 -1
- package/dist/{cli-O5WYATAI.js → cli-L6AHMW2Z.js} +4 -2
- package/dist/{cli-IKSLPAZN.js → cli-LCYUBCVY.js} +4 -4
- package/dist/{cli-HGCOEL5T.js → cli-LEWSCDH5.js} +4 -4
- package/dist/{cli-HNG6PZW2.js → cli-LI6G7GND.js} +27 -27
- package/dist/{cli-2AVPNSAX.js → cli-LU2GCWIU.js} +21 -21
- package/dist/{cli-UEQMK4WX.js → cli-M3Z2KOEB.js} +1 -1
- package/dist/{cli-226ZJ72R.js → cli-M6E3E3I2.js} +170 -3
- package/dist/{cli-OXU6TTEN.js → cli-MCRPA4Z6.js} +20 -20
- package/dist/{cli-BQ36DV5C.js → cli-MI2DEDMA.js} +3 -3
- package/dist/{cli-6O7YCK2M.js → cli-MITZ6SE7.js} +3 -3
- package/dist/{cli-VALLLE6Y.js → cli-MTIYD3BX.js} +26 -26
- package/dist/{cli-5M6KDNVX.js → cli-MTZUJGBK.js} +2 -2
- package/dist/{cli-GSOV26O5.js → cli-NCLMUXLC.js} +14 -14
- package/dist/{cli-Z3DITVBE.js → cli-NLS3DKWH.js} +26 -26
- package/dist/{cli-AH6AMAIB.js → cli-NMDGS7IE.js} +1 -1
- package/dist/cli-O3DJO2CS.js +30 -0
- package/dist/{cli-BC67QHD5.js → cli-O47D5BFN.js} +2 -2
- package/dist/{cli-MDVC5ZNM.js → cli-OBRZ36VP.js} +14 -14
- package/dist/{cli-267QJ2DS.js → cli-OMG4E53H.js} +20 -20
- package/dist/{cli-C32Q5E5I.js → cli-P6V3NSU4.js} +1 -1
- package/dist/{cli-PBSLPO6G.js → cli-PAMQMTHK.js} +21 -21
- package/dist/{cli-RUEPTOWG.js → cli-PKTHOCT3.js} +26 -26
- package/dist/{cli-PTXOKO2Y.js → cli-QK7QAP5H.js} +18 -18
- package/dist/cli-QQ432JEN.js +36 -0
- package/dist/{cli-YFLQ7XOO.js → cli-QVNDPTBU.js} +20 -20
- package/dist/{cli-KJA6GLZI.js → cli-R2DFD6ZZ.js} +15 -15
- package/dist/{cli-6BLVI2JM.js → cli-RMVJMOWU.js} +111 -7
- package/dist/{cli-M6AZFIMV.js → cli-RQISHMJF.js} +88 -23
- package/dist/{cli-X64BNBQH.js → cli-RVZH462G.js} +585 -8
- package/dist/{cli-LLJQI2QP.js → cli-SEEOQVUL.js} +12 -12
- package/dist/{cli-QTCTWYCM.js → cli-SO354HPI.js} +3 -3
- package/dist/{cli-URCHZDTS.js → cli-T76HDH7F.js} +90 -5
- package/dist/{cli-ZJW6HQ6N.js → cli-TIS7DWRR.js} +7 -7
- package/dist/{cli-WOFYI7HZ.js → cli-TY3B6XS7.js} +21 -21
- package/dist/{cli-4FJL3KQZ.js → cli-UKEZJFIT.js} +2 -2
- package/dist/cli-VQAMW4RF.js +95 -0
- package/dist/{cli-4A7RWFNO.js → cli-W4LMRVZT.js} +78 -47
- package/dist/cli-W7I5KGIB.js +84 -0
- package/dist/{cli-B3EFE7ZF.js → cli-WXGJFA4F.js} +1 -1
- package/dist/{cli-IPTHJT3J.js → cli-XCG33I77.js} +28 -25
- package/dist/{cli-WLSACMYA.js → cli-YHLSG5HB.js} +30 -28
- package/dist/cli-YNH5DTHY.js +36 -0
- package/dist/cli-YPMJWPDA.js +69 -0
- package/dist/{cli-PXQYY6KM.js → cli-YSXIR7EM.js} +0 -0
- package/dist/cli-ZPFWO4VW.js +85 -0
- package/dist/cli.js +53 -53
- package/dist/client/index.d.ts +1 -1
- package/dist/client/test-session.d.ts +44 -6
- package/dist/client.js +1934 -286
- package/dist/core/assessment-moves.d.ts +32 -0
- package/dist/core/assessment-reports.d.ts +38 -0
- package/dist/core/assessment-settings.d.ts +15 -0
- package/dist/core/benchmark-samples.d.ts +28 -0
- package/dist/core/session-host.d.ts +4 -0
- package/dist/core/session-roster.d.ts +6 -0
- package/dist/core/session-timers.d.ts +40 -0
- package/dist/core/session.d.ts +14 -1
- package/dist/core/tick-timer.d.ts +18 -0
- package/dist/dev/console/assets/{index-Ch6HHb2T.js → index-zd--5H1f.js} +26 -26
- package/dist/dev/console/index.html +1 -1
- package/dist/dev/shell.d.ts +8 -0
- package/dist/dev/view/commands.d.ts +3 -1
- package/dist/docs/api/index.md +4 -2
- package/dist/docs/api/sdk-commands.md +29 -0
- package/dist/docs/api/sdk-e2e.md +30 -0
- package/dist/docs/api/sdk-projection.md +5 -0
- package/dist/docs/api/sdk-tools-client.md +68 -6
- package/dist/docs/api/sdk-tools-vite.md +21 -0
- package/dist/docs/api/sdk-ui.md +7 -0
- package/dist/docs/api/sdk.md +834 -19
- package/dist/docs/changelog.md +67 -0
- package/dist/docs/cli-error-codes.md +5 -1
- package/dist/docs/cli-reference.md +76 -2
- package/dist/docs/concepts/index.md +2 -0
- package/dist/docs/concepts/terminology.md +12 -0
- package/dist/docs/guides/assessments.md +248 -0
- package/dist/docs/guides/benchmarks.md +241 -0
- package/dist/docs/guides/endpoints.md +1 -1
- package/dist/docs/guides/engine-testing.md +49 -14
- package/dist/docs/guides/engine.md +10 -2
- package/dist/docs/guides/index.md +2 -0
- package/dist/docs/guides/presentation.md +11 -9
- package/dist/docs/guides/session-hooks.md +24 -22
- package/dist/docs/guides/testing.md +3 -8
- package/dist/docs/guides/tick-controller.md +22 -1
- package/dist/docs/guides/ui.md +24 -0
- package/dist/docs/guides/upgrading.md +36 -0
- package/dist/docs/page-index.md +18 -13
- package/dist/docs/recipes/create-assessment.md +124 -0
- package/dist/docs/recipes/create-benchmark.md +115 -0
- package/dist/docs/recipes/create-game.md +1 -1
- package/dist/docs/recipes/fix-duplicate-packages.md +8 -19
- package/dist/docs/recipes/index.md +2 -0
- package/dist/execution/context-composition.d.ts +39 -4
- package/dist/execution/engine-state.d.ts +13 -0
- package/dist/execution/executor.d.ts +16 -0
- package/dist/execution/logic-result.d.ts +13 -2
- package/dist/help-examples.d.ts +12 -0
- package/dist/host/adapter.d.ts +24 -1
- package/dist/host/protocol.d.ts +115 -1
- package/dist/host.js +29 -1
- package/dist/oxlint/logic.json +184 -0
- package/dist/playwright.js +1928 -280
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/manifest-version.d.ts +1 -1
- package/dist/runtime.js +298 -16
- package/dist/schema.json +189 -0
- package/dist/templates/package/README.md.liquid +1 -0
- package/dist/templates/package/claude/rules/workflow-create-engine.md +1 -1
- package/dist/templates/package/claude/rules/workflow-create-user-interface.md +1 -1
- package/dist/templates/package/claude/rules/workflow-test-engine-or-ui.md +1 -1
- package/dist/templates/package/claude/rules/workflow-update-sdk-version.md +2 -2
- package/dist/templates/package/claude/settings.json.template +1 -0
- package/dist/templates/package/oxfmtrc.json.template +8 -1
- package/dist/templates/package/oxlintrc.json.template +1 -180
- package/dist/templates/package/package.json.liquid +1 -0
- package/dist/templates/package/vite.config.ts.liquid +2 -8
- package/dist/templates/package/vitest.config.ts.liquid +2 -8
- package/dist/templates/starter-game/package.json +2 -1
- package/dist/templates/starter-game/testing/engine/game.engine.test.ts +62 -37
- package/dist/templates/starter-game/vite.config.ts +2 -8
- package/dist/templates/starter-game/vitest.config.ts +4 -3
- package/dist/templating/resource-metadata.d.ts +1 -1
- package/dist/utils/error-codes.d.ts +9 -1
- package/dist/utils/resource-scan.d.ts +5 -0
- package/dist/validation/assessment-validation.d.ts +34 -0
- package/dist/validation/benchmark-validation.d.ts +20 -0
- package/dist/validation/schema-validation.d.ts +4 -0
- package/dist/vite/index.d.ts +30 -0
- package/dist/vite.js +12 -0
- package/package.json +12 -4
- package/dist/cli-27Z5T52R.js +0 -30
- package/dist/cli-5XE4OMFL.js +0 -36
- package/dist/cli-BB6CU4ZC.js +0 -36
- package/dist/cli-FGP6YYM7.js +0 -36
- package/dist/cli-I3ZAZYWP.js +0 -36
- package/dist/cli-RFAPPYXK.js +0 -36
- package/dist/cli-WZNIW6ZO.js +0 -16
- package/dist/cli-XEEOJGBL.js +0 -36
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resourceExample
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-2BKEIIA3.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-D5VOSJZ7.js";
|
|
8
8
|
import {
|
|
9
9
|
CliError,
|
|
10
10
|
__commonJS,
|
|
11
11
|
__export,
|
|
12
12
|
__toESM
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-5PIFO3EN.js";
|
|
14
14
|
|
|
15
15
|
// ../node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.js
|
|
16
16
|
var require_extend = __commonJS({
|
|
@@ -259,6 +259,24 @@ var schema_default = {
|
|
|
259
259
|
},
|
|
260
260
|
uniqueItems: true
|
|
261
261
|
},
|
|
262
|
+
benchmarks: {
|
|
263
|
+
type: "array",
|
|
264
|
+
description: "Identifiers of the benchmarks this engine writes. The engine alone writes benchmarks: it receives its current records as `benchmarks`, beside `context`, and returns writes under `benchmarks`, beside `capabilities`. A game that declares any lists the `benchmarks` feature in `requires`",
|
|
265
|
+
items: {
|
|
266
|
+
type: "string",
|
|
267
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
268
|
+
},
|
|
269
|
+
uniqueItems: true
|
|
270
|
+
},
|
|
271
|
+
assessments: {
|
|
272
|
+
type: "array",
|
|
273
|
+
description: "Identifiers of the assessments this engine scores. The engine alone writes assessments: it receives its team's current results as `assessments`, beside `context`, and returns writes under `assessments`, beside `capabilities`. A game that declares any lists the `assessments` feature in `requires`",
|
|
274
|
+
items: {
|
|
275
|
+
type: "string",
|
|
276
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
277
|
+
},
|
|
278
|
+
uniqueItems: true
|
|
279
|
+
},
|
|
262
280
|
aggregate: {
|
|
263
281
|
type: "boolean",
|
|
264
282
|
description: "Generated, not authored. True when the engine's logic exports InitAggregate and RunAggregate, in which case it runs once across all teams rather than per-team via Run, and may write to shared capabilities. The build derives this from the exports and writes it into the bundled manifest; authoring it in engine.sdk.json is an error.",
|
|
@@ -268,6 +286,163 @@ var schema_default = {
|
|
|
268
286
|
required: ["identifier"],
|
|
269
287
|
additionalProperties: false
|
|
270
288
|
},
|
|
289
|
+
BenchmarkField: {
|
|
290
|
+
description: "One field of a benchmark: a number, pooled as a distribution, or one of a short declared list of options, pooled as a count per option",
|
|
291
|
+
oneOf: [
|
|
292
|
+
{
|
|
293
|
+
type: "object",
|
|
294
|
+
properties: {
|
|
295
|
+
type: { const: "number" },
|
|
296
|
+
description: { type: "string" }
|
|
297
|
+
},
|
|
298
|
+
required: ["type"],
|
|
299
|
+
additionalProperties: false
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
type: "object",
|
|
303
|
+
properties: {
|
|
304
|
+
enum: {
|
|
305
|
+
type: "array",
|
|
306
|
+
description: "The options a record may hold. Closed and short, so nothing free-form leaves the session",
|
|
307
|
+
items: {
|
|
308
|
+
type: "string",
|
|
309
|
+
pattern: "^[A-Za-z0-9_-]{1,64}$"
|
|
310
|
+
},
|
|
311
|
+
minItems: 1,
|
|
312
|
+
maxItems: 20,
|
|
313
|
+
uniqueItems: true
|
|
314
|
+
},
|
|
315
|
+
description: { type: "string" }
|
|
316
|
+
},
|
|
317
|
+
required: ["enum"],
|
|
318
|
+
additionalProperties: false
|
|
319
|
+
}
|
|
320
|
+
]
|
|
321
|
+
},
|
|
322
|
+
BenchmarkDefinition: {
|
|
323
|
+
type: "object",
|
|
324
|
+
description: "Definition of a benchmark: outcomes and decisions the engine records for each team (or the session), which a runtime pools anonymously across sessions so a user interface can compare a team with everyone who has played",
|
|
325
|
+
properties: {
|
|
326
|
+
identifier: {
|
|
327
|
+
type: "string",
|
|
328
|
+
description: "Identifier for the benchmark: its directory name",
|
|
329
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
330
|
+
},
|
|
331
|
+
revision: {
|
|
332
|
+
type: "integer",
|
|
333
|
+
minimum: 1,
|
|
334
|
+
description: "Results are pooled per revision. Bump it when a change makes earlier results no longer comparable; leave it alone across ordinary releases so the pool carries on"
|
|
335
|
+
},
|
|
336
|
+
level: {
|
|
337
|
+
type: "string",
|
|
338
|
+
enum: ["team", "session"],
|
|
339
|
+
default: "team",
|
|
340
|
+
description: "'team' (default): one record per team, written by Run or under an aggregate result's teams. 'session': one record for the whole session, written only under an aggregate result's shared"
|
|
341
|
+
},
|
|
342
|
+
tags: {
|
|
343
|
+
type: "array",
|
|
344
|
+
description: "The names a record can be grouped by. The engine sets each one's value, a short string, and a user interface filters on any combination of them",
|
|
345
|
+
items: {
|
|
346
|
+
type: "string",
|
|
347
|
+
pattern: "^[A-Za-z][A-Za-z0-9_]*$"
|
|
348
|
+
},
|
|
349
|
+
maxItems: 5,
|
|
350
|
+
uniqueItems: true
|
|
351
|
+
},
|
|
352
|
+
fields: {
|
|
353
|
+
type: "object",
|
|
354
|
+
description: "The benchmark's fields, flat. 'tags' and 'excluded' are reserved",
|
|
355
|
+
additionalProperties: { $ref: "#/$defs/BenchmarkField" },
|
|
356
|
+
propertyNames: {
|
|
357
|
+
pattern: "^[A-Za-z][A-Za-z0-9_]*$",
|
|
358
|
+
not: { enum: ["tags", "excluded"] }
|
|
359
|
+
},
|
|
360
|
+
minProperties: 1,
|
|
361
|
+
maxProperties: 20
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
required: ["identifier", "revision", "fields"],
|
|
365
|
+
additionalProperties: false
|
|
366
|
+
},
|
|
367
|
+
SDKBenchmark: {
|
|
368
|
+
type: "object",
|
|
369
|
+
description: "Bundle containing a benchmark definition",
|
|
370
|
+
properties: {
|
|
371
|
+
definition: { $ref: "#/$defs/BenchmarkDefinition" }
|
|
372
|
+
},
|
|
373
|
+
required: ["definition"],
|
|
374
|
+
additionalProperties: false
|
|
375
|
+
},
|
|
376
|
+
AssessmentBand: {
|
|
377
|
+
type: "object",
|
|
378
|
+
description: "One band of an assessment's scores, such as 'developing' or 'expert': every score from `from` up to the next band's `from`",
|
|
379
|
+
properties: {
|
|
380
|
+
id: {
|
|
381
|
+
type: "string",
|
|
382
|
+
description: "The band's identifier, reported with each result in it. A user interface shows its own label for it",
|
|
383
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
384
|
+
},
|
|
385
|
+
from: {
|
|
386
|
+
type: "number",
|
|
387
|
+
description: "The lowest score in the band. Bands are listed in ascending order of `from`, and the first starts at the assessment's `min`. A default: the built-in `assessments` settings let a scenario or a session move it"
|
|
388
|
+
},
|
|
389
|
+
passing: {
|
|
390
|
+
type: "boolean",
|
|
391
|
+
description: "Whether a score in this band is a pass. A default, which the built-in `assessments` settings let a scenario or a session change",
|
|
392
|
+
default: false
|
|
393
|
+
},
|
|
394
|
+
description: {
|
|
395
|
+
type: "string",
|
|
396
|
+
description: "What the band means, for whoever reads the game's results"
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
required: ["id", "from"],
|
|
400
|
+
additionalProperties: false
|
|
401
|
+
},
|
|
402
|
+
AssessmentDefinition: {
|
|
403
|
+
type: "object",
|
|
404
|
+
description: "Definition of an assessment: one measure the engine scores for each participant, or for each team, which a runtime may report to a learning management system. The score is the game's; the runtime places it in a band and decides pass or fail from the band",
|
|
405
|
+
properties: {
|
|
406
|
+
identifier: {
|
|
407
|
+
type: "string",
|
|
408
|
+
description: "Identifier for the assessment: its directory name",
|
|
409
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
410
|
+
},
|
|
411
|
+
description: {
|
|
412
|
+
type: "string",
|
|
413
|
+
description: "What the assessment measures, for whoever reads the game's results"
|
|
414
|
+
},
|
|
415
|
+
level: {
|
|
416
|
+
type: "string",
|
|
417
|
+
enum: ["participant", "team"],
|
|
418
|
+
description: "'participant': one score per participant, written for each by participant id. 'team': one score per team, which every participant on the team receives"
|
|
419
|
+
},
|
|
420
|
+
min: {
|
|
421
|
+
type: "number",
|
|
422
|
+
description: "The lowest score the engine may write"
|
|
423
|
+
},
|
|
424
|
+
max: {
|
|
425
|
+
type: "number",
|
|
426
|
+
description: "The highest score the engine may write. Greater than `min`"
|
|
427
|
+
},
|
|
428
|
+
bands: {
|
|
429
|
+
type: "array",
|
|
430
|
+
description: "The ranges a score falls into, ascending, the first starting at `min`: at most 10. Without bands, a result has no band and no pass or fail",
|
|
431
|
+
items: { $ref: "#/$defs/AssessmentBand" }
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
required: ["identifier", "level", "min", "max"],
|
|
435
|
+
additionalProperties: false
|
|
436
|
+
},
|
|
437
|
+
SDKAssessment: {
|
|
438
|
+
type: "object",
|
|
439
|
+
description: "Bundle containing an assessment definition",
|
|
440
|
+
properties: {
|
|
441
|
+
definition: { $ref: "#/$defs/AssessmentDefinition" }
|
|
442
|
+
},
|
|
443
|
+
required: ["definition"],
|
|
444
|
+
additionalProperties: false
|
|
445
|
+
},
|
|
271
446
|
CapabilityDefinition: {
|
|
272
447
|
type: "object",
|
|
273
448
|
description: "Definition of a capability",
|
|
@@ -1296,6 +1471,14 @@ var schema_default = {
|
|
|
1296
1471
|
type: "array",
|
|
1297
1472
|
items: { $ref: "#/$defs/SDKCapability" }
|
|
1298
1473
|
},
|
|
1474
|
+
benchmarks: {
|
|
1475
|
+
type: "array",
|
|
1476
|
+
items: { $ref: "#/$defs/SDKBenchmark" }
|
|
1477
|
+
},
|
|
1478
|
+
assessments: {
|
|
1479
|
+
type: "array",
|
|
1480
|
+
items: { $ref: "#/$defs/SDKAssessment" }
|
|
1481
|
+
},
|
|
1299
1482
|
settings: {
|
|
1300
1483
|
type: "array",
|
|
1301
1484
|
items: { $ref: "#/$defs/SDKSettings" }
|
|
@@ -1682,6 +1865,12 @@ var schema_default = {
|
|
|
1682
1865
|
SDKPackage: { $ref: "#/$defs/SDKPackage" },
|
|
1683
1866
|
SDKEngine: { $ref: "#/$defs/SDKEngine" },
|
|
1684
1867
|
SDKCapability: { $ref: "#/$defs/SDKCapability" },
|
|
1868
|
+
BenchmarkField: { $ref: "#/$defs/BenchmarkField" },
|
|
1869
|
+
BenchmarkDefinition: { $ref: "#/$defs/BenchmarkDefinition" },
|
|
1870
|
+
SDKBenchmark: { $ref: "#/$defs/SDKBenchmark" },
|
|
1871
|
+
AssessmentBand: { $ref: "#/$defs/AssessmentBand" },
|
|
1872
|
+
AssessmentDefinition: { $ref: "#/$defs/AssessmentDefinition" },
|
|
1873
|
+
SDKAssessment: { $ref: "#/$defs/SDKAssessment" },
|
|
1685
1874
|
SDKScenario: { $ref: "#/$defs/SDKScenario" },
|
|
1686
1875
|
SDKUserInterface: { $ref: "#/$defs/SDKUserInterface" },
|
|
1687
1876
|
SDKSetup: {
|
|
@@ -1862,6 +2051,39 @@ var BASES = [
|
|
|
1862
2051
|
mergeDefinition: true,
|
|
1863
2052
|
referencedByReadsWrites: true
|
|
1864
2053
|
},
|
|
2054
|
+
{
|
|
2055
|
+
type: "benchmark",
|
|
2056
|
+
pluralDir: "benchmarks",
|
|
2057
|
+
bundleFile: "benchmark.sdk.json",
|
|
2058
|
+
manifestKey: "benchmarks",
|
|
2059
|
+
kind: "composition",
|
|
2060
|
+
label: "Benchmark",
|
|
2061
|
+
// Only the engine writes benchmarks, so it is the one referrer: a
|
|
2062
|
+
// benchmark anywhere else would let a participant or a facilitator
|
|
2063
|
+
// move the figures every other session is compared with.
|
|
2064
|
+
sites: [
|
|
2065
|
+
{
|
|
2066
|
+
referrerKeys: ["engine"],
|
|
2067
|
+
shape: { kind: "stringArray", path: "benchmarks", labelSuffix: "benchmarks" }
|
|
2068
|
+
}
|
|
2069
|
+
]
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
type: "assessment",
|
|
2073
|
+
pluralDir: "assessments",
|
|
2074
|
+
bundleFile: "assessment.sdk.json",
|
|
2075
|
+
manifestKey: "assessments",
|
|
2076
|
+
kind: "composition",
|
|
2077
|
+
label: "Assessment",
|
|
2078
|
+
// Only the engine scores, so it is the one referrer: a score written
|
|
2079
|
+
// anywhere else could be a participant marking their own work.
|
|
2080
|
+
sites: [
|
|
2081
|
+
{
|
|
2082
|
+
referrerKeys: ["engine"],
|
|
2083
|
+
shape: { kind: "stringArray", path: "assessments", labelSuffix: "assessments" }
|
|
2084
|
+
}
|
|
2085
|
+
]
|
|
2086
|
+
},
|
|
1865
2087
|
{
|
|
1866
2088
|
type: "engine",
|
|
1867
2089
|
slot: "engine",
|
|
@@ -2222,6 +2444,256 @@ var ScenarioAssetTooLargeError = class _ScenarioAssetTooLargeError extends Error
|
|
|
2222
2444
|
}
|
|
2223
2445
|
};
|
|
2224
2446
|
|
|
2447
|
+
// ../sdk/lib/build/benchmarks.js
|
|
2448
|
+
var BENCHMARKS_FEATURE = "benchmarks";
|
|
2449
|
+
var BENCHMARK_TAG_VALUE_PATTERN = /^[A-Za-z0-9:._-]{1,64}$/;
|
|
2450
|
+
var MAX_BENCHMARKS_PER_GAME = 20;
|
|
2451
|
+
function resolveBenchmarkLevel(definition3) {
|
|
2452
|
+
return definition3.level ?? "team";
|
|
2453
|
+
}
|
|
2454
|
+
function isRecord(value) {
|
|
2455
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2456
|
+
}
|
|
2457
|
+
function benchmarkWriteProblem(definition3, write) {
|
|
2458
|
+
if (write === null)
|
|
2459
|
+
return null;
|
|
2460
|
+
if (!isRecord(write))
|
|
2461
|
+
return "must be an object, or null to remove the record";
|
|
2462
|
+
for (const [name, value] of Object.entries(write)) {
|
|
2463
|
+
if (value === void 0 || value === null)
|
|
2464
|
+
continue;
|
|
2465
|
+
if (name === "tags") {
|
|
2466
|
+
if (!isRecord(value))
|
|
2467
|
+
return `"tags" must be an object of tag values`;
|
|
2468
|
+
const declared = definition3.tags ?? [];
|
|
2469
|
+
for (const [tag, tagValue] of Object.entries(value)) {
|
|
2470
|
+
if (!declared.includes(tag)) {
|
|
2471
|
+
return declared.length === 0 ? `tag "${tag}" is not declared: the benchmark declares no tags` : `tag "${tag}" is not declared; declared tags are ${declared.map((t) => `"${t}"`).join(", ")}`;
|
|
2472
|
+
}
|
|
2473
|
+
if (tagValue === void 0 || tagValue === null)
|
|
2474
|
+
continue;
|
|
2475
|
+
if (typeof tagValue !== "string" || !BENCHMARK_TAG_VALUE_PATTERN.test(tagValue)) {
|
|
2476
|
+
return `tag "${tag}" must be 1 to 64 characters of letters, digits, ':', '.', '_' or '-', got ${JSON.stringify(tagValue)}`;
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
continue;
|
|
2480
|
+
}
|
|
2481
|
+
if (name === "excluded") {
|
|
2482
|
+
if (typeof value !== "boolean") {
|
|
2483
|
+
return `"excluded" must be a boolean, got ${JSON.stringify(value)}`;
|
|
2484
|
+
}
|
|
2485
|
+
continue;
|
|
2486
|
+
}
|
|
2487
|
+
const field = definition3.fields[name];
|
|
2488
|
+
if (!field)
|
|
2489
|
+
return `field "${name}" is not declared`;
|
|
2490
|
+
if ("type" in field) {
|
|
2491
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
2492
|
+
return `field "${name}" must be a finite number, got ${JSON.stringify(value)}`;
|
|
2493
|
+
}
|
|
2494
|
+
} else if (typeof value !== "string" || !field.enum.includes(value)) {
|
|
2495
|
+
return `field "${name}" must be one of ${field.enum.map((o) => JSON.stringify(o)).join(", ")}, got ${JSON.stringify(value)}`;
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
return null;
|
|
2499
|
+
}
|
|
2500
|
+
function applyBenchmarkWrite(current, write) {
|
|
2501
|
+
if (write === null)
|
|
2502
|
+
return void 0;
|
|
2503
|
+
const next = { ...current };
|
|
2504
|
+
for (const [name, value] of Object.entries(write)) {
|
|
2505
|
+
if (value === void 0)
|
|
2506
|
+
continue;
|
|
2507
|
+
if (value === null) {
|
|
2508
|
+
delete next[name];
|
|
2509
|
+
} else if (name === "tags" && isRecord(value)) {
|
|
2510
|
+
const tags = Object.fromEntries(Object.entries(value).filter(([, tagValue]) => typeof tagValue === "string"));
|
|
2511
|
+
if (Object.keys(tags).length === 0)
|
|
2512
|
+
delete next.tags;
|
|
2513
|
+
else
|
|
2514
|
+
next.tags = tags;
|
|
2515
|
+
} else {
|
|
2516
|
+
next[name] = value;
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
return Object.keys(next).length === 0 ? void 0 : next;
|
|
2520
|
+
}
|
|
2521
|
+
function benchmarkFilters(query) {
|
|
2522
|
+
const where = query?.where;
|
|
2523
|
+
const filters = where === void 0 ? [{}] : Array.isArray(where) ? where : [where];
|
|
2524
|
+
if (filters.length === 0) {
|
|
2525
|
+
throw new Error('getBenchmark: "where" must hold at least one filter');
|
|
2526
|
+
}
|
|
2527
|
+
for (const filter of filters) {
|
|
2528
|
+
if (!isRecord(filter) || Object.values(filter).some((v) => typeof v !== "string")) {
|
|
2529
|
+
throw new Error("getBenchmark: each filter must be an object of tag names to strings");
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
return filters.map((filter) => ({ ...filter }));
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
// ../sdk/lib/build/assessments.js
|
|
2536
|
+
var ASSESSMENTS_FEATURE = "assessments";
|
|
2537
|
+
var ASSESSMENTS_SETTINGS = "assessments";
|
|
2538
|
+
var MAX_ASSESSMENTS_PER_GAME = 20;
|
|
2539
|
+
var ASSESSMENT_FEEDBACK_MAX_LENGTH = 500;
|
|
2540
|
+
function isRecord2(value) {
|
|
2541
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2542
|
+
}
|
|
2543
|
+
function foldRecord(definition3, current, write) {
|
|
2544
|
+
if (write === null)
|
|
2545
|
+
return { next: void 0 };
|
|
2546
|
+
if (!isRecord2(write))
|
|
2547
|
+
return { problem: "must be an object, or null to remove the result" };
|
|
2548
|
+
const next = isRecord2(current) ? { ...current } : {};
|
|
2549
|
+
for (const [name, value] of Object.entries(write)) {
|
|
2550
|
+
if (value === void 0)
|
|
2551
|
+
continue;
|
|
2552
|
+
if (name === "score") {
|
|
2553
|
+
if (value === null)
|
|
2554
|
+
return { problem: '"score" cannot be removed; remove the result' };
|
|
2555
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
2556
|
+
return { problem: `"score" must be a finite number, got ${JSON.stringify(value)}` };
|
|
2557
|
+
}
|
|
2558
|
+
if (value < definition3.min || value > definition3.max) {
|
|
2559
|
+
return {
|
|
2560
|
+
problem: `"score" must be between ${definition3.min} and ${definition3.max}, got ${value}`
|
|
2561
|
+
};
|
|
2562
|
+
}
|
|
2563
|
+
next.score = value;
|
|
2564
|
+
} else if (name === "feedback") {
|
|
2565
|
+
if (value === null) {
|
|
2566
|
+
delete next.feedback;
|
|
2567
|
+
} else if (typeof value !== "string") {
|
|
2568
|
+
return { problem: `"feedback" must be a string, got ${JSON.stringify(value)}` };
|
|
2569
|
+
} else if (value.length > ASSESSMENT_FEEDBACK_MAX_LENGTH) {
|
|
2570
|
+
return {
|
|
2571
|
+
problem: `"feedback" must be at most ${ASSESSMENT_FEEDBACK_MAX_LENGTH} characters, got ${value.length}`
|
|
2572
|
+
};
|
|
2573
|
+
} else {
|
|
2574
|
+
next.feedback = value;
|
|
2575
|
+
}
|
|
2576
|
+
} else if (name === "final") {
|
|
2577
|
+
if (value === null) {
|
|
2578
|
+
delete next.final;
|
|
2579
|
+
} else if (typeof value !== "boolean") {
|
|
2580
|
+
return { problem: `"final" must be a boolean, got ${JSON.stringify(value)}` };
|
|
2581
|
+
} else if (value) {
|
|
2582
|
+
next.final = true;
|
|
2583
|
+
} else {
|
|
2584
|
+
delete next.final;
|
|
2585
|
+
}
|
|
2586
|
+
} else {
|
|
2587
|
+
return {
|
|
2588
|
+
problem: `"${name}" is not a field of a result; use score, feedback or final`
|
|
2589
|
+
};
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
if (next.score === void 0) {
|
|
2593
|
+
return { problem: 'a result needs a "score", and this write leaves it without one' };
|
|
2594
|
+
}
|
|
2595
|
+
return { next };
|
|
2596
|
+
}
|
|
2597
|
+
function foldAssessmentWrite(definition3, current, write, participantIds) {
|
|
2598
|
+
if (definition3.level === "team")
|
|
2599
|
+
return foldRecord(definition3, current, write);
|
|
2600
|
+
if (write === null)
|
|
2601
|
+
return { next: void 0 };
|
|
2602
|
+
if (!isRecord2(write)) {
|
|
2603
|
+
return {
|
|
2604
|
+
problem: "must be an object of results by participant id, or null to remove every result"
|
|
2605
|
+
};
|
|
2606
|
+
}
|
|
2607
|
+
const records = isRecord2(current) ? { ...current } : {};
|
|
2608
|
+
for (const [participantId, recordWrite] of Object.entries(write)) {
|
|
2609
|
+
if (recordWrite === void 0)
|
|
2610
|
+
continue;
|
|
2611
|
+
if (recordWrite !== null && !participantIds.has(participantId)) {
|
|
2612
|
+
return {
|
|
2613
|
+
problem: `participant "${participantId}" is not on this team, so it cannot be scored here`
|
|
2614
|
+
};
|
|
2615
|
+
}
|
|
2616
|
+
const folded = foldRecord(definition3, records[participantId], recordWrite);
|
|
2617
|
+
if ("problem" in folded) {
|
|
2618
|
+
return { problem: `participant "${participantId}": ${folded.problem}` };
|
|
2619
|
+
}
|
|
2620
|
+
if (folded.next === void 0)
|
|
2621
|
+
delete records[participantId];
|
|
2622
|
+
else
|
|
2623
|
+
records[participantId] = folded.next;
|
|
2624
|
+
}
|
|
2625
|
+
return { next: Object.keys(records).length === 0 ? void 0 : records };
|
|
2626
|
+
}
|
|
2627
|
+
function resolveAssessmentBands(definition3, settings) {
|
|
2628
|
+
return (definition3.bands ?? []).map((band) => {
|
|
2629
|
+
const override = settings?.[band.id];
|
|
2630
|
+
return {
|
|
2631
|
+
id: band.id,
|
|
2632
|
+
from: typeof override?.from === "number" ? override.from : band.from,
|
|
2633
|
+
passing: typeof override?.passing === "boolean" ? override.passing : band.passing === true
|
|
2634
|
+
};
|
|
2635
|
+
});
|
|
2636
|
+
}
|
|
2637
|
+
function assessmentBandOf(score, bands) {
|
|
2638
|
+
let found = null;
|
|
2639
|
+
for (const band of bands)
|
|
2640
|
+
if (band.from <= score)
|
|
2641
|
+
found = band;
|
|
2642
|
+
return found;
|
|
2643
|
+
}
|
|
2644
|
+
function buildAssessmentReport(input) {
|
|
2645
|
+
const { definition: definition3, bands, teams, participants, audience } = input;
|
|
2646
|
+
const result = (record, teamId, complete, participantId) => {
|
|
2647
|
+
if (!isRecord2(record) || typeof record.score !== "number")
|
|
2648
|
+
return null;
|
|
2649
|
+
const band = assessmentBandOf(record.score, bands);
|
|
2650
|
+
const span = definition3.max - definition3.min;
|
|
2651
|
+
return {
|
|
2652
|
+
teamId,
|
|
2653
|
+
...participantId === void 0 ? {} : { participantId },
|
|
2654
|
+
score: record.score,
|
|
2655
|
+
scaled: span > 0 ? (record.score - definition3.min) / span : 0,
|
|
2656
|
+
band: band?.id ?? null,
|
|
2657
|
+
passed: band === null ? null : band.passing,
|
|
2658
|
+
...typeof record.feedback === "string" ? { feedback: record.feedback } : {},
|
|
2659
|
+
final: record.final === true || complete
|
|
2660
|
+
};
|
|
2661
|
+
};
|
|
2662
|
+
const results = [];
|
|
2663
|
+
if (definition3.level === "team") {
|
|
2664
|
+
for (const team of teams) {
|
|
2665
|
+
if (audience.kind !== "all" && audience.teamId !== team.teamId)
|
|
2666
|
+
continue;
|
|
2667
|
+
const row = result(team.records, team.teamId, team.complete);
|
|
2668
|
+
if (row)
|
|
2669
|
+
results.push(row);
|
|
2670
|
+
}
|
|
2671
|
+
} else {
|
|
2672
|
+
const byTeam = new Map(teams.map((team) => [team.teamId, team]));
|
|
2673
|
+
for (const participant of participants) {
|
|
2674
|
+
if (audience.kind === "team" && audience.teamId !== participant.teamId)
|
|
2675
|
+
continue;
|
|
2676
|
+
if (audience.kind === "participant" && audience.participantId !== participant.id) {
|
|
2677
|
+
continue;
|
|
2678
|
+
}
|
|
2679
|
+
const team = byTeam.get(participant.teamId);
|
|
2680
|
+
if (!team || !isRecord2(team.records))
|
|
2681
|
+
continue;
|
|
2682
|
+
const row = result(team.records[participant.id], team.teamId, team.complete, participant.id);
|
|
2683
|
+
if (row)
|
|
2684
|
+
results.push(row);
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
return {
|
|
2688
|
+
identifier: definition3.identifier,
|
|
2689
|
+
level: definition3.level,
|
|
2690
|
+
min: definition3.min,
|
|
2691
|
+
max: definition3.max,
|
|
2692
|
+
bands: bands.map((band) => ({ ...band })),
|
|
2693
|
+
results
|
|
2694
|
+
};
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2225
2697
|
// cli/utils/local-refs.ts
|
|
2226
2698
|
function isLocalRef(ref) {
|
|
2227
2699
|
return ref === "#" || ref.startsWith("#/");
|
|
@@ -2533,6 +3005,8 @@ var settingsAjv = createAjv("reference");
|
|
|
2533
3005
|
ajv.addSchema(schema, "schema.json");
|
|
2534
3006
|
var validators = {
|
|
2535
3007
|
sdkCapability: ajv.compile({ $ref: "schema.json#/$defs/SDKCapability" }),
|
|
3008
|
+
sdkBenchmark: ajv.compile({ $ref: "schema.json#/$defs/SDKBenchmark" }),
|
|
3009
|
+
sdkAssessment: ajv.compile({ $ref: "schema.json#/$defs/SDKAssessment" }),
|
|
2536
3010
|
sdkSettings: ajv.compile({ $ref: "schema.json#/$defs/SDKSettings" }),
|
|
2537
3011
|
sdkEngine: ajv.compile({ $ref: "schema.json#/$defs/SDKEngine" }),
|
|
2538
3012
|
sdkUserInterface: ajv.compile({
|
|
@@ -2684,6 +3158,16 @@ var validateSDKCapability = makeValidator(
|
|
|
2684
3158
|
"capability.sdk.json",
|
|
2685
3159
|
resourceExample("capability", "new")
|
|
2686
3160
|
);
|
|
3161
|
+
var validateSDKBenchmark = makeValidator(
|
|
3162
|
+
validators.sdkBenchmark,
|
|
3163
|
+
"benchmark.sdk.json",
|
|
3164
|
+
resourceExample("benchmark", "new")
|
|
3165
|
+
);
|
|
3166
|
+
var validateSDKAssessment = makeValidator(
|
|
3167
|
+
validators.sdkAssessment,
|
|
3168
|
+
"assessment.sdk.json",
|
|
3169
|
+
resourceExample("assessment", "new")
|
|
3170
|
+
);
|
|
2687
3171
|
var validateSDKSettings = makeValidator(
|
|
2688
3172
|
validators.sdkSettings,
|
|
2689
3173
|
"settings.sdk.json",
|
|
@@ -3138,7 +3622,7 @@ function packageRelativePath(file, packageRoot) {
|
|
|
3138
3622
|
|
|
3139
3623
|
// cli/runtime/manifest-version.ts
|
|
3140
3624
|
var MANIFEST_VERSION = 3;
|
|
3141
|
-
var SPEC_REVISION = "1.
|
|
3625
|
+
var SPEC_REVISION = "1.10";
|
|
3142
3626
|
var SUPPORTED_FEATURES = [
|
|
3143
3627
|
// A validator's `Scenario` gate (§15.8).
|
|
3144
3628
|
"scenario-validation",
|
|
@@ -3147,7 +3631,11 @@ var SUPPORTED_FEATURES = [
|
|
|
3147
3631
|
// File reads in a validator's `Scenario` gate (§15.8).
|
|
3148
3632
|
"scenario-files",
|
|
3149
3633
|
// The `Scenario` gate judging a session as it starts, and refusing it (§15.8).
|
|
3150
|
-
"session-validation"
|
|
3634
|
+
"session-validation",
|
|
3635
|
+
// Benchmarks: engine-written records pooled across sessions (§6.16).
|
|
3636
|
+
"benchmarks",
|
|
3637
|
+
// Assessments: engine-written scores per participant or team, in bands (§6.17).
|
|
3638
|
+
"assessments"
|
|
3151
3639
|
];
|
|
3152
3640
|
function unsupportedFeatures(manifest) {
|
|
3153
3641
|
return (manifest.requires ?? []).filter((feature) => !SUPPORTED_FEATURES.includes(feature));
|
|
@@ -3216,6 +3704,56 @@ async function readLogicExports(filePath, names, packageRoot) {
|
|
|
3216
3704
|
}
|
|
3217
3705
|
}
|
|
3218
3706
|
|
|
3707
|
+
// cli/core/assessment-settings.ts
|
|
3708
|
+
function assessmentSettingsResource(assessments) {
|
|
3709
|
+
const properties = {};
|
|
3710
|
+
for (const { definition: definition3 } of assessments) {
|
|
3711
|
+
const bands = definition3.bands ?? [];
|
|
3712
|
+
if (bands.length === 0) continue;
|
|
3713
|
+
const bandProperties = {};
|
|
3714
|
+
const defaults = {};
|
|
3715
|
+
for (const band of bands) {
|
|
3716
|
+
const value = { from: band.from, passing: band.passing === true };
|
|
3717
|
+
defaults[band.id] = value;
|
|
3718
|
+
bandProperties[band.id] = {
|
|
3719
|
+
type: "object",
|
|
3720
|
+
title: band.id,
|
|
3721
|
+
properties: {
|
|
3722
|
+
from: {
|
|
3723
|
+
type: "number",
|
|
3724
|
+
title: "Lowest score",
|
|
3725
|
+
minimum: definition3.min,
|
|
3726
|
+
maximum: definition3.max,
|
|
3727
|
+
default: value.from
|
|
3728
|
+
},
|
|
3729
|
+
passing: { type: "boolean", title: "Counts as a pass", default: value.passing }
|
|
3730
|
+
},
|
|
3731
|
+
additionalProperties: false,
|
|
3732
|
+
default: value
|
|
3733
|
+
};
|
|
3734
|
+
}
|
|
3735
|
+
properties[definition3.identifier] = {
|
|
3736
|
+
type: "object",
|
|
3737
|
+
title: definition3.identifier,
|
|
3738
|
+
...definition3.description ? { description: definition3.description } : {},
|
|
3739
|
+
properties: bandProperties,
|
|
3740
|
+
additionalProperties: false,
|
|
3741
|
+
default: defaults
|
|
3742
|
+
};
|
|
3743
|
+
}
|
|
3744
|
+
if (Object.keys(properties).length === 0) return null;
|
|
3745
|
+
return {
|
|
3746
|
+
definition: {
|
|
3747
|
+
identifier: ASSESSMENTS_SETTINGS,
|
|
3748
|
+
settingsSchema: {
|
|
3749
|
+
type: "object",
|
|
3750
|
+
properties,
|
|
3751
|
+
additionalProperties: false
|
|
3752
|
+
}
|
|
3753
|
+
}
|
|
3754
|
+
};
|
|
3755
|
+
}
|
|
3756
|
+
|
|
3219
3757
|
// cli/setup/setup-notes.ts
|
|
3220
3758
|
import { existsSync as existsSync2, readdirSync, readFileSync } from "fs";
|
|
3221
3759
|
import { join } from "path";
|
|
@@ -15869,8 +16407,16 @@ async function loadConfig(configPath) {
|
|
|
15869
16407
|
problems.throwIfAny();
|
|
15870
16408
|
assertRequiredFeaturesSupported(jsonConfig, configPath);
|
|
15871
16409
|
const capabilities = await discover(configDir, KINDS.capability, problems);
|
|
16410
|
+
const benchmarks = await discover(configDir, KINDS.benchmark, problems);
|
|
16411
|
+
const assessments = await discover(configDir, KINDS.assessment, problems);
|
|
15872
16412
|
const authoredSettings = await discover(configDir, KINDS.settings, problems);
|
|
15873
16413
|
refuseReservedSettings(problems, authoredSettings);
|
|
16414
|
+
if (assessments.length > 0) refuseAssessmentSettings(problems, authoredSettings);
|
|
16415
|
+
const assessmentSettings = assessmentSettingsResource(assessments);
|
|
16416
|
+
const builtInSettings = () => [
|
|
16417
|
+
gameSettingsResource(jsonConfig),
|
|
16418
|
+
...assessmentSettings ? [assessmentSettings] : []
|
|
16419
|
+
];
|
|
15874
16420
|
const scenarios = await discover(configDir, KINDS.scenario, problems);
|
|
15875
16421
|
const hooks = await discover(configDir, KINDS.hook, problems);
|
|
15876
16422
|
const discoveredValidators = await discover(configDir, KINDS.validator, problems);
|
|
@@ -15908,7 +16454,7 @@ async function loadConfig(configPath) {
|
|
|
15908
16454
|
refuseUnknownSettingsInSetupNotes(
|
|
15909
16455
|
setup,
|
|
15910
16456
|
configDir,
|
|
15911
|
-
[
|
|
16457
|
+
[...builtInSettings(), ...authoredSettings],
|
|
15912
16458
|
problems
|
|
15913
16459
|
);
|
|
15914
16460
|
problems.throwIfAny();
|
|
@@ -15940,8 +16486,10 @@ async function loadConfig(configPath) {
|
|
|
15940
16486
|
...tick_controller ? { tick_controller } : {},
|
|
15941
16487
|
...guide ? { guide } : {},
|
|
15942
16488
|
capabilities,
|
|
15943
|
-
|
|
15944
|
-
|
|
16489
|
+
...benchmarks.length > 0 ? { benchmarks } : {},
|
|
16490
|
+
...assessments.length > 0 ? { assessments } : {},
|
|
16491
|
+
// The built-in settings come first, then the package's own.
|
|
16492
|
+
settings: [...builtInSettings(), ...authoredSettings],
|
|
15945
16493
|
scenarios,
|
|
15946
16494
|
hooks,
|
|
15947
16495
|
validators: validators2,
|
|
@@ -16090,6 +16638,19 @@ function refuseReservedSettings(problems, settings) {
|
|
|
16090
16638
|
}
|
|
16091
16639
|
]);
|
|
16092
16640
|
}
|
|
16641
|
+
function refuseAssessmentSettings(problems, settings) {
|
|
16642
|
+
if (!settings.some((entry) => entry.definition.identifier === ASSESSMENTS_SETTINGS)) return;
|
|
16643
|
+
const message = `\`settings/${ASSESSMENTS_SETTINGS}/\` is reserved for the built-in assessment band settings`;
|
|
16644
|
+
const hint = "Set an assessment's bands in its assessment.sdk.json, and rename this settings resource.";
|
|
16645
|
+
problems.add("SETTINGS_RESERVED", `Invalid package: ${message}. ${hint}`, [
|
|
16646
|
+
{
|
|
16647
|
+
code: "SETTINGS_RESERVED",
|
|
16648
|
+
message,
|
|
16649
|
+
hint,
|
|
16650
|
+
file: `settings/${ASSESSMENTS_SETTINGS}/settings.sdk.json`
|
|
16651
|
+
}
|
|
16652
|
+
]);
|
|
16653
|
+
}
|
|
16093
16654
|
function refuseUnknownSettingsInSetupNotes(setup, configDir, settings, problems) {
|
|
16094
16655
|
if (!setup) return;
|
|
16095
16656
|
const schemas = settingsSchemas({ settings: [...settings] });
|
|
@@ -16269,6 +16830,8 @@ function kind(type, validate, hasRootDirectory = true) {
|
|
|
16269
16830
|
}
|
|
16270
16831
|
var KINDS = {
|
|
16271
16832
|
capability: kind("capability", validateSDKCapability, false),
|
|
16833
|
+
benchmark: kind("benchmark", validateSDKBenchmark, false),
|
|
16834
|
+
assessment: kind("assessment", validateSDKAssessment, false),
|
|
16272
16835
|
settings: kind("settings", validateSDKSettings, false),
|
|
16273
16836
|
engine: kind("engine", validateSDKEngine),
|
|
16274
16837
|
ui: kind("ui", validateSDKUserInterface),
|
|
@@ -16379,6 +16942,18 @@ export {
|
|
|
16379
16942
|
parseSettingPath,
|
|
16380
16943
|
SCENARIO_GATE_READ_LIMIT_BYTES,
|
|
16381
16944
|
ScenarioAssetTooLargeError,
|
|
16945
|
+
BENCHMARKS_FEATURE,
|
|
16946
|
+
MAX_BENCHMARKS_PER_GAME,
|
|
16947
|
+
resolveBenchmarkLevel,
|
|
16948
|
+
benchmarkWriteProblem,
|
|
16949
|
+
applyBenchmarkWrite,
|
|
16950
|
+
benchmarkFilters,
|
|
16951
|
+
ASSESSMENTS_FEATURE,
|
|
16952
|
+
ASSESSMENTS_SETTINGS,
|
|
16953
|
+
MAX_ASSESSMENTS_PER_GAME,
|
|
16954
|
+
foldAssessmentWrite,
|
|
16955
|
+
resolveAssessmentBands,
|
|
16956
|
+
buildAssessmentReport,
|
|
16382
16957
|
isLocalRef,
|
|
16383
16958
|
resolveLocalRef,
|
|
16384
16959
|
dereference,
|
|
@@ -16400,6 +16975,8 @@ export {
|
|
|
16400
16975
|
pointerOf,
|
|
16401
16976
|
didYouMean,
|
|
16402
16977
|
validateSDKCapability,
|
|
16978
|
+
validateSDKBenchmark,
|
|
16979
|
+
validateSDKAssessment,
|
|
16403
16980
|
validateSDKSettings,
|
|
16404
16981
|
validateSDKEngine,
|
|
16405
16982
|
validateSDKUserInterface,
|