@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
package/dist/agent/guidance.md
CHANGED
|
@@ -38,10 +38,10 @@ pnpm run --silent sdk docs view recipes/index.md # every recipe, o
|
|
|
38
38
|
pnpm run --silent sdk docs view recipes/create-hook.md # one document
|
|
39
39
|
pnpm run --silent sdk docs view guides/session.md --outline # the headings of a page, with section lengths
|
|
40
40
|
pnpm run --silent sdk docs view guides/session.md --section 'Building the session UI' # one section
|
|
41
|
-
pnpm run --silent sdk docs view cli-reference.md
|
|
41
|
+
pnpm run --silent sdk docs view cli-reference.md --outline # every command, to pick a section from
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Some
|
|
44
|
+
Some pages run past 50,000 characters, more than one read may show you. Before reading a long page whole, find it in `page-index.md`, list its headings with `--outline`, and read the section you need with `--section`. Never read `cli-reference.md`, `changelog.md` or `guides/upgrading.md` whole: each is far longer than that, and `pnpm run sdk <command> --help` answers a question about one command.
|
|
45
45
|
|
|
46
46
|
The same files are on disk in `node_modules/@seriousgaming/sdk-tools/dist/docs/`, so you can search them with `grep -rn`. Start from `recipes/` for a task, `guides/` for a whole subject, and `concepts/` for the model.
|
|
47
47
|
|
|
@@ -95,6 +95,8 @@ Data flows: surfaces write decisions with `setData`, a tick runs the engine, and
|
|
|
95
95
|
├── hooks/<name>/ # Lifecycle handlers
|
|
96
96
|
├── validators/<name>/ # Reject-only gates on writes and tick requests
|
|
97
97
|
├── scenarios/<name>/ # Settings overrides, plus assets
|
|
98
|
+
├── benchmarks/<name>/ # Outcomes pooled across sessions, for a debrief to compare against
|
|
99
|
+
├── assessments/<name>/ # Scores for each participant or team, in bands, for a debrief or an LMS
|
|
98
100
|
├── testing/engine/ # Whole-game tests (createTestSession)
|
|
99
101
|
└── testing/e2e/ # Playwright specs, and the global setup that starts their server
|
|
100
102
|
```
|
|
@@ -110,17 +112,24 @@ Pass `--json` to any command (or set `SERIOUSGAMING_JSON=1`) and it prints exact
|
|
|
110
112
|
{ "ok": false, "command": "build", "error": { "code": "PACKAGE_INVALID", "message": "…", "hint": "…" }, "diagnostics": [{ "severity": "error", "code": "SETTINGS_UNKNOWN_KEY", "file": "scenarios/hard/scenario.sdk.json", "pointer": "/definition/settings/engine/BaseDemnd", "hint": "Did you mean 'BaseDemand'?", "message": "…" }], "warnings": [] }
|
|
111
113
|
```
|
|
112
114
|
|
|
113
|
-
After every change, run
|
|
115
|
+
After every change, run the package's own check. It stops at the first step that fails, and it is the package's script, so it may hold more steps than these:
|
|
114
116
|
|
|
115
117
|
```bash
|
|
116
|
-
pnpm
|
|
117
|
-
pnpm run typecheck # tsc over the whole package
|
|
118
|
-
pnpm run lint # oxlint, warnings included
|
|
119
|
-
pnpm test:run # unit and component tests beside each resource
|
|
120
|
-
pnpm test:engine # whole games, in-process
|
|
121
|
-
pnpm run --silent sdk tick --no-server --json # one tick in the restricted production runtime
|
|
118
|
+
pnpm check
|
|
122
119
|
```
|
|
123
120
|
|
|
121
|
+
```bash
|
|
122
|
+
pnpm run --silent sdk build --validate-only # the package: bundles, references, settings
|
|
123
|
+
pnpm run typecheck # tsc over the whole package
|
|
124
|
+
pnpm run lint # oxlint, warnings included; flags a host global in logic
|
|
125
|
+
pnpm test:run # unit and component tests beside each resource
|
|
126
|
+
pnpm test:engine # whole games, in-process, in the restricted runtime
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`pnpm test:engine` runs logic in the same restricted runtime `sdk tick` does, so a global the production runtime lacks fails there as `ReferenceError`. Keep a test in `testing/engine/` that starts every scenario and plays a tick: a scenario's settings are only exercised when the game is played on them. A package scaffolded before 1.11 has no `check` script; add it from `guides/upgrading.md`, or run the five steps in order. When a step fails, rerun that one command with `--json` for the diagnostics.
|
|
130
|
+
|
|
131
|
+
`pnpm run --silent sdk tick --no-server --summary` plays one tick by hand, as a smoke test, and prints only the session head.
|
|
132
|
+
|
|
124
133
|
Branch on `ok`, the exit code and `error.code`, never on the message:
|
|
125
134
|
|
|
126
135
|
| Exit | Meaning | What to do |
|
|
@@ -157,15 +166,15 @@ A slot command takes no identifier. `new` refuses a slot that is already filled,
|
|
|
157
166
|
### Playing the game from the CLI
|
|
158
167
|
|
|
159
168
|
```bash
|
|
160
|
-
pnpm run --silent sdk init
|
|
161
|
-
pnpm run --silent sdk tick --patch '[{"op":"replace","path":"/<capability>/<variable>","value":70}]'
|
|
169
|
+
pnpm run --silent sdk init --summary # start the session, or rebuild it at tick 0
|
|
170
|
+
pnpm run --silent sdk tick --summary --patch '[{"op":"replace","path":"/<capability>/<variable>","value":70}]'
|
|
162
171
|
pnpm run --silent sdk patch '[{"op":"replace","path":"/<capability>/<variable>","value":0}]'
|
|
163
172
|
pnpm run --silent sdk view # the current state (--full for the whole projection)
|
|
164
173
|
pnpm run --silent sdk undo # undo the last tick
|
|
165
174
|
pnpm run --silent sdk reset # back to tick 0
|
|
166
175
|
```
|
|
167
176
|
|
|
168
|
-
Patch paths start at the capability. `--team N` picks the team in a game with several. `pnpm run sdk configure '{"<settings>":{"<property>":60}}'` overrides settings for the session, keyed by settings identifier, and restarts a running session on the new values.
|
|
177
|
+
`init`, `tick` and `view` print every team's context unless you pass `--summary`, which prints only the session head (the tick count and whether the game is complete). Pass it whenever you are not about to read the context, and use `view --team N` when you are. Patch paths start at the capability. `--team N` picks the team in a game with several. `pnpm run sdk configure '{"<settings>":{"<property>":60}}'` overrides settings for the session, keyed by settings identifier, and restarts a running session on the new values.
|
|
169
178
|
|
|
170
179
|
**Know which session a command touches:**
|
|
171
180
|
|
|
@@ -215,10 +224,12 @@ export const Run: RunFunction<Context, Settings> = async ({ context, meta }) =>
|
|
|
215
224
|
|
|
216
225
|
- The args are `{ context, settings, callbacks, meta, participants }`, plus `state` for an engine. `settings` is keyed by settings identifier and already resolved for the session; `guides/settings.md` has the order
|
|
217
226
|
- Hooks, aggregate engines (`{ shared: { capabilities }, teams: [{ capabilities }] }`) and writing endpoints (`{ response, capabilities }`) return the same way. A flat return fails the call
|
|
218
|
-
- **To remove a key**, return its path in `deletes` beside `capabilities` (`deletes: [['orders', 'Open', id]]`), under a capability in `writes`.
|
|
227
|
+
- **To remove a key**, return its path in `deletes` beside `capabilities` (`deletes: [['orders', 'Open', id]]`), under a capability in `writes`. A variable you return replaces the old one whole, so an entry survives only because you spread the old map into the new one; `deletes` removes it whichever way the map was built, and reads the same in a surface's `setData`
|
|
219
228
|
- `Init` is optional: without it each team starts from the capabilities' defaults
|
|
220
229
|
- `Run` may return `complete: true` to end the game, and an engine may return `state` beside `capabilities` for private memory between ticks (type it with `RunFunction`'s fourth parameter)
|
|
221
230
|
- A step of a split engine is a `StepFunction<Context, Settings>`: steps pass the context flat, and only the exported function wraps the result
|
|
231
|
+
- **Benchmarks** (`benchmarks/<name>/`) let a debrief compare a team with everyone who has played. Only the engine writes them: list each in the engine's `benchmarks`, return writes under `benchmarks` beside `capabilities` (typed by the generated `Benchmarks`, `RunFunction`'s fifth parameter), and add `"benchmarks"` to `requires`. Screens read pooled figures with `getBenchmark`, which may answer `null` or leave any figure but `count` out. Read `guides/benchmarks.md` first
|
|
232
|
+
- **Assessments** (`assessments/<name>/`) score each participant or team, within a range, in bands that say what a score means and whether it passes. Only the engine scores them: list each in the engine's `assessments`, return writes under `assessments` beside `capabilities` (typed by the generated `Assessments`, `RunFunction`'s sixth parameter), and add `"assessments"` to `requires`. Never work out a band or a pass in a screen: the bands are settings a scenario may move, and `getAssessment` answers with both. Read `guides/assessments.md` first
|
|
222
233
|
|
|
223
234
|
### The logic runtime: ECMAScript intrinsics only
|
|
224
235
|
|
|
@@ -286,7 +297,8 @@ const result = await Run(
|
|
|
286
297
|
|
|
287
298
|
const session = await createTestSession<Context, SharedContext>({ packagePath });
|
|
288
299
|
await session.setData(0, { decisions: { Price: 4 } }); // a write to a capability the UI declares
|
|
289
|
-
await session.tick();
|
|
300
|
+
const result = await session.tick();
|
|
301
|
+
expect(result.ok, JSON.stringify(result)).toBe(true); // a failure carries `logicError`: file, line, tick, team
|
|
290
302
|
expect(session.team(0).context.results.Day).toBe(1);
|
|
291
303
|
```
|
|
292
304
|
|
|
@@ -335,15 +347,15 @@ Upgrade only when the user asks, or when the changelog has a fix the task needs,
|
|
|
335
347
|
|
|
336
348
|
## Troubleshooting
|
|
337
349
|
|
|
338
|
-
| Problem | Solution
|
|
339
|
-
| ------------------------------------- |
|
|
340
|
-
| Types not updating | `pnpm run generate`
|
|
341
|
-
| A capability is missing in code | Add it to the resource's `reads` or `writes`; `update` regenerates the types
|
|
342
|
-
| A surface's write is refused | Add the capability to that surface's `writes`
|
|
343
|
-
| Build failing | `pnpm run --silent sdk build --validate-only --json`, then read `diagnostics`
|
|
344
|
-
| Edit not showing, or `SETTINGS_STALE` | A setting, `teams` or a capability's scope applies only at init: `sdk init`
|
|
345
|
-
| A hook reads empty data in a surface | Two copies of a package with React context: add it to `resolve.dedupe` in `vite.config.ts` |
|
|
346
|
-
| Anything else | `pnpm run --silent sdk docs view troubleshooting.md`
|
|
350
|
+
| Problem | Solution |
|
|
351
|
+
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
352
|
+
| Types not updating | `pnpm run generate` |
|
|
353
|
+
| A capability is missing in code | Add it to the resource's `reads` or `writes`; `update` regenerates the types |
|
|
354
|
+
| A surface's write is refused | Add the capability to that surface's `writes` |
|
|
355
|
+
| Build failing | `pnpm run --silent sdk build --validate-only --json`, then read `diagnostics` |
|
|
356
|
+
| Edit not showing, or `SETTINGS_STALE` | A setting, `teams` or a capability's scope applies only at init: `sdk init` |
|
|
357
|
+
| A hook reads empty data in a surface | Two copies of a package with React context: add it to `resolve.dedupe` in `vite.config.ts`, beside `REACT_CONTEXT_PACKAGES` |
|
|
358
|
+
| Anything else | `pnpm run --silent sdk docs view troubleshooting.md` |
|
|
347
359
|
|
|
348
360
|
Keep `DESIGN.md` up to date as the game changes, and hold to two habits for every surface:
|
|
349
361
|
|
|
@@ -38,6 +38,70 @@ var capabilityExample = JSON.stringify(
|
|
|
38
38
|
null,
|
|
39
39
|
4
|
|
40
40
|
);
|
|
41
|
+
var benchmarkExample = JSON.stringify(
|
|
42
|
+
{
|
|
43
|
+
definition: {
|
|
44
|
+
identifier: "outcome",
|
|
45
|
+
revision: 1,
|
|
46
|
+
tags: ["difficulty"],
|
|
47
|
+
fields: {
|
|
48
|
+
NetProfit: { type: "number", description: "Profit over the whole game" },
|
|
49
|
+
Round1Pricing: { enum: ["premium", "match", "discount"] }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
null,
|
|
54
|
+
4
|
|
55
|
+
);
|
|
56
|
+
var benchmarkUpdateExample = JSON.stringify(
|
|
57
|
+
{
|
|
58
|
+
definition: {
|
|
59
|
+
identifier: "outcome",
|
|
60
|
+
revision: 2,
|
|
61
|
+
tags: ["difficulty", "teams"],
|
|
62
|
+
fields: {
|
|
63
|
+
NetProfit: { type: "number", description: "Profit over the whole game" }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
null,
|
|
68
|
+
4
|
|
69
|
+
);
|
|
70
|
+
var assessmentExample = JSON.stringify(
|
|
71
|
+
{
|
|
72
|
+
definition: {
|
|
73
|
+
identifier: "teamwork",
|
|
74
|
+
description: "How well each participant worked with their team",
|
|
75
|
+
level: "participant",
|
|
76
|
+
min: 0,
|
|
77
|
+
max: 100,
|
|
78
|
+
bands: [
|
|
79
|
+
{ id: "developing", from: 0 },
|
|
80
|
+
{ id: "competent", from: 50, passing: true },
|
|
81
|
+
{ id: "expert", from: 80, passing: true }
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
null,
|
|
86
|
+
4
|
|
87
|
+
);
|
|
88
|
+
var assessmentUpdateExample = JSON.stringify(
|
|
89
|
+
{
|
|
90
|
+
definition: {
|
|
91
|
+
identifier: "teamwork",
|
|
92
|
+
level: "participant",
|
|
93
|
+
min: 0,
|
|
94
|
+
max: 100,
|
|
95
|
+
bands: [
|
|
96
|
+
{ id: "developing", from: 0 },
|
|
97
|
+
{ id: "competent", from: 60, passing: true },
|
|
98
|
+
{ id: "expert", from: 85, passing: true }
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
null,
|
|
103
|
+
4
|
|
104
|
+
);
|
|
41
105
|
var settingsExample = JSON.stringify(
|
|
42
106
|
{
|
|
43
107
|
definition: {
|
|
@@ -517,6 +581,8 @@ var facilitatorGuideUpdateExample = JSON.stringify(
|
|
|
517
581
|
var RESOURCE_EXAMPLES = {
|
|
518
582
|
package: { new: packageExample, update: packageUpdateExample },
|
|
519
583
|
capability: { new: capabilityExample, update: capabilityUpdateExample },
|
|
584
|
+
benchmark: { new: benchmarkExample, update: benchmarkUpdateExample },
|
|
585
|
+
assessment: { new: assessmentExample, update: assessmentUpdateExample },
|
|
520
586
|
settings: { new: settingsExample, update: settingsUpdateExample },
|
|
521
587
|
engine: { new: engineExample, update: engineUpdateExample },
|
|
522
588
|
ui: { new: userInterfaceExample, update: userInterfaceUpdateExample },
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolvePatchedDefinition
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-2VXP34R5.js";
|
|
5
5
|
import "./cli-S5IVGDDD.js";
|
|
6
6
|
import {
|
|
7
7
|
readAuthoredBundle
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-MITZ6SE7.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveInputSource
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-DWDSBTYL.js";
|
|
12
|
+
import {
|
|
13
|
+
loadPackageContext
|
|
14
|
+
} from "./cli-L6AHMW2Z.js";
|
|
12
15
|
import {
|
|
13
16
|
updateUserInterfaceFiles
|
|
14
|
-
} from "./cli-
|
|
15
|
-
import "./cli-
|
|
17
|
+
} from "./cli-T76HDH7F.js";
|
|
18
|
+
import "./cli-KVQ2JPVD.js";
|
|
16
19
|
import "./cli-QUNIRH7A.js";
|
|
17
|
-
import "./cli-
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
} from "./cli-O5WYATAI.js";
|
|
21
|
-
import "./cli-5DWR7RPQ.js";
|
|
22
|
-
import "./cli-GRSQRFRG.js";
|
|
20
|
+
import "./cli-ARAAEWIQ.js";
|
|
21
|
+
import "./cli-JC5OJRID.js";
|
|
22
|
+
import "./cli-DZCLRZXJ.js";
|
|
23
23
|
import {
|
|
24
24
|
operationError,
|
|
25
25
|
printOperationResult,
|
|
26
26
|
regenerateTypes
|
|
27
|
-
} from "./cli-
|
|
28
|
-
import "./cli-
|
|
29
|
-
import "./cli-
|
|
30
|
-
import "./cli-
|
|
31
|
-
import "./cli-
|
|
27
|
+
} from "./cli-SO354HPI.js";
|
|
28
|
+
import "./cli-JTFLIMIG.js";
|
|
29
|
+
import "./cli-RMVJMOWU.js";
|
|
30
|
+
import "./cli-M3Z2KOEB.js";
|
|
31
|
+
import "./cli-HXT25ETJ.js";
|
|
32
32
|
import "./cli-25RWY5BQ.js";
|
|
33
|
-
import "./cli-QWQMPCL6.js";
|
|
34
33
|
import {
|
|
35
34
|
validateSDKUserInterface
|
|
36
|
-
} from "./cli-
|
|
37
|
-
import "./cli-
|
|
35
|
+
} from "./cli-RVZH462G.js";
|
|
36
|
+
import "./cli-QWQMPCL6.js";
|
|
37
|
+
import "./cli-2BKEIIA3.js";
|
|
38
38
|
import {
|
|
39
39
|
logger
|
|
40
|
-
} from "./cli-
|
|
40
|
+
} from "./cli-D5VOSJZ7.js";
|
|
41
41
|
import {
|
|
42
42
|
CliError
|
|
43
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-5PIFO3EN.js";
|
|
44
44
|
|
|
45
45
|
// cli/commands/resources/ui/update.ts
|
|
46
46
|
async function updateUserInterface(definitionInput, options) {
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
resolvePatchedDefinition
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-2VXP34R5.js";
|
|
5
5
|
import "./cli-S5IVGDDD.js";
|
|
6
6
|
import {
|
|
7
7
|
readAuthoredBundle
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-MITZ6SE7.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveInputSource
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-DWDSBTYL.js";
|
|
12
|
+
import {
|
|
13
|
+
loadPackageContext
|
|
14
|
+
} from "./cli-L6AHMW2Z.js";
|
|
12
15
|
import {
|
|
13
16
|
updateWaitingRoomUserInterfaceFiles
|
|
14
|
-
} from "./cli-
|
|
15
|
-
import "./cli-
|
|
17
|
+
} from "./cli-T76HDH7F.js";
|
|
18
|
+
import "./cli-KVQ2JPVD.js";
|
|
16
19
|
import "./cli-QUNIRH7A.js";
|
|
17
|
-
import "./cli-
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
} from "./cli-O5WYATAI.js";
|
|
21
|
-
import "./cli-5DWR7RPQ.js";
|
|
22
|
-
import "./cli-GRSQRFRG.js";
|
|
20
|
+
import "./cli-ARAAEWIQ.js";
|
|
21
|
+
import "./cli-JC5OJRID.js";
|
|
22
|
+
import "./cli-DZCLRZXJ.js";
|
|
23
23
|
import {
|
|
24
24
|
operationError,
|
|
25
25
|
printOperationResult,
|
|
26
26
|
regenerateTypes
|
|
27
|
-
} from "./cli-
|
|
28
|
-
import "./cli-
|
|
29
|
-
import "./cli-
|
|
30
|
-
import "./cli-
|
|
31
|
-
import "./cli-
|
|
27
|
+
} from "./cli-SO354HPI.js";
|
|
28
|
+
import "./cli-JTFLIMIG.js";
|
|
29
|
+
import "./cli-RMVJMOWU.js";
|
|
30
|
+
import "./cli-M3Z2KOEB.js";
|
|
31
|
+
import "./cli-HXT25ETJ.js";
|
|
32
32
|
import "./cli-25RWY5BQ.js";
|
|
33
|
-
import "./cli-QWQMPCL6.js";
|
|
34
33
|
import {
|
|
35
34
|
validateSDKWaitingRoomUserInterface
|
|
36
|
-
} from "./cli-
|
|
37
|
-
import "./cli-
|
|
35
|
+
} from "./cli-RVZH462G.js";
|
|
36
|
+
import "./cli-QWQMPCL6.js";
|
|
37
|
+
import "./cli-2BKEIIA3.js";
|
|
38
38
|
import {
|
|
39
39
|
logger
|
|
40
|
-
} from "./cli-
|
|
40
|
+
} from "./cli-D5VOSJZ7.js";
|
|
41
41
|
import {
|
|
42
42
|
CliError
|
|
43
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-5PIFO3EN.js";
|
|
44
44
|
|
|
45
45
|
// cli/commands/resources/waiting-room/update.ts
|
|
46
46
|
async function updateWaitingRoomUserInterface(definitionInput, options) {
|
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
applyJsonPatch
|
|
4
4
|
} from "./cli-S5IVGDDD.js";
|
|
5
5
|
import {
|
|
6
|
+
existingResourcesHint,
|
|
6
7
|
findBundleFile
|
|
7
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-DZCLRZXJ.js";
|
|
8
9
|
import {
|
|
9
10
|
CliError
|
|
10
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-5PIFO3EN.js";
|
|
11
12
|
|
|
12
13
|
// cli/utils/patch-resolution.ts
|
|
13
14
|
import { readFileSync } from "fs";
|
|
@@ -22,7 +23,8 @@ function resolvePatchedDefinition(args) {
|
|
|
22
23
|
if (!bundleFile) {
|
|
23
24
|
throw new CliError(
|
|
24
25
|
"RESOURCE_NOT_FOUND",
|
|
25
|
-
`${args.resourceLabel} "${args.identifier}" not found
|
|
26
|
+
`${args.resourceLabel} "${args.identifier}" not found`,
|
|
27
|
+
{ hint: existingResourcesHint(args.workingDir, args.type) }
|
|
26
28
|
);
|
|
27
29
|
}
|
|
28
30
|
try {
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
input
|
|
4
|
+
} from "./cli-2W4B6PD5.js";
|
|
2
5
|
import {
|
|
3
6
|
resolvePatchedDefinition
|
|
4
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-2VXP34R5.js";
|
|
5
8
|
import "./cli-S5IVGDDD.js";
|
|
6
9
|
import {
|
|
7
10
|
getResourceIdentifierError,
|
|
8
11
|
readAuthoredBundle
|
|
9
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-MITZ6SE7.js";
|
|
10
13
|
import {
|
|
11
14
|
resolveInputSource
|
|
12
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-DWDSBTYL.js";
|
|
16
|
+
import {
|
|
17
|
+
loadPackageContext
|
|
18
|
+
} from "./cli-L6AHMW2Z.js";
|
|
13
19
|
import {
|
|
14
20
|
updateHookFiles
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import "./cli-
|
|
21
|
+
} from "./cli-T76HDH7F.js";
|
|
22
|
+
import "./cli-KVQ2JPVD.js";
|
|
17
23
|
import "./cli-QUNIRH7A.js";
|
|
18
|
-
import "./cli-
|
|
19
|
-
import
|
|
20
|
-
loadPackageContext
|
|
21
|
-
} from "./cli-O5WYATAI.js";
|
|
22
|
-
import "./cli-5DWR7RPQ.js";
|
|
24
|
+
import "./cli-ARAAEWIQ.js";
|
|
25
|
+
import "./cli-JC5OJRID.js";
|
|
23
26
|
import {
|
|
27
|
+
existingResourcesHint,
|
|
24
28
|
findBundleFile
|
|
25
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-DZCLRZXJ.js";
|
|
26
30
|
import {
|
|
27
31
|
operationError,
|
|
28
32
|
printOperationResult,
|
|
29
33
|
regenerateTypes
|
|
30
|
-
} from "./cli-
|
|
31
|
-
import
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
import "./cli-
|
|
35
|
-
import "./cli-6BLVI2JM.js";
|
|
36
|
-
import "./cli-UEQMK4WX.js";
|
|
37
|
-
import "./cli-JXQLHJO2.js";
|
|
34
|
+
} from "./cli-SO354HPI.js";
|
|
35
|
+
import "./cli-JTFLIMIG.js";
|
|
36
|
+
import "./cli-RMVJMOWU.js";
|
|
37
|
+
import "./cli-M3Z2KOEB.js";
|
|
38
|
+
import "./cli-HXT25ETJ.js";
|
|
38
39
|
import "./cli-25RWY5BQ.js";
|
|
39
|
-
import "./cli-QWQMPCL6.js";
|
|
40
40
|
import {
|
|
41
41
|
validateSDKHook
|
|
42
|
-
} from "./cli-
|
|
43
|
-
import "./cli-
|
|
42
|
+
} from "./cli-RVZH462G.js";
|
|
43
|
+
import "./cli-QWQMPCL6.js";
|
|
44
|
+
import "./cli-2BKEIIA3.js";
|
|
44
45
|
import {
|
|
45
46
|
logger
|
|
46
|
-
} from "./cli-
|
|
47
|
+
} from "./cli-D5VOSJZ7.js";
|
|
47
48
|
import {
|
|
48
49
|
CliError
|
|
49
|
-
} from "./cli-
|
|
50
|
+
} from "./cli-5PIFO3EN.js";
|
|
50
51
|
|
|
51
52
|
// cli/commands/resources/hook/update.ts
|
|
52
53
|
import { readFileSync } from "fs";
|
|
@@ -92,7 +93,9 @@ async function updateHook(identifier, definitionInput, options) {
|
|
|
92
93
|
logger.info("No JSON definition provided. Starting interactive mode...\n");
|
|
93
94
|
const hookFilePath = findBundleFile(options.workingDir, "hook", identifier);
|
|
94
95
|
if (!hookFilePath) {
|
|
95
|
-
throw new CliError("RESOURCE_NOT_FOUND", `Hook "${identifier}" not found
|
|
96
|
+
throw new CliError("RESOURCE_NOT_FOUND", `Hook "${identifier}" not found`, {
|
|
97
|
+
hint: existingResourcesHint(options.workingDir, "hook")
|
|
98
|
+
});
|
|
96
99
|
}
|
|
97
100
|
let existingBundle;
|
|
98
101
|
try {
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
input
|
|
4
|
+
} from "./cli-2W4B6PD5.js";
|
|
2
5
|
import {
|
|
3
6
|
getPackageIdentifierError,
|
|
4
7
|
getVersionError,
|
|
5
8
|
parseAuthoredInput
|
|
6
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-MITZ6SE7.js";
|
|
7
10
|
import {
|
|
8
11
|
resolveInputSource
|
|
9
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-DWDSBTYL.js";
|
|
10
13
|
import {
|
|
11
14
|
createPackageFiles
|
|
12
|
-
} from "./cli-
|
|
13
|
-
import "./cli-
|
|
15
|
+
} from "./cli-T76HDH7F.js";
|
|
16
|
+
import "./cli-KVQ2JPVD.js";
|
|
14
17
|
import "./cli-QUNIRH7A.js";
|
|
15
|
-
import "./cli-
|
|
16
|
-
import "./cli-
|
|
17
|
-
import "./cli-
|
|
18
|
+
import "./cli-ARAAEWIQ.js";
|
|
19
|
+
import "./cli-JC5OJRID.js";
|
|
20
|
+
import "./cli-DZCLRZXJ.js";
|
|
18
21
|
import {
|
|
19
22
|
generateTypes,
|
|
20
23
|
operationError,
|
|
21
24
|
recordOperationResult
|
|
22
|
-
} from "./cli-
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import "./cli-
|
|
27
|
-
import "./cli-6BLVI2JM.js";
|
|
28
|
-
import "./cli-UEQMK4WX.js";
|
|
29
|
-
import "./cli-JXQLHJO2.js";
|
|
25
|
+
} from "./cli-SO354HPI.js";
|
|
26
|
+
import "./cli-JTFLIMIG.js";
|
|
27
|
+
import "./cli-RMVJMOWU.js";
|
|
28
|
+
import "./cli-M3Z2KOEB.js";
|
|
29
|
+
import "./cli-HXT25ETJ.js";
|
|
30
30
|
import "./cli-25RWY5BQ.js";
|
|
31
|
+
import "./cli-RVZH462G.js";
|
|
31
32
|
import "./cli-QWQMPCL6.js";
|
|
32
|
-
import "./cli-X64BNBQH.js";
|
|
33
33
|
import {
|
|
34
34
|
resourceExample
|
|
35
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-2BKEIIA3.js";
|
|
36
36
|
import {
|
|
37
37
|
logger
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-D5VOSJZ7.js";
|
|
39
39
|
import {
|
|
40
40
|
CliError
|
|
41
|
-
} from "./cli-
|
|
41
|
+
} from "./cli-5PIFO3EN.js";
|
|
42
42
|
|
|
43
43
|
// cli/commands/resources/package/new.ts
|
|
44
44
|
function requiredString(input2, field) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
bundlePackage
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-EK4OSJHA.js";
|
|
5
5
|
import {
|
|
6
6
|
loadEnvironmentConfig
|
|
7
|
-
} from "./cli-
|
|
8
|
-
import "./cli-
|
|
7
|
+
} from "./cli-55EIGGZK.js";
|
|
8
|
+
import "./cli-4U2PY7W3.js";
|
|
9
9
|
import {
|
|
10
10
|
DEFAULT_PLATFORM_HOST,
|
|
11
11
|
formatPlatformErrors,
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
} from "./cli-25RWY5BQ.js";
|
|
14
14
|
import {
|
|
15
15
|
logger
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-D5VOSJZ7.js";
|
|
17
17
|
import {
|
|
18
18
|
CliError,
|
|
19
19
|
reportResult
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-5PIFO3EN.js";
|
|
21
21
|
|
|
22
22
|
// cli/commands/package-publish.ts
|
|
23
23
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
validatePackage
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-JD563OF4.js";
|
|
5
5
|
import "./cli-ILKCQNM6.js";
|
|
6
|
-
import "./cli-
|
|
7
|
-
import "./cli-
|
|
6
|
+
import "./cli-FCJHNXDA.js";
|
|
7
|
+
import "./cli-M6E3E3I2.js";
|
|
8
8
|
import "./cli-4LKXZQ2B.js";
|
|
9
9
|
import {
|
|
10
10
|
readSdkToolsVersion
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-KVQ2JPVD.js";
|
|
12
12
|
import {
|
|
13
13
|
distPath
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-DZCLRZXJ.js";
|
|
15
15
|
import {
|
|
16
16
|
generateAllTypes
|
|
17
|
-
} from "./cli-
|
|
18
|
-
import "./cli-
|
|
19
|
-
import "./cli-
|
|
17
|
+
} from "./cli-RMVJMOWU.js";
|
|
18
|
+
import "./cli-M3Z2KOEB.js";
|
|
19
|
+
import "./cli-HXT25ETJ.js";
|
|
20
20
|
import "./cli-25RWY5BQ.js";
|
|
21
|
-
import "./cli-QWQMPCL6.js";
|
|
22
21
|
import {
|
|
23
22
|
LOGIC_NODE_BUILTIN,
|
|
24
23
|
MANIFEST_VERSION,
|
|
@@ -27,19 +26,20 @@ import {
|
|
|
27
26
|
Transpile,
|
|
28
27
|
getResourceMeta,
|
|
29
28
|
loadConfig
|
|
30
|
-
} from "./cli-
|
|
31
|
-
import "./cli-
|
|
29
|
+
} from "./cli-RVZH462G.js";
|
|
30
|
+
import "./cli-QWQMPCL6.js";
|
|
31
|
+
import "./cli-2BKEIIA3.js";
|
|
32
32
|
import {
|
|
33
33
|
getVerboseMode,
|
|
34
34
|
logger
|
|
35
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-D5VOSJZ7.js";
|
|
36
36
|
import {
|
|
37
37
|
CliError,
|
|
38
38
|
diagnosticLocation,
|
|
39
39
|
isJsonOutput,
|
|
40
40
|
recordDiagnostic,
|
|
41
41
|
reportResult
|
|
42
|
-
} from "./cli-
|
|
42
|
+
} from "./cli-5PIFO3EN.js";
|
|
43
43
|
|
|
44
44
|
// cli/commands/build.ts
|
|
45
45
|
import { existsSync as existsSync4 } from "fs";
|
|
@@ -261,6 +261,18 @@ import { realpathSync } from "fs";
|
|
|
261
261
|
import { join as join8, resolve as resolve5 } from "path";
|
|
262
262
|
import react from "@vitejs/plugin-react";
|
|
263
263
|
import { build, loadConfigFromFile, mergeConfig } from "vite";
|
|
264
|
+
|
|
265
|
+
// cli/vite/index.ts
|
|
266
|
+
var REACT_CONTEXT_PACKAGES = [
|
|
267
|
+
"react",
|
|
268
|
+
"react-dom",
|
|
269
|
+
"@emotion/react",
|
|
270
|
+
"@emotion/styled",
|
|
271
|
+
"@seriousgaming/sdk",
|
|
272
|
+
"@seriousgaming/deck"
|
|
273
|
+
];
|
|
274
|
+
|
|
275
|
+
// cli/bundling/ui-bundler.ts
|
|
264
276
|
async function bundleUserInterface(ui, workingDir, buildDir, type) {
|
|
265
277
|
const uiOutputDir = join8(buildDir, distPath(getResourceMeta(type), ui.definition.identifier));
|
|
266
278
|
const uiRootDir = join8(workingDir, ui.rootDirectory);
|
|
@@ -285,7 +297,7 @@ async function bundleUserInterface(ui, workingDir, buildDir, type) {
|
|
|
285
297
|
configFile: false,
|
|
286
298
|
plugins: [react()],
|
|
287
299
|
resolve: {
|
|
288
|
-
dedupe: [
|
|
300
|
+
dedupe: [...REACT_CONTEXT_PACKAGES]
|
|
289
301
|
},
|
|
290
302
|
build: {
|
|
291
303
|
outDir: uiOutputDir,
|
|
@@ -611,6 +623,10 @@ async function buildCommand(options) {
|
|
|
611
623
|
...config.tick_controller ? { tick_controller: logicBundle(config.tick_controller) } : {},
|
|
612
624
|
...config.guide ? { guide: config.guide } : {},
|
|
613
625
|
capabilities,
|
|
626
|
+
// A definition and nothing else: `sample.json` beside it is the dev
|
|
627
|
+
// server's, so no file of a benchmark's directory reaches the build.
|
|
628
|
+
...config.benchmarks?.length ? { benchmarks: config.benchmarks } : {},
|
|
629
|
+
...config.assessments?.length ? { assessments: config.assessments } : {},
|
|
614
630
|
settings: config.settings ?? [],
|
|
615
631
|
scenarios,
|
|
616
632
|
hooks: hooks.map(logicBundle),
|