@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.
Files changed (219) hide show
  1. package/dist/agent/guidance.md +35 -23
  2. package/dist/{cli-F2D4GGUA.js → cli-2BKEIIA3.js} +66 -0
  3. package/dist/{cli-NQSL2CIH.js → cli-2QGTDHRX.js} +21 -21
  4. package/dist/{cli-33MZSPPK.js → cli-2SDG3SZ7.js} +21 -21
  5. package/dist/{cli-CLO7HKEQ.js → cli-2VXP34R5.js} +5 -3
  6. package/dist/{cli-P3NUTOPK.js → cli-2W4B6PD5.js} +1 -1
  7. package/dist/{cli-SOO6SEIS.js → cli-2X7DKSXN.js} +28 -25
  8. package/dist/{cli-LNEZ6KDW.js → cli-2ZP4N7HK.js} +19 -19
  9. package/dist/{cli-5O7XENQY.js → cli-3GJYZH4C.js} +5 -5
  10. package/dist/{cli-NAZTYKZT.js → cli-3GO3M2MX.js} +30 -14
  11. package/dist/{cli-YZJBFKRI.js → cli-3LDLUNME.js} +17 -17
  12. package/dist/{cli-J42N4PJG.js → cli-3WY6L2WP.js} +31 -29
  13. package/dist/{cli-WG7MAOCS.js → cli-44MBABRD.js} +25 -25
  14. package/dist/{cli-MGZYQDCH.js → cli-4IO7MKLR.js} +20 -20
  15. package/dist/{cli-HNDFANQG.js → cli-4U2PY7W3.js} +1 -1
  16. package/dist/{cli-4JNF3O5N.js → cli-4WI4LTBI.js} +2 -2
  17. package/dist/{cli-OTBCA54D.js → cli-55EIGGZK.js} +1 -1
  18. package/dist/{cli-5TKPT3CY.js → cli-5AQV6FTL.js} +18 -18
  19. package/dist/{cli-KNXY43YV.js → cli-5CW7BEU7.js} +3 -3
  20. package/dist/{cli-5V4N4BR4.js → cli-5JUVHNZF.js} +12 -12
  21. package/dist/{cli-F3YJKP6D.js → cli-5KERL6HV.js} +9 -4
  22. package/dist/{cli-HN442ZVK.js → cli-5KSA24NQ.js} +24 -24
  23. package/dist/{cli-5VZBFMCK.js → cli-5PIFO3EN.js} +8 -0
  24. package/dist/{cli-IQBY7Z7Q.js → cli-5QN2Z43X.js} +20 -20
  25. package/dist/cli-5XSPAA5X.js +69 -0
  26. package/dist/{cli-QW7VXL2V.js → cli-62KAYGXO.js} +20 -20
  27. package/dist/{cli-TDLIPYKT.js → cli-6IMV5ZZU.js} +26 -26
  28. package/dist/{cli-UULZSQBV.js → cli-6KWCIAN2.js} +764 -66
  29. package/dist/{cli-2ANX6E3A.js → cli-6NWETIX5.js} +20 -20
  30. package/dist/{cli-EXUPHPDJ.js → cli-774W3MN5.js} +26 -26
  31. package/dist/cli-7BUD3VAD.js +16 -0
  32. package/dist/{cli-7NUFHMGE.js → cli-7KEP57S7.js} +12 -12
  33. package/dist/{cli-6CYAOUYT.js → cli-7OYFJMA6.js} +18 -18
  34. package/dist/{cli-ILHHJR2S.js → cli-7ZNEDQ3G.js} +20 -20
  35. package/dist/{cli-5RRPUL6V.js → cli-AFK6OUID.js} +12 -12
  36. package/dist/{cli-A3AJQZEN.js → cli-AIYQFWXN.js} +25 -25
  37. package/dist/{cli-B5DWKRZ4.js → cli-ARAAEWIQ.js} +2 -2
  38. package/dist/cli-AVQYV3N4.js +36 -0
  39. package/dist/{cli-35GV2F6R.js → cli-B54Z6CXH.js} +16 -16
  40. package/dist/{cli-467VRXGP.js → cli-B5TC4MEL.js} +5 -5
  41. package/dist/{cli-5Z4D3F6Y.js → cli-BCXGOLU3.js} +3 -3
  42. package/dist/{cli-G2GLW5Z4.js → cli-BHAODVTZ.js} +1 -1
  43. package/dist/{cli-XR3O2YTV.js → cli-BPS2JG74.js} +20 -20
  44. package/dist/{cli-W3RG2MRI.js → cli-BVO55SR2.js} +2 -2
  45. package/dist/{cli-PYAST3G5.js → cli-CFH3JZP5.js} +21 -21
  46. package/dist/{cli-VZVHS5AP.js → cli-CTK2OIK6.js} +20 -20
  47. package/dist/{cli-ATWJCB2G.js → cli-CW5MV4VX.js} +4 -4
  48. package/dist/{cli-TCQJL2GY.js → cli-D5VOSJZ7.js} +1 -1
  49. package/dist/{cli-KIZTASLL.js → cli-DAEPMK7A.js} +5 -5
  50. package/dist/{cli-44CM2AH2.js → cli-DAHR7PKB.js} +1 -1
  51. package/dist/{cli-XW3JLRSA.js → cli-DWDSBTYL.js} +1 -1
  52. package/dist/cli-DYSDPGXW.js +95 -0
  53. package/dist/{cli-GRSQRFRG.js → cli-DZCLRZXJ.js} +9 -2
  54. package/dist/{cli-RSF5R3HC.js → cli-EJ47IE45.js} +28 -25
  55. package/dist/{cli-QDBYFITU.js → cli-EK4OSJHA.js} +2 -2
  56. package/dist/{cli-GO64NABP.js → cli-FCJHNXDA.js} +1 -1
  57. package/dist/{cli-ZNQBF4Z3.js → cli-FNESSE3L.js} +1 -1
  58. package/dist/{cli-MUOLHQNL.js → cli-FTLH4WCE.js} +17 -17
  59. package/dist/{cli-JHLWBRXB.js → cli-FYV77YS2.js} +18 -18
  60. package/dist/cli-GMJX6Q4Q.js +36 -0
  61. package/dist/{cli-7JUNA74L.js → cli-GRBVNGDW.js} +1 -1
  62. package/dist/{cli-XKAIDYIE.js → cli-HAFCFY77.js} +33 -19
  63. package/dist/{cli-OXLOGXT3.js → cli-HCJLYI24.js} +3 -3
  64. package/dist/{cli-HHRP6FP6.js → cli-HCXS5EXU.js} +25 -25
  65. package/dist/cli-HEUNNHDH.js +36 -0
  66. package/dist/{cli-36GABN2A.js → cli-HNUTIWDZ.js} +19 -19
  67. package/dist/{cli-JXQLHJO2.js → cli-HXT25ETJ.js} +244 -243
  68. package/dist/{cli-5EH4WTH4.js → cli-IGEL7UJQ.js} +5 -5
  69. package/dist/{cli-JMNPMDXH.js → cli-IO32YA5N.js} +26 -26
  70. package/dist/cli-IPTGZDBB.js +36 -0
  71. package/dist/{cli-L54SXUK6.js → cli-J25TYFKB.js} +19 -19
  72. package/dist/{cli-CQ4ZR3ZQ.js → cli-J7XYMEMX.js} +20 -20
  73. package/dist/{cli-5DWR7RPQ.js → cli-JC5OJRID.js} +2 -2
  74. package/dist/{cli-25SJZI7N.js → cli-JD563OF4.js} +126 -27
  75. package/dist/{cli-JAVMRERQ.js → cli-JRJF2WHU.js} +20 -20
  76. package/dist/{cli-UQC46YSV.js → cli-JTFLIMIG.js} +3 -3
  77. package/dist/{cli-2AH6D32V.js → cli-K2BSJ2PK.js} +2 -2
  78. package/dist/{cli-XB5PI2XT.js → cli-K4QTYMN2.js} +25 -25
  79. package/dist/{cli-5SHG2M7E.js → cli-KFJDD4C4.js} +20 -20
  80. package/dist/{cli-WW54THXN.js → cli-KVQ2JPVD.js} +1 -1
  81. package/dist/{cli-O5WYATAI.js → cli-L6AHMW2Z.js} +4 -2
  82. package/dist/{cli-IKSLPAZN.js → cli-LCYUBCVY.js} +4 -4
  83. package/dist/{cli-HGCOEL5T.js → cli-LEWSCDH5.js} +4 -4
  84. package/dist/{cli-HNG6PZW2.js → cli-LI6G7GND.js} +27 -27
  85. package/dist/{cli-2AVPNSAX.js → cli-LU2GCWIU.js} +21 -21
  86. package/dist/{cli-UEQMK4WX.js → cli-M3Z2KOEB.js} +1 -1
  87. package/dist/{cli-226ZJ72R.js → cli-M6E3E3I2.js} +170 -3
  88. package/dist/{cli-OXU6TTEN.js → cli-MCRPA4Z6.js} +20 -20
  89. package/dist/{cli-BQ36DV5C.js → cli-MI2DEDMA.js} +3 -3
  90. package/dist/{cli-6O7YCK2M.js → cli-MITZ6SE7.js} +3 -3
  91. package/dist/{cli-VALLLE6Y.js → cli-MTIYD3BX.js} +26 -26
  92. package/dist/{cli-5M6KDNVX.js → cli-MTZUJGBK.js} +2 -2
  93. package/dist/{cli-GSOV26O5.js → cli-NCLMUXLC.js} +14 -14
  94. package/dist/{cli-Z3DITVBE.js → cli-NLS3DKWH.js} +26 -26
  95. package/dist/{cli-AH6AMAIB.js → cli-NMDGS7IE.js} +1 -1
  96. package/dist/cli-O3DJO2CS.js +30 -0
  97. package/dist/{cli-BC67QHD5.js → cli-O47D5BFN.js} +2 -2
  98. package/dist/{cli-MDVC5ZNM.js → cli-OBRZ36VP.js} +14 -14
  99. package/dist/{cli-267QJ2DS.js → cli-OMG4E53H.js} +20 -20
  100. package/dist/{cli-C32Q5E5I.js → cli-P6V3NSU4.js} +1 -1
  101. package/dist/{cli-PBSLPO6G.js → cli-PAMQMTHK.js} +21 -21
  102. package/dist/{cli-RUEPTOWG.js → cli-PKTHOCT3.js} +26 -26
  103. package/dist/{cli-PTXOKO2Y.js → cli-QK7QAP5H.js} +18 -18
  104. package/dist/cli-QQ432JEN.js +36 -0
  105. package/dist/{cli-YFLQ7XOO.js → cli-QVNDPTBU.js} +20 -20
  106. package/dist/{cli-KJA6GLZI.js → cli-R2DFD6ZZ.js} +15 -15
  107. package/dist/{cli-6BLVI2JM.js → cli-RMVJMOWU.js} +111 -7
  108. package/dist/{cli-M6AZFIMV.js → cli-RQISHMJF.js} +88 -23
  109. package/dist/{cli-X64BNBQH.js → cli-RVZH462G.js} +585 -8
  110. package/dist/{cli-LLJQI2QP.js → cli-SEEOQVUL.js} +12 -12
  111. package/dist/{cli-QTCTWYCM.js → cli-SO354HPI.js} +3 -3
  112. package/dist/{cli-URCHZDTS.js → cli-T76HDH7F.js} +90 -5
  113. package/dist/{cli-ZJW6HQ6N.js → cli-TIS7DWRR.js} +7 -7
  114. package/dist/{cli-WOFYI7HZ.js → cli-TY3B6XS7.js} +21 -21
  115. package/dist/{cli-4FJL3KQZ.js → cli-UKEZJFIT.js} +2 -2
  116. package/dist/cli-VQAMW4RF.js +95 -0
  117. package/dist/{cli-4A7RWFNO.js → cli-W4LMRVZT.js} +78 -47
  118. package/dist/cli-W7I5KGIB.js +84 -0
  119. package/dist/{cli-B3EFE7ZF.js → cli-WXGJFA4F.js} +1 -1
  120. package/dist/{cli-IPTHJT3J.js → cli-XCG33I77.js} +28 -25
  121. package/dist/{cli-WLSACMYA.js → cli-YHLSG5HB.js} +30 -28
  122. package/dist/cli-YNH5DTHY.js +36 -0
  123. package/dist/cli-YPMJWPDA.js +69 -0
  124. package/dist/{cli-PXQYY6KM.js → cli-YSXIR7EM.js} +0 -0
  125. package/dist/cli-ZPFWO4VW.js +85 -0
  126. package/dist/cli.js +53 -53
  127. package/dist/client/index.d.ts +1 -1
  128. package/dist/client/test-session.d.ts +44 -6
  129. package/dist/client.js +1934 -286
  130. package/dist/core/assessment-moves.d.ts +32 -0
  131. package/dist/core/assessment-reports.d.ts +38 -0
  132. package/dist/core/assessment-settings.d.ts +15 -0
  133. package/dist/core/benchmark-samples.d.ts +28 -0
  134. package/dist/core/session-host.d.ts +4 -0
  135. package/dist/core/session-roster.d.ts +6 -0
  136. package/dist/core/session-timers.d.ts +40 -0
  137. package/dist/core/session.d.ts +14 -1
  138. package/dist/core/tick-timer.d.ts +18 -0
  139. package/dist/dev/console/assets/{index-Ch6HHb2T.js → index-zd--5H1f.js} +26 -26
  140. package/dist/dev/console/index.html +1 -1
  141. package/dist/dev/shell.d.ts +8 -0
  142. package/dist/dev/view/commands.d.ts +3 -1
  143. package/dist/docs/api/index.md +4 -2
  144. package/dist/docs/api/sdk-commands.md +29 -0
  145. package/dist/docs/api/sdk-e2e.md +30 -0
  146. package/dist/docs/api/sdk-projection.md +5 -0
  147. package/dist/docs/api/sdk-tools-client.md +68 -6
  148. package/dist/docs/api/sdk-tools-vite.md +21 -0
  149. package/dist/docs/api/sdk-ui.md +7 -0
  150. package/dist/docs/api/sdk.md +834 -19
  151. package/dist/docs/changelog.md +67 -0
  152. package/dist/docs/cli-error-codes.md +5 -1
  153. package/dist/docs/cli-reference.md +76 -2
  154. package/dist/docs/concepts/index.md +2 -0
  155. package/dist/docs/concepts/terminology.md +12 -0
  156. package/dist/docs/guides/assessments.md +248 -0
  157. package/dist/docs/guides/benchmarks.md +241 -0
  158. package/dist/docs/guides/endpoints.md +1 -1
  159. package/dist/docs/guides/engine-testing.md +49 -14
  160. package/dist/docs/guides/engine.md +10 -2
  161. package/dist/docs/guides/index.md +2 -0
  162. package/dist/docs/guides/presentation.md +11 -9
  163. package/dist/docs/guides/session-hooks.md +24 -22
  164. package/dist/docs/guides/testing.md +3 -8
  165. package/dist/docs/guides/tick-controller.md +22 -1
  166. package/dist/docs/guides/ui.md +24 -0
  167. package/dist/docs/guides/upgrading.md +36 -0
  168. package/dist/docs/page-index.md +18 -13
  169. package/dist/docs/recipes/create-assessment.md +124 -0
  170. package/dist/docs/recipes/create-benchmark.md +115 -0
  171. package/dist/docs/recipes/create-game.md +1 -1
  172. package/dist/docs/recipes/fix-duplicate-packages.md +8 -19
  173. package/dist/docs/recipes/index.md +2 -0
  174. package/dist/execution/context-composition.d.ts +39 -4
  175. package/dist/execution/engine-state.d.ts +13 -0
  176. package/dist/execution/executor.d.ts +16 -0
  177. package/dist/execution/logic-result.d.ts +13 -2
  178. package/dist/help-examples.d.ts +12 -0
  179. package/dist/host/adapter.d.ts +24 -1
  180. package/dist/host/protocol.d.ts +115 -1
  181. package/dist/host.js +29 -1
  182. package/dist/oxlint/logic.json +184 -0
  183. package/dist/playwright.js +1928 -280
  184. package/dist/runtime/index.d.ts +3 -1
  185. package/dist/runtime/manifest-version.d.ts +1 -1
  186. package/dist/runtime.js +298 -16
  187. package/dist/schema.json +189 -0
  188. package/dist/templates/package/README.md.liquid +1 -0
  189. package/dist/templates/package/claude/rules/workflow-create-engine.md +1 -1
  190. package/dist/templates/package/claude/rules/workflow-create-user-interface.md +1 -1
  191. package/dist/templates/package/claude/rules/workflow-test-engine-or-ui.md +1 -1
  192. package/dist/templates/package/claude/rules/workflow-update-sdk-version.md +2 -2
  193. package/dist/templates/package/claude/settings.json.template +1 -0
  194. package/dist/templates/package/oxfmtrc.json.template +8 -1
  195. package/dist/templates/package/oxlintrc.json.template +1 -180
  196. package/dist/templates/package/package.json.liquid +1 -0
  197. package/dist/templates/package/vite.config.ts.liquid +2 -8
  198. package/dist/templates/package/vitest.config.ts.liquid +2 -8
  199. package/dist/templates/starter-game/package.json +2 -1
  200. package/dist/templates/starter-game/testing/engine/game.engine.test.ts +62 -37
  201. package/dist/templates/starter-game/vite.config.ts +2 -8
  202. package/dist/templates/starter-game/vitest.config.ts +4 -3
  203. package/dist/templating/resource-metadata.d.ts +1 -1
  204. package/dist/utils/error-codes.d.ts +9 -1
  205. package/dist/utils/resource-scan.d.ts +5 -0
  206. package/dist/validation/assessment-validation.d.ts +34 -0
  207. package/dist/validation/benchmark-validation.d.ts +20 -0
  208. package/dist/validation/schema-validation.d.ts +4 -0
  209. package/dist/vite/index.d.ts +30 -0
  210. package/dist/vite.js +12 -0
  211. package/package.json +12 -4
  212. package/dist/cli-27Z5T52R.js +0 -30
  213. package/dist/cli-5XE4OMFL.js +0 -36
  214. package/dist/cli-BB6CU4ZC.js +0 -36
  215. package/dist/cli-FGP6YYM7.js +0 -36
  216. package/dist/cli-I3ZAZYWP.js +0 -36
  217. package/dist/cli-RFAPPYXK.js +0 -36
  218. package/dist/cli-WZNIW6ZO.js +0 -16
  219. package/dist/cli-XEEOJGBL.js +0 -36
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="icon" type="image/svg+xml" href="/assets/icon-CRaj5uhr.svg" />
7
7
  <title>Serious Gaming</title>
8
- <script type="module" crossorigin src="/assets/index-Ch6HHb2T.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-zd--5H1f.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-q6-lvlN3.css">
10
10
  </head>
11
11
  <body>
@@ -112,6 +112,8 @@ export declare class DevShell {
112
112
  private readonly socketRuns;
113
113
  /** The participant an operator page says it is showing, where it shows one. */
114
114
  private readonly socketPresence;
115
+ /** Console pages open, each of which keeps its run awake (§11.4a). */
116
+ private readonly consoleSockets;
115
117
  private readonly options;
116
118
  private brands;
117
119
  private server;
@@ -300,6 +302,12 @@ export declare class DevShell {
300
302
  * builds it.
301
303
  */
302
304
  private syncPresence;
305
+ /**
306
+ * Tell a run how many pages are open on it, console and viewer alike.
307
+ * Opening one is activity, and the dev server keeps a run with any open
308
+ * awake (§11.4a), which the specification leaves to the host.
309
+ */
310
+ private syncOpenSurfaces;
303
311
  private updateViews;
304
312
  /**
305
313
  * Act on a frame's request from a viewer page.
@@ -72,4 +72,6 @@ export declare function commandFor(message: {
72
72
  export declare function queryFor(message: {
73
73
  type: string;
74
74
  [key: string]: unknown;
75
- }, surface: MountableSurface, viewer: Viewer): QueryCommand | null;
75
+ }, surface: MountableSurface, viewer: Viewer, { sessionless }?: {
76
+ sessionless?: boolean;
77
+ }): QueryCommand | FrameRefusal | null;
@@ -6,7 +6,7 @@ Every type, function, hook and component your game imports, one page per entry p
6
6
 
7
7
  | Entry point | Exports |
8
8
  | ------------------------------------------------------------------ | -------------------------------------------------------------- |
9
- | [`@seriousgaming/sdk`](./sdk.md) | 12 functions, 3 classes, 1 constant, 100 interfaces, 49 types |
9
+ | [`@seriousgaming/sdk`](./sdk.md) | 20 functions, 3 classes, 9 constants, 115 interfaces, 64 types |
10
10
  | [`@seriousgaming/sdk/ui`](./sdk-ui.md) | 50 functions, 3 classes, 40 constants, 26 interfaces, 38 types |
11
11
  | [`@seriousgaming/sdk/ui/testing`](./sdk-ui-testing.md) | 14 functions, 6 types |
12
12
  | [`@seriousgaming/sdk/testing`](./sdk-testing.md) | 8 functions, 4 constants, 8 types |
@@ -14,8 +14,9 @@ Every type, function, hook and component your game imports, one page per entry p
14
14
  | [`@seriousgaming/sdk/commands`](./sdk-commands.md) | 3 interfaces, 5 types |
15
15
  | [`@seriousgaming/sdk/e2e`](./sdk-e2e.md) | 6 functions, 1 constant, 4 interfaces, 5 types |
16
16
  | [`@seriousgaming/deck`](./deck.md) | 16 functions, 5 constants, 15 interfaces, 4 types |
17
- | [`@seriousgaming/sdk-tools/client`](./sdk-tools-client.md) | 5 functions, 1 class, 12 interfaces, 11 types |
17
+ | [`@seriousgaming/sdk-tools/client`](./sdk-tools-client.md) | 5 functions, 1 class, 13 interfaces, 12 types |
18
18
  | [`@seriousgaming/sdk-tools/playwright`](./sdk-tools-playwright.md) | 1 function, 3 constants, 2 interfaces, 1 type |
19
+ | [`@seriousgaming/sdk-tools/vite`](./sdk-tools-vite.md) | 1 constant |
19
20
 
20
21
  ## Which entry point to import from
21
22
 
@@ -27,6 +28,7 @@ Every type, function, hook and component your game imports, one page per entry p
27
28
  - **`@seriousgaming/sdk/commands`** and **`@seriousgaming/sdk/projection`**: the commands a client may send a session, and the shape of the state it reads back (`sdk view --json` and the dev server's `/api/state`)
28
29
  - **`@seriousgaming/sdk-tools/client`**: `createTestSession`, which plays a whole game in-process, `startDevServer`, which starts an isolated dev server for browser tests, and `buildSurfaces`, which builds a game's surfaces for those servers to serve
29
30
  - **`@seriousgaming/sdk-tools/playwright`**: the Playwright `test` that starts a dev server for each worker, and the `globalSetup` that builds the surfaces they serve
31
+ - **`@seriousgaming/sdk-tools/vite`**: `REACT_CONTEXT_PACKAGES`, the list a `vite.config.ts` and a `vitest.config.ts` pass to `resolve.dedupe`
30
32
  - **`@seriousgaming/deck`**: the slide components and layout primitives a presentation is built from
31
33
 
32
34
  `@seriousgaming/sdk-tools` also exports `/host` and `/runtime`. They are for people building a runtime that hosts games, not for game authors, their shapes may change in a minor release, and they are not documented here.
@@ -195,6 +195,9 @@ type MutationCommand =
195
195
  type: 'advanceClock';
196
196
  byMs: number;
197
197
  }
198
+ | {
199
+ type: 'makeDormant';
200
+ }
198
201
  | {
199
202
  type: 'armFault';
200
203
  fault: FaultKind;
@@ -239,6 +242,16 @@ type QueryCommand =
239
242
  type: 'getAllTeamsParticipants';
240
243
  uiIdentifier?: string;
241
244
  } & Actor)
245
+ | {
246
+ type: 'getBenchmark';
247
+ identifier: string;
248
+ where: BenchmarkFilter[];
249
+ }
250
+ | ({
251
+ type: 'getAssessment';
252
+ identifier: string;
253
+ audience?: 'all' | 'own';
254
+ } & Actor)
242
255
  | {
243
256
  type: 'getEndpointAudit';
244
257
  }
@@ -275,6 +288,22 @@ type QueryResult =
275
288
  type: 'participants';
276
289
  participants: unknown[];
277
290
  }
291
+ | {
292
+ type: 'benchmark';
293
+ statistics: BenchmarkStatistics | null;
294
+ }
295
+ | {
296
+ type: 'benchmarkFailure';
297
+ error: string;
298
+ }
299
+ | {
300
+ type: 'assessment';
301
+ report: AssessmentReport;
302
+ }
303
+ | {
304
+ type: 'assessmentFailure';
305
+ error: string;
306
+ }
278
307
  | {
279
308
  type: 'endpointAudit';
280
309
  entries: EndpointAuditEntry[];
@@ -183,6 +183,7 @@ interface StateProjection {
183
183
  teams: ProjectedTeam[];
184
184
  shared: Record<string, Record<string, unknown>>;
185
185
  sharedState?: unknown;
186
+ sharedBenchmarks?: Record<string, Record<string, unknown>>;
186
187
  timer: TimerState | null;
187
188
  settings: ResolvedSettings;
188
189
  settingsWithoutSession: ResolvedSettings;
@@ -336,6 +337,9 @@ type MutationCommand =
336
337
  type: 'advanceClock';
337
338
  byMs: number;
338
339
  }
340
+ | {
341
+ type: 'makeDormant';
342
+ }
339
343
  | {
340
344
  type: 'armFault';
341
345
  fault: FaultKind;
@@ -397,6 +401,16 @@ type QueryCommand =
397
401
  type: 'getAllTeamsParticipants';
398
402
  uiIdentifier?: string;
399
403
  } & Actor)
404
+ | {
405
+ type: 'getBenchmark';
406
+ identifier: string;
407
+ where: BenchmarkFilter[];
408
+ }
409
+ | ({
410
+ type: 'getAssessment';
411
+ identifier: string;
412
+ audience?: 'all' | 'own';
413
+ } & Actor)
400
414
  | {
401
415
  type: 'getEndpointAudit';
402
416
  }
@@ -433,6 +447,22 @@ type QueryResult =
433
447
  type: 'participants';
434
448
  participants: unknown[];
435
449
  }
450
+ | {
451
+ type: 'benchmark';
452
+ statistics: BenchmarkStatistics | null;
453
+ }
454
+ | {
455
+ type: 'benchmarkFailure';
456
+ error: string;
457
+ }
458
+ | {
459
+ type: 'assessment';
460
+ report: AssessmentReport;
461
+ }
462
+ | {
463
+ type: 'assessmentFailure';
464
+ error: string;
465
+ }
436
466
  | {
437
467
  type: 'endpointAudit';
438
468
  entries: EndpointAuditEntry[];
@@ -92,6 +92,8 @@ interface ProjectedTeam extends TeamInfo {
92
92
  participants: Participant[];
93
93
  timer?: TimerState;
94
94
  state?: unknown;
95
+ benchmarks?: Record<string, Record<string, unknown>>;
96
+ assessments?: Record<string, unknown>;
95
97
  }
96
98
  ```
97
99
 
@@ -137,6 +139,7 @@ interface StateProjection {
137
139
  teams: ProjectedTeam[];
138
140
  shared: Record<string, Record<string, unknown>>;
139
141
  sharedState?: unknown;
142
+ sharedBenchmarks?: Record<string, Record<string, unknown>>;
140
143
  timer: TimerState | null;
141
144
  settings: ResolvedSettings;
142
145
  settingsWithoutSession: ResolvedSettings;
@@ -170,6 +173,8 @@ interface TimerState {
170
173
  pausedMs: number;
171
174
  extendedMs: number;
172
175
  scheduleStartedAt: number | null;
176
+ dormant?: boolean;
177
+ dormantAt?: number | null;
173
178
  }
174
179
  ```
175
180
 
@@ -151,6 +151,28 @@ interface DevServerOptions {
151
151
  }
152
152
  ```
153
153
 
154
+ ### LogicErrorLocation
155
+
156
+ Where game logic threw, read back to the file the author wrote: the resource whose logic it was, the tick and team it ran for, and the source position. `file` is relative to the package root; `line` and `column` are 1-based.
157
+
158
+ ```ts
159
+ interface LogicErrorLocation {
160
+ resource: {
161
+ type: string;
162
+ identifier: string;
163
+ };
164
+ message: string;
165
+ tick?: number;
166
+ team?: {
167
+ teamId: string;
168
+ index: number;
169
+ };
170
+ file?: string;
171
+ line?: number;
172
+ column?: number;
173
+ }
174
+ ```
175
+
154
176
  ### SignatureCallbacks
155
177
 
156
178
  Every callback a runtime may offer logic: the engine, hooks, tick controllers and endpoints.
@@ -207,6 +229,7 @@ interface StateProjection {
207
229
  teams: ProjectedTeam[];
208
230
  shared: Record<string, Record<string, unknown>>;
209
231
  sharedState?: unknown;
232
+ sharedBenchmarks?: Record<string, Record<string, unknown>>;
210
233
  timer: TimerState | null;
211
234
  settings: ResolvedSettings;
212
235
  settingsWithoutSession: ResolvedSettings;
@@ -221,30 +244,30 @@ A session to test against.
221
244
 
222
245
  ```ts
223
246
  interface TestSession<Context = UntypedContext, Shared = UntypedContext> {
224
- send(command: MutationCommand): Promise<MutationResult>;
247
+ send(command: MutationCommand): Promise<TestMutationResult>;
225
248
  send(command: QueryCommand): Promise<QueryResult>;
226
- send(command: Command): Promise<MutationResult | QueryResult>;
249
+ send(command: Command): Promise<TestMutationResult | QueryResult>;
227
250
  state(): TestSessionState<Context, Shared>;
228
251
  team(index: number): TestSessionTeam<Context>;
229
252
  readonly shared: {
230
253
  readonly context: Shared;
231
254
  };
232
- tick(options?: { team?: number }): Promise<MutationResult>;
255
+ tick(options?: { team?: number }): Promise<TestMutationResult>;
233
256
  requestTick(
234
257
  team: number,
235
258
  options?: {
236
259
  participantId?: string;
237
260
  }
238
- ): Promise<MutationResult>;
261
+ ): Promise<TestMutationResult>;
239
262
  setData(
240
263
  team: number,
241
264
  patch: ContextUpdate<Context>,
242
265
  options?: TestSessionSetDataOptions
243
- ): Promise<MutationResult>;
266
+ ): Promise<TestMutationResult>;
244
267
  setSharedData(
245
268
  patch: ContextUpdate<Shared>,
246
269
  options?: TestSessionSetSharedDataOptions
247
- ): Promise<MutationResult>;
270
+ ): Promise<TestMutationResult>;
248
271
  settled(): Promise<void>;
249
272
  close(): Promise<void>;
250
273
  }
@@ -463,6 +486,9 @@ type MutationCommand =
463
486
  type: 'advanceClock';
464
487
  byMs: number;
465
488
  }
489
+ | {
490
+ type: 'makeDormant';
491
+ }
466
492
  | {
467
493
  type: 'armFault';
468
494
  fault: FaultKind;
@@ -532,6 +558,16 @@ type QueryCommand =
532
558
  type: 'getAllTeamsParticipants';
533
559
  uiIdentifier?: string;
534
560
  } & Actor)
561
+ | {
562
+ type: 'getBenchmark';
563
+ identifier: string;
564
+ where: BenchmarkFilter[];
565
+ }
566
+ | ({
567
+ type: 'getAssessment';
568
+ identifier: string;
569
+ audience?: 'all' | 'own';
570
+ } & Actor)
535
571
  | {
536
572
  type: 'getEndpointAudit';
537
573
  }
@@ -568,6 +604,22 @@ type QueryResult =
568
604
  type: 'participants';
569
605
  participants: unknown[];
570
606
  }
607
+ | {
608
+ type: 'benchmark';
609
+ statistics: BenchmarkStatistics | null;
610
+ }
611
+ | {
612
+ type: 'benchmarkFailure';
613
+ error: string;
614
+ }
615
+ | {
616
+ type: 'assessment';
617
+ report: AssessmentReport;
618
+ }
619
+ | {
620
+ type: 'assessmentFailure';
621
+ error: string;
622
+ }
571
623
  | {
572
624
  type: 'endpointAudit';
573
625
  entries: EndpointAuditEntry[];
@@ -578,6 +630,16 @@ type QueryResult =
578
630
  };
579
631
  ```
580
632
 
633
+ ### TestMutationResult
634
+
635
+ What a test session answers a mutation with. A refusal that came from logic throwing (a failed tick, a hook, a validator) carries `logicError` beside its outcome, which is what `sdk tick` reports from the command line:
636
+
637
+ ```ts
638
+ type TestMutationResult = MutationResult & {
639
+ logicError?: LogicErrorLocation;
640
+ };
641
+ ```
642
+
581
643
  ### TestServices
582
644
 
583
645
  Where a test session's service callbacks go (`TestSessionOptions.services`).
@@ -0,0 +1,21 @@
1
+ <!-- Generated by `pnpm docs:generate` from the exports of `@seriousgaming/sdk-tools/vite`. Edit those, not this file. -->
2
+
3
+ # `@seriousgaming/sdk-tools/vite`
4
+
5
+ What a game's Vite and Vitest configs need from the SDK.
6
+
7
+ Imported from `@seriousgaming/sdk-tools/vite` by a `vite.config.ts` or a
8
+ `vitest.config.ts`, so it stays free of the CLI and the dev server: a config
9
+ file is loaded on every run.
10
+
11
+ Every export of `@seriousgaming/sdk-tools/vite`, with the declaration it is published with. Anything tagged `@internal` is left out: it ships in the declarations, but is not part of the supported API and may change without a major release. For how the pieces fit together, see the [API reference](./index.md) and the guides it links to.
12
+
13
+ ## Constants
14
+
15
+ ### REACT_CONTEXT_PACKAGES
16
+
17
+ Every package that holds React context a surface reads, for `resolve.dedupe`.
18
+
19
+ ```ts
20
+ const REACT_CONTEXT_PACKAGES: readonly string[];
21
+ ```
@@ -984,6 +984,11 @@ interface PresentationValue<TSettings, TTeamContext, TSharedContext> {
984
984
  getPastState: <T = Record<string, unknown>>(
985
985
  query: PastStateQuery<T>
986
986
  ) => Promise<PastStateEntry<T>[]>;
987
+ getBenchmark: (
988
+ identifier: string,
989
+ query?: BenchmarkQuery
990
+ ) => Promise<BenchmarkStatistics | null>;
991
+ getAssessment: (identifier: string) => Promise<AssessmentReport>;
987
992
  getAssetUrl: (reference: string) => string;
988
993
  }
989
994
  ```
@@ -1087,6 +1092,8 @@ interface TimerState {
1087
1092
  pausedMs: number;
1088
1093
  extendedMs: number;
1089
1094
  scheduleStartedAt: number | null;
1095
+ dormant?: boolean;
1096
+ dormantAt?: number | null;
1090
1097
  }
1091
1098
  ```
1092
1099