@seriousgaming/sdk-tools 1.8.0 → 1.10.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 (148) hide show
  1. package/dist/{cli-WWNTBK37.js → cli-226ZJ72R.js} +1 -1
  2. package/dist/{cli-6AGWTGTO.js → cli-25SJZI7N.js} +44 -9
  3. package/dist/{cli-EK7CGMGS.js → cli-267QJ2DS.js} +17 -17
  4. package/dist/cli-27Z5T52R.js +30 -0
  5. package/dist/{cli-3OVXQJEW.js → cli-2AH6D32V.js} +2 -2
  6. package/dist/{cli-KU4PG7ZA.js → cli-2ANX6E3A.js} +15 -15
  7. package/dist/{cli-HMEZHQBC.js → cli-2AVPNSAX.js} +17 -17
  8. package/dist/{cli-27M4PX7O.js → cli-33MZSPPK.js} +17 -17
  9. package/dist/{cli-CAX4CQTC.js → cli-35GV2F6R.js} +13 -13
  10. package/dist/{cli-NGOQWOQE.js → cli-36GABN2A.js} +15 -15
  11. package/dist/{cli-DXHPYN4N.js → cli-44CM2AH2.js} +1 -1
  12. package/dist/{cli-UYV3BDPA.js → cli-467VRXGP.js} +3 -3
  13. package/dist/{cli-F47ELAXM.js → cli-4A7RWFNO.js} +49 -49
  14. package/dist/{cli-6GDPO5VU.js → cli-4FJL3KQZ.js} +2 -2
  15. package/dist/{cli-V5K3CCYZ.js → cli-4JNF3O5N.js} +2 -2
  16. package/dist/{cli-UADUC4JD.js → cli-5DWR7RPQ.js} +2 -2
  17. package/dist/{cli-ZFY6TGU7.js → cli-5EH4WTH4.js} +4 -4
  18. package/dist/{cli-MPWTXNF6.js → cli-5M6KDNVX.js} +2 -2
  19. package/dist/{cli-J2OTL6JH.js → cli-5O7XENQY.js} +5 -5
  20. package/dist/{cli-3HZGJRQW.js → cli-5RRPUL6V.js} +11 -11
  21. package/dist/{cli-VBSF3R3L.js → cli-5SHG2M7E.js} +16 -16
  22. package/dist/{cli-72DRYVTT.js → cli-5TKPT3CY.js} +13 -13
  23. package/dist/{cli-C7YZNPWX.js → cli-5V4N4BR4.js} +11 -11
  24. package/dist/{cli-AEAFLZGY.js → cli-5VZBFMCK.js} +5 -1
  25. package/dist/cli-5XE4OMFL.js +36 -0
  26. package/dist/{cli-AGYCXRPR.js → cli-5Z4D3F6Y.js} +3 -3
  27. package/dist/{cli-SOQJHK4Q.js → cli-6BLVI2JM.js} +11 -7
  28. package/dist/{cli-G7FX7ZIU.js → cli-6CYAOUYT.js} +12 -12
  29. package/dist/{cli-3HPAKEJJ.js → cli-6O7YCK2M.js} +2 -2
  30. package/dist/{cli-IC5FOT2J.js → cli-7JUNA74L.js} +1 -1
  31. package/dist/{cli-U2EWI6H5.js → cli-7NUFHMGE.js} +11 -11
  32. package/dist/{cli-FSEDPZR5.js → cli-A3AJQZEN.js} +19 -19
  33. package/dist/{cli-2FXZZLCL.js → cli-AH6AMAIB.js} +1 -1
  34. package/dist/{cli-Q5BKFFDL.js → cli-ATWJCB2G.js} +4 -4
  35. package/dist/{cli-MN7X4UG2.js → cli-B3EFE7ZF.js} +1 -1
  36. package/dist/{cli-UTHPCZYL.js → cli-B5DWKRZ4.js} +2 -2
  37. package/dist/cli-BB6CU4ZC.js +36 -0
  38. package/dist/{cli-HJPNNORV.js → cli-BC67QHD5.js} +2 -2
  39. package/dist/{cli-C45A5VX6.js → cli-BQ36DV5C.js} +3 -3
  40. package/dist/{cli-GHIMH6JU.js → cli-C32Q5E5I.js} +1 -1
  41. package/dist/{cli-KMT235FV.js → cli-CLO7HKEQ.js} +2 -2
  42. package/dist/{cli-W7XCTGQ7.js → cli-CQ4ZR3ZQ.js} +15 -15
  43. package/dist/{cli-ME3JKMJL.js → cli-EXUPHPDJ.js} +19 -19
  44. package/dist/{cli-KFVA7DT3.js → cli-F3YJKP6D.js} +3 -3
  45. package/dist/cli-FGP6YYM7.js +36 -0
  46. package/dist/{cli-CVOLMK3Z.js → cli-G2GLW5Z4.js} +1 -1
  47. package/dist/{cli-6NBER36P.js → cli-GO64NABP.js} +1 -1
  48. package/dist/{cli-2QM63J3I.js → cli-GRSQRFRG.js} +1 -1
  49. package/dist/{cli-PO2ALWHP.js → cli-GSOV26O5.js} +13 -13
  50. package/dist/{cli-JQ6I5GGE.js → cli-HGCOEL5T.js} +3 -3
  51. package/dist/{cli-FHKRO6OU.js → cli-HHRP6FP6.js} +19 -19
  52. package/dist/{cli-3OCKRPXI.js → cli-HN442ZVK.js} +18 -18
  53. package/dist/{cli-7CW2BBJG.js → cli-HNDFANQG.js} +1 -1
  54. package/dist/{cli-PLW3TWJ7.js → cli-HNG6PZW2.js} +19 -19
  55. package/dist/cli-I3ZAZYWP.js +36 -0
  56. package/dist/{cli-2KDV2DYC.js → cli-IKSLPAZN.js} +3 -3
  57. package/dist/{cli-ESU3J563.js → cli-ILHHJR2S.js} +15 -15
  58. package/dist/{cli-HQUVSAHY.js → cli-IPTHJT3J.js} +18 -18
  59. package/dist/{cli-QDIH2G2P.js → cli-IQBY7Z7Q.js} +15 -15
  60. package/dist/{cli-BXCCODYD.js → cli-J42N4PJG.js} +20 -20
  61. package/dist/{cli-32NRB2IT.js → cli-JAVMRERQ.js} +15 -15
  62. package/dist/{cli-HC7L5DXV.js → cli-JHLWBRXB.js} +15 -15
  63. package/dist/{cli-JOXCAGM7.js → cli-JMNPMDXH.js} +19 -19
  64. package/dist/{cli-O3IMNLN2.js → cli-JXQLHJO2.js} +1 -1
  65. package/dist/{cli-7NCVUM5U.js → cli-KIZTASLL.js} +3 -3
  66. package/dist/{cli-FH4WBZHA.js → cli-KJA6GLZI.js} +14 -14
  67. package/dist/{cli-PZ7G544B.js → cli-KNXY43YV.js} +3 -3
  68. package/dist/{cli-QAI6T5FL.js → cli-L54SXUK6.js} +15 -15
  69. package/dist/{cli-3HBYH4VF.js → cli-LLJQI2QP.js} +11 -11
  70. package/dist/{cli-PEY6XZDE.js → cli-LNEZ6KDW.js} +16 -16
  71. package/dist/{cli-GFONBOJT.js → cli-M6AZFIMV.js} +26 -12
  72. package/dist/{cli-YLYB4ITF.js → cli-MDVC5ZNM.js} +13 -13
  73. package/dist/{cli-SWUAXVIJ.js → cli-MGZYQDCH.js} +15 -15
  74. package/dist/{cli-5SYPXJCB.js → cli-MUOLHQNL.js} +14 -14
  75. package/dist/{cli-ZSKP2IRP.js → cli-NAZTYKZT.js} +11 -11
  76. package/dist/{cli-L4DEEAMK.js → cli-NQSL2CIH.js} +17 -17
  77. package/dist/{cli-BC4KKNLA.js → cli-O5WYATAI.js} +1 -1
  78. package/dist/{cli-K6M6YB67.js → cli-OTBCA54D.js} +1 -1
  79. package/dist/{cli-IVZ7AHUJ.js → cli-OXLOGXT3.js} +3 -3
  80. package/dist/{cli-66AHBZRZ.js → cli-OXU6TTEN.js} +15 -15
  81. package/dist/{cli-NU4SCD5D.js → cli-P3NUTOPK.js} +1 -1
  82. package/dist/{cli-7GJGFILU.js → cli-PBSLPO6G.js} +15 -15
  83. package/dist/{cli-4EMNCU63.js → cli-PTXOKO2Y.js} +17 -17
  84. package/dist/{cli-726NJARI.js → cli-PXQYY6KM.js} +0 -0
  85. package/dist/{cli-5P66N5G6.js → cli-PYAST3G5.js} +17 -17
  86. package/dist/{cli-7V6GUIIS.js → cli-QDBYFITU.js} +2 -2
  87. package/dist/{cli-QAVLRCQ5.js → cli-QTCTWYCM.js} +3 -3
  88. package/dist/{cli-MJ65PIYI.js → cli-QW7VXL2V.js} +15 -15
  89. package/dist/cli-RFAPPYXK.js +36 -0
  90. package/dist/{cli-6BAZE75K.js → cli-RSF5R3HC.js} +18 -18
  91. package/dist/{cli-FV45UZQP.js → cli-RUEPTOWG.js} +19 -19
  92. package/dist/{cli-PPEB3ENS.js → cli-SOO6SEIS.js} +18 -18
  93. package/dist/{cli-DMKRP33X.js → cli-TCQJL2GY.js} +1 -1
  94. package/dist/{cli-DT756M3Z.js → cli-TDLIPYKT.js} +20 -20
  95. package/dist/{cli-7S4G4EKK.js → cli-UEQMK4WX.js} +1 -1
  96. package/dist/{cli-UZCQL6YP.js → cli-UQC46YSV.js} +3 -3
  97. package/dist/{cli-MPU4FLA7.js → cli-URCHZDTS.js} +4 -4
  98. package/dist/{cli-42ZUP4X3.js → cli-UULZSQBV.js} +3 -3
  99. package/dist/{cli-4B5OBHSY.js → cli-VALLLE6Y.js} +19 -19
  100. package/dist/{cli-KH6FKM5A.js → cli-VZVHS5AP.js} +15 -15
  101. package/dist/{cli-UR63LFVK.js → cli-W3RG2MRI.js} +2 -2
  102. package/dist/{cli-VQ4OJ4KE.js → cli-WG7MAOCS.js} +18 -18
  103. package/dist/{cli-W7Y7X3FX.js → cli-WLSACMYA.js} +19 -19
  104. package/dist/{cli-JA6UFTSX.js → cli-WOFYI7HZ.js} +17 -17
  105. package/dist/{cli-VTLFQHDO.js → cli-WW54THXN.js} +1 -1
  106. package/dist/cli-WZNIW6ZO.js +16 -0
  107. package/dist/{cli-OUFXSQOW.js → cli-X64BNBQH.js} +26 -4
  108. package/dist/{cli-6FVHRL3H.js → cli-XB5PI2XT.js} +19 -19
  109. package/dist/cli-XEEOJGBL.js +36 -0
  110. package/dist/{cli-D3CZRXVJ.js → cli-XKAIDYIE.js} +14 -14
  111. package/dist/{cli-SPKPDXWD.js → cli-XR3O2YTV.js} +15 -15
  112. package/dist/{cli-3VV2JLHX.js → cli-XW3JLRSA.js} +1 -1
  113. package/dist/{cli-N5K2KHPR.js → cli-YFLQ7XOO.js} +15 -15
  114. package/dist/{cli-DPFN2LIZ.js → cli-YZJBFKRI.js} +15 -15
  115. package/dist/{cli-5FRKWNVP.js → cli-Z3DITVBE.js} +19 -19
  116. package/dist/{cli-E665NKUQ.js → cli-ZJW6HQ6N.js} +5 -5
  117. package/dist/{cli-Y33ULHYO.js → cli-ZNQBF4Z3.js} +1 -1
  118. package/dist/cli.js +52 -52
  119. package/dist/client.js +84 -9
  120. package/dist/dev/console/assets/{index-CVNjiRUh.js → index-Ch6HHb2T.js} +1 -1
  121. package/dist/dev/console/index.html +1 -1
  122. package/dist/dev/surfaces.d.ts +8 -2
  123. package/dist/docs/api/sdk.md +2 -0
  124. package/dist/docs/changelog.md +20 -0
  125. package/dist/docs/cli-error-codes.md +41 -39
  126. package/dist/docs/cli-reference.md +2 -1
  127. package/dist/docs/guides/scenario-editor.md +1 -1
  128. package/dist/docs/guides/setup.md +67 -10
  129. package/dist/docs/page-index.md +5 -4
  130. package/dist/docs/recipes/create-setup.md +18 -10
  131. package/dist/docs/recipes/give-setup-a-menu.md +96 -0
  132. package/dist/docs/recipes/index.md +1 -0
  133. package/dist/docs/recipes/write-setup-notes.md +13 -14
  134. package/dist/host/protocol.d.ts +8 -5
  135. package/dist/playwright.js +84 -9
  136. package/dist/runtime/manifest-version.d.ts +1 -1
  137. package/dist/runtime.js +1 -1
  138. package/dist/schema.json +20 -0
  139. package/dist/utils/error-codes.d.ts +6 -2
  140. package/package.json +3 -3
  141. package/dist/cli-5CG6BMCY.js +0 -36
  142. package/dist/cli-BQ3FHENQ.js +0 -16
  143. package/dist/cli-C2XDL4LD.js +0 -30
  144. package/dist/cli-MM2ROZWO.js +0 -36
  145. package/dist/cli-SN7D7HTX.js +0 -36
  146. package/dist/cli-TJNLXQJ5.js +0 -36
  147. package/dist/cli-V7L3HEL4.js +0 -36
  148. package/dist/cli-XPJGW375.js +0 -36
@@ -1,42 +1,40 @@
1
1
  # Write setup notes for assistants
2
2
 
3
- Tell an AI assistant setting a session up which of your game's settings matter, and what a request such as 'make it a bit harder' means in your game.
3
+ Tell an AI assistant setting a session up which of your setup's choices matter, and what a request such as 'make it a bit harder' means in your game.
4
4
 
5
- **Keywords:** setup notes, assistant, agent, AI setup, session setup, make it harder, shorter session, setting paths, setup/notes, MCP
5
+ **Keywords:** setup notes, assistant, agent, AI setup, session setup, setup menu, make it harder, shorter session, setting paths, setup/notes, MCP
6
6
 
7
7
  ## What you'll build
8
8
 
9
- A Markdown file at `setup/notes/en.md` that an assistant reads before changing a session's settings for a facilitator. A settings schema describes each setting on its own; the notes say how settings work together to mean what a facilitator asks for. They are for assistants: your setup screen is what a facilitator sees, and a host need not show the notes to anyone.
9
+ A Markdown file at `setup/notes/en.md` that an assistant reads before setting a session up for a facilitator. A settings schema describes each choice on its own; the notes say which choices mean what a facilitator asks for, and which requests need a scenario instead. They are for assistants: your setup screen is what a facilitator sees, and a host need not show the notes to anyone.
10
10
 
11
11
  ## Prerequisites
12
12
 
13
- - A [setup screen](create-setup.md), since the notes sit beside it and describe the settings it `configures`
13
+ - A [setup screen](create-setup.md) with a [menu of its own](give-setup-a-menu.md), since the notes describe the choices it `configures` and nothing else
14
14
  - `seriousgaming.sdk.json` in your working directory
15
15
 
16
16
  ## Steps
17
17
 
18
- 1. Create `setup/notes/en.md`. Name every setting as a setting path in a code span, as `engine.BaseDemand`, so an assistant can write it back as it stands:
18
+ 1. Create `setup/notes/en.md`. Name every setting as a setting path in a code span, as `setup.Market`, so an assistant can write it back as it stands. Name only settings your setup screen configures, with values their schemas allow:
19
19
 
20
20
  ```markdown
21
21
  # Setting up a Factory session
22
22
 
23
23
  Most sessions need no changes: start on the scenario the facilitator picked.
24
24
 
25
- ## Worth asking about
25
+ ## The choices
26
26
 
27
27
  - **Length.** `game.maxTicks` is the number of rounds, 10 by default, between 4 and 12
28
+ - **Market.** `setup.Market` is `gentler`, `standard` (the scenario as written) or `tougher`
28
29
 
29
30
  ## What requests mean
30
31
 
31
- - **'Harder'**: lower `engine.BaseDemand` to 7,000 and raise `engine.DemandPriceModifier` to 700
32
- - **'Shorter'**: set `game.maxTicks` to 6, and `engine.BonusTick` to 4 so the bonus still lands in play
33
-
34
- ## Leave alone
35
-
36
- - `engine.CostPerUnit` at £0 makes unsold stock free, which only suits a practice round
32
+ - **'Harder'**: set `setup.Market` to `tougher`
33
+ - **'Shorter'**: set `game.maxTicks` to 6. The bonus is paid in round 10, so say a shorter session pays none
34
+ - **Anything else**, such as cheaper materials: setup cannot do it. Suggest a scenario that does
37
35
  ```
38
36
 
39
- 2. Keep it short: the two to five choices worth asking a facilitator about, what common requests mean as settings and values, and what to leave alone. Where a request matches one of your scenarios, say to pick that scenario instead
37
+ 2. Keep it short: the choices worth asking a facilitator about, what common requests mean as choices, and which requests need a scenario. Where a request matches one of your scenarios, say to pick that scenario instead. Where what the menu offers depends on the scenario, name the setting that says what it offers, and list its resource in your setup's `settings`: an assistant may be able to read it, though not change it
40
38
 
41
39
  3. Add a file per locale you support, such as `setup/notes/it.md`. An assistant gets the notes in its locale, or `en`, or your first supported locale
42
40
 
@@ -48,11 +46,12 @@ A Markdown file at `setup/notes/en.md` that an assistant reads before changing a
48
46
  ## Troubleshooting
49
47
 
50
48
  - _`SETTINGS_UNKNOWN` in `setup/notes/en.md`_: a code span names a setting your package does not declare, often a typo. Any code span starting with one of your settings identifiers is read as a setting path
51
- - _`SETUP_NOTES_UNCONFIGURED`_: the notes name a setting your setup screen does not `configures`, so a host refuses that change. Add the settings identifier to `configures`, or leave the setting out
49
+ - _`SETUP_NOTES_UNCONFIGURED`_: the notes name a setting your setup screen neither `configures` nor lists in `settings`, so a host refuses that change. If the notes name it only as where the menu's offer comes from, add its resource to the setup's `settings`. Otherwise leave the setting out and say which scenario does the job, or, if facilitators should choose it, add it to your [menu](give-setup-a-menu.md). Adding a whole settings resource such as `engine` to `configures` hands every setting in it to the assistant
52
50
  - _A code span that is not a setting_, such as `requires`: fine. Only spans starting with a settings identifier are checked
53
51
 
54
52
  ## Related
55
53
 
56
54
  - [Setup guide: notes for assistants](../guides/setup.md#notes-for-assistants)
55
+ - [Give setup a menu](give-setup-a-menu.md)
57
56
  - [Describe a setup with an endpoint](describe-setup-with-endpoint.md): let an assistant read back what a setup means
58
57
  - [Validate a game's scenarios](validate-scenarios.md): refuse a session whose setup breaks your rules
@@ -689,15 +689,18 @@ export type HostSettingsEditorPortMessage = {
689
689
  type: 'ping';
690
690
  }
691
691
  /**
692
- * The **resolved** values of the settings this editor
693
- * `configures`, keyed by settings identifier (§8.3): the same message,
694
- * and the same shape, as every other surface's `setSettings`. Resolved
695
- * rather than the sparse override layer, which for a fresh session is
696
- * `{}` and would seed the form with nothing.
692
+ * The **resolved** values of the settings this editor `configures` and
693
+ * of those it lists in `settings`, keyed by settings identifier (§8.3):
694
+ * the same message, and the same payload, as every other surface's
695
+ * `setSettings`. Resolved rather than the sparse override layer, which
696
+ * for a fresh session is `{}` and would seed the form with nothing.
697
+ * `configures` names those of them the editor may change (§6.5); a host
698
+ * that predates it sends none, and then sends nothing it may not change.
697
699
  */
698
700
  | {
699
701
  type: 'setSettings';
700
702
  payload: Record<string, Record<string, unknown>>;
703
+ configures?: string[];
701
704
  } | {
702
705
  type: 'setTheme';
703
706
  payload: UserInterfaceTheme;
@@ -225,7 +225,7 @@ var BASES = [
225
225
  sites: []
226
226
  },
227
227
  // The two settings editors (§6.5): one layout, both naming the settings
228
- // they edit in `configures`. Neither ever lived under a plural directory;
228
+ // they edit in `configures` and those they only read in `settings`. Neither ever lived under a plural directory;
229
229
  // the version 2 settings editors they replace did, and the loader refuses
230
230
  // that directory with its own message.
231
231
  {
@@ -237,6 +237,7 @@ var BASES = [
237
237
  kind: "ui",
238
238
  label: "Setup user interface",
239
239
  declaresEndpoints: true,
240
+ readsSettings: true,
240
241
  sites: []
241
242
  },
242
243
  {
@@ -248,6 +249,7 @@ var BASES = [
248
249
  kind: "ui",
249
250
  label: "Scenario editor",
250
251
  declaresEndpoints: true,
252
+ readsSettings: true,
251
253
  sites: []
252
254
  },
253
255
  {
@@ -601,7 +603,11 @@ var ERROR_CODES = {
601
603
  },
602
604
  SETUP_NOTES_UNCONFIGURED: {
603
605
  category: "package",
604
- description: "A warning: the setup notes name a setting the setup UI does not `configures`, so a host refuses the change they describe."
606
+ description: "A warning: the setup notes name a setting the setup UI neither `configures` nor lists in `settings`, so a host refuses the change they describe and the setup UI cannot see it."
607
+ },
608
+ EDITOR_SETTINGS_CONFIGURED: {
609
+ category: "package",
610
+ description: "A warning: a settings editor lists a settings resource in both `configures` and `settings`. Configuring a resource already sends it, so the `settings` entry does nothing."
605
611
  },
606
612
  SETTINGS_UNGATED: {
607
613
  category: "package",
@@ -1565,6 +1571,16 @@ var schema_default = {
1565
1571
  uniqueItems: true,
1566
1572
  default: []
1567
1573
  },
1574
+ settings: {
1575
+ type: "array",
1576
+ description: "Identifiers of settings resources this setup user interface reads but does not edit, the built-in `game` included. It is sent their resolved values through `setSettings` beside those it configures, and a host refuses an `updateSettings` that names one. List a resource here, not in `configures`, when the screen only needs to see it, such as the list of what the scenario offers",
1577
+ items: {
1578
+ type: "string",
1579
+ pattern: "^[a-z][a-z0-9_]*$"
1580
+ },
1581
+ uniqueItems: true,
1582
+ default: []
1583
+ },
1568
1584
  endpoints: {
1569
1585
  type: "array",
1570
1586
  description: "Endpoint identifiers this setup user interface is permitted to call via `callbacks.endpoints[<identifier>]`. The host throws when this UI requests an endpoint whose identifier is not listed here.",
@@ -1598,6 +1614,16 @@ var schema_default = {
1598
1614
  uniqueItems: true,
1599
1615
  default: []
1600
1616
  },
1617
+ settings: {
1618
+ type: "array",
1619
+ description: "Identifiers of settings resources this scenario editor reads but does not edit, the built-in `game` included. It is sent their resolved values through `setSettings` beside those it configures, and a host refuses an `updateSettings` that names one. List a resource here, not in `configures`, when the screen only needs to see it, such as the list of what the scenario offers",
1620
+ items: {
1621
+ type: "string",
1622
+ pattern: "^[a-z][a-z0-9_]*$"
1623
+ },
1624
+ uniqueItems: true,
1625
+ default: []
1626
+ },
1601
1627
  endpoints: {
1602
1628
  type: "array",
1603
1629
  description: "Endpoint identifiers this scenario editor is permitted to call via `callbacks.endpoints[<identifier>]`. The host throws when this UI requests an endpoint whose identifier is not listed here.",
@@ -28830,6 +28856,16 @@ function collectUnknownSettingsReferences(config) {
28830
28856
  const resources = [
28831
28857
  { label: 'Engine "engine"', type: "engine", definition: config.engine?.definition },
28832
28858
  { label: 'User Interface "ui"', type: "ui", definition: config.ui?.definition },
28859
+ {
28860
+ label: 'Setup User Interface "setup"',
28861
+ type: "setup",
28862
+ definition: config.setup?.definition
28863
+ },
28864
+ {
28865
+ label: 'Scenario Editor "scenario_editor"',
28866
+ type: "scenario_editor",
28867
+ definition: config.scenario_editor?.definition
28868
+ },
28833
28869
  {
28834
28870
  label: 'Session User Interface "session"',
28835
28871
  type: "session",
@@ -29672,13 +29708,17 @@ var VALIDATION_DESCRIPTORS = [
29672
29708
  type: "setup",
29673
29709
  resources: (config) => slot(config.setup),
29674
29710
  identify: named2,
29675
- checks: [uiFiles, (setup, context) => setupNotesChecks(setup, context)]
29711
+ checks: [
29712
+ uiFiles,
29713
+ (setup, context) => setupNotesChecks(setup, context),
29714
+ editorSettingsChecks
29715
+ ]
29676
29716
  }),
29677
29717
  descriptor({
29678
29718
  type: "scenario_editor",
29679
29719
  resources: (config) => slot(config.scenario_editor),
29680
29720
  identify: named2,
29681
- checks: [uiFiles]
29721
+ checks: [uiFiles, editorSettingsChecks]
29682
29722
  }),
29683
29723
  descriptor({
29684
29724
  type: "tick_controller",
@@ -29962,11 +30002,32 @@ async function validateLoadedPackage(config, options) {
29962
30002
  }
29963
30003
  };
29964
30004
  }
30005
+ function editorSettingsChecks(editor) {
30006
+ const slot2 = editor.definition.identifier;
30007
+ const configures = new Set(editor.definition.configures ?? []);
30008
+ const warnings = [];
30009
+ const findings = [];
30010
+ (editor.definition.settings ?? []).forEach((identifier, index3) => {
30011
+ if (!configures.has(identifier)) return;
30012
+ const message = `${slot2} lists "${identifier}" in both \`configures\` and \`settings\`. Configuring a resource already sends it to the screen, so remove it from \`settings\`, or from \`configures\` if the screen should only read it.`;
30013
+ warnings.push(message);
30014
+ findings.push({
30015
+ severity: "warning",
30016
+ code: "EDITOR_SETTINGS_CONFIGURED",
30017
+ message,
30018
+ file: bundleFileOf(slot2, slot2),
30019
+ pointer: pointerOf("definition", "settings", index3),
30020
+ resource: { type: slot2, identifier: slot2 }
30021
+ });
30022
+ });
30023
+ return { errors: [], warnings, findings };
30024
+ }
29965
30025
  function setupNotesChecks(setup, context) {
29966
30026
  const directory = resolve8(context.workingDir, setup.rootDirectory);
29967
30027
  const schemas = settingsSchemas(context.config);
29968
30028
  const identifiers = new Set(Object.keys(schemas));
29969
30029
  const configures = new Set(setup.definition.configures ?? []);
30030
+ const reads = new Set(setup.definition.settings ?? []);
29970
30031
  const resource = { type: "setup", identifier: "setup" };
29971
30032
  const outcome = {
29972
30033
  errors: [],
@@ -29982,8 +30043,8 @@ function setupNotesChecks(setup, context) {
29982
30043
  for (const { path: path3, line } of notesSettingReferences(markdown, identifiers)) {
29983
30044
  if (!settingPathDeclared(schemas, path3)) continue;
29984
30045
  const identifier = parseSettingPath(path3)?.identifier ?? "";
29985
- if (!configures.has(identifier)) {
29986
- const message = `Setup notes ${file}, line ${line}, name \`${path3}\`, but the setup UI does not configure "${identifier}", so a host refuses that change. Add "${identifier}" to its \`configures\`, or leave the setting out of the notes.`;
30046
+ if (!configures.has(identifier) && !reads.has(identifier)) {
30047
+ const message = `Setup notes ${file}, line ${line}, name \`${path3}\`, but the setup UI neither configures nor reads "${identifier}", so a host refuses a change to it. Add "${identifier}" to its \`configures\` if setup may change it, or to its \`settings\` if the notes name it only as where the menu's offer is read from.`;
29987
30048
  outcome.warnings.push(message);
29988
30049
  outcome.findings.push({
29989
30050
  severity: "warning",
@@ -30948,7 +31009,10 @@ function toSurface(kind2, bundle, hidden) {
30948
31009
  endpoints: endpoints ?? [],
30949
31010
  crossTeamReads: visible(crossTeamReads),
30950
31011
  crossTeamParticipants: crossTeamParticipants === true,
30951
- settings: (kind2 === "setup" || kind2 === "scenario-editor" ? configures : settings) ?? []
31012
+ ...kind2 === "setup" || kind2 === "scenario-editor" ? {
31013
+ settings: [.../* @__PURE__ */ new Set([...configures ?? [], ...settings ?? []])],
31014
+ configures: configures ?? []
31015
+ } : { settings: settings ?? [] }
30952
31016
  };
30953
31017
  }
30954
31018
  var SURFACE_SLOT = {
@@ -31055,10 +31119,21 @@ function buildBatch(options) {
31055
31119
  // The two settings editors are sent the same batch (§12.3): neither is
31056
31120
  // told which slot it fills, since each is its own bundle.
31057
31121
  case "setup":
31058
- return [{ type: "setSettings", payload: settingsFor(state2, surface) }, ...common];
31122
+ return [
31123
+ {
31124
+ type: "setSettings",
31125
+ payload: settingsFor(state2, surface),
31126
+ configures: surface.configures ?? []
31127
+ },
31128
+ ...common
31129
+ ];
31059
31130
  case "scenario-editor":
31060
31131
  return [
31061
- { type: "setSettings", payload: draftSettingsFor(state2, surface, options.viewer) },
31132
+ {
31133
+ type: "setSettings",
31134
+ payload: draftSettingsFor(state2, surface, options.viewer),
31135
+ configures: surface.configures ?? []
31136
+ },
31062
31137
  ...common
31063
31138
  ];
31064
31139
  case "presentation":
@@ -26,7 +26,7 @@ export declare const MANIFEST_VERSION = 3;
26
26
  * section is stamped, it is the revision at the top of the appendix.
27
27
  * `spec-revision.test.ts` holds the two together.
28
28
  */
29
- export declare const SPEC_REVISION = "1.7";
29
+ export declare const SPEC_REVISION = "1.9";
30
30
  /**
31
31
  * Whether specification revision `revision` is later than `than`, both as
32
32
  * `major.minor`. A runtime MAY warn when a package's `builtWith.specRevision`
package/dist/runtime.js CHANGED
@@ -305,7 +305,7 @@ function readTickControllerResult(label, result) {
305
305
 
306
306
  // cli/runtime/manifest-version.ts
307
307
  var MANIFEST_VERSION = 3;
308
- var SPEC_REVISION = "1.7";
308
+ var SPEC_REVISION = "1.9";
309
309
  function isLaterSpecRevision(revision, than) {
310
310
  const [major, minor] = revision.split(".").map(Number);
311
311
  const [thanMajor, thanMinor] = than.split(".").map(Number);
package/dist/schema.json CHANGED
@@ -418,6 +418,16 @@
418
418
  "uniqueItems": true,
419
419
  "default": []
420
420
  },
421
+ "settings": {
422
+ "type": "array",
423
+ "description": "Identifiers of settings resources this setup user interface reads but does not edit, the built-in `game` included. It is sent their resolved values through `setSettings` beside those it configures, and a host refuses an `updateSettings` that names one. List a resource here, not in `configures`, when the screen only needs to see it, such as the list of what the scenario offers",
424
+ "items": {
425
+ "type": "string",
426
+ "pattern": "^[a-z][a-z0-9_]*$"
427
+ },
428
+ "uniqueItems": true,
429
+ "default": []
430
+ },
421
431
  "endpoints": {
422
432
  "type": "array",
423
433
  "description": "Endpoint identifiers this setup user interface is permitted to call via `callbacks.endpoints[<identifier>]`. The host throws when this UI requests an endpoint whose identifier is not listed here.",
@@ -451,6 +461,16 @@
451
461
  "uniqueItems": true,
452
462
  "default": []
453
463
  },
464
+ "settings": {
465
+ "type": "array",
466
+ "description": "Identifiers of settings resources this scenario editor reads but does not edit, the built-in `game` included. It is sent their resolved values through `setSettings` beside those it configures, and a host refuses an `updateSettings` that names one. List a resource here, not in `configures`, when the screen only needs to see it, such as the list of what the scenario offers",
467
+ "items": {
468
+ "type": "string",
469
+ "pattern": "^[a-z][a-z0-9_]*$"
470
+ },
471
+ "uniqueItems": true,
472
+ "default": []
473
+ },
454
474
  "endpoints": {
455
475
  "type": "array",
456
476
  "description": "Endpoint identifiers this scenario editor is permitted to call via `callbacks.endpoints[<identifier>]`. The host throws when this UI requests an endpoint whose identifier is not listed here.",
@@ -207,7 +207,11 @@ export declare const ERROR_CODES: {
207
207
  };
208
208
  readonly SETUP_NOTES_UNCONFIGURED: {
209
209
  readonly category: "package";
210
- readonly description: "A warning: the setup notes name a setting the setup UI does not `configures`, so a host refuses the change they describe.";
210
+ readonly description: "A warning: the setup notes name a setting the setup UI neither `configures` nor lists in `settings`, so a host refuses the change they describe and the setup UI cannot see it.";
211
+ };
212
+ readonly EDITOR_SETTINGS_CONFIGURED: {
213
+ readonly category: "package";
214
+ readonly description: "A warning: a settings editor lists a settings resource in both `configures` and `settings`. Configuring a resource already sends it, so the `settings` entry does nothing.";
211
215
  };
212
216
  readonly SETTINGS_UNGATED: {
213
217
  readonly category: "package";
@@ -368,7 +372,7 @@ export type ErrorCode = keyof typeof ERROR_CODES;
368
372
  * failure's `error.code` says what kind of failure it was; its diagnostics say
369
373
  * what was found and where. LOGIC_ERROR is only ever a diagnostic.
370
374
  */
371
- export declare const DIAGNOSTIC_CODES: readonly ["PACKAGE_INVALID", "SCHEMA_INVALID", "JSON_INVALID", "BUNDLE_MISSING", "REMOVED_FIELD", "LAYOUT_OUTDATED", "FEATURE_UNSUPPORTED", "FEATURE_UNDECLARED", "REFERENCE_UNKNOWN", "SETTINGS_UNKNOWN", "SETTINGS_UNKNOWN_KEY", "SETTINGS_INVALID", "SETTINGS_RESERVED", "SETTINGS_LOCKED", "GAME_CONSTRAINT_INVALID", "GAME_CONSTRAINT_VIOLATED", "LOGIC_EXPORT_MISSING", "LOGIC_NODE_BUILTIN", "LOGIC_BUNDLE_FAILED", "READ_NEVER_WRITTEN", "NO_TERMINATION", "SCENARIO_EDITOR_UNREACHABLE", "SCENARIO_REFUSED", "SCENARIO_WARNING", "SETTINGS_UNGATED", "SETUP_NOTES_UNCONFIGURED", "EDITOR_ENDPOINT_NOT_SCENARIO", "SCENARIO_ENDPOINT_STATEFUL", "EXTERNAL_REQUEST_NOT_OBJECT", "ENDPOINT_UNREQUESTED", "LOGIC_ERROR"];
375
+ export declare const DIAGNOSTIC_CODES: readonly ["PACKAGE_INVALID", "SCHEMA_INVALID", "JSON_INVALID", "BUNDLE_MISSING", "REMOVED_FIELD", "LAYOUT_OUTDATED", "FEATURE_UNSUPPORTED", "FEATURE_UNDECLARED", "REFERENCE_UNKNOWN", "SETTINGS_UNKNOWN", "SETTINGS_UNKNOWN_KEY", "SETTINGS_INVALID", "SETTINGS_RESERVED", "SETTINGS_LOCKED", "GAME_CONSTRAINT_INVALID", "GAME_CONSTRAINT_VIOLATED", "LOGIC_EXPORT_MISSING", "LOGIC_NODE_BUILTIN", "LOGIC_BUNDLE_FAILED", "READ_NEVER_WRITTEN", "NO_TERMINATION", "SCENARIO_EDITOR_UNREACHABLE", "SCENARIO_REFUSED", "SCENARIO_WARNING", "SETTINGS_UNGATED", "SETUP_NOTES_UNCONFIGURED", "EDITOR_SETTINGS_CONFIGURED", "EDITOR_ENDPOINT_NOT_SCENARIO", "SCENARIO_ENDPOINT_STATEFUL", "EXTERNAL_REQUEST_NOT_OBJECT", "ENDPOINT_UNREQUESTED", "LOGIC_ERROR"];
372
376
  export type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[number];
373
377
  export declare function categoryOf(code: ErrorCode): ErrorCategory;
374
378
  export declare function exitCodeOf(code: ErrorCode): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seriousgaming/sdk-tools",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "SDK tooling for building Serious Gaming games",
5
5
  "homepage": "https://sdk.seriousgaming.com/",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -74,7 +74,7 @@
74
74
  "@mui/icons-material": "^9.5.0",
75
75
  "@mui/material": "^9.5.0",
76
76
  "@playwright/test": "^1.64.1",
77
- "@seriousgaming/sdk": "1.8.0",
77
+ "@seriousgaming/sdk": "1.10.0",
78
78
  "@testing-library/jest-dom": "^7.0.1",
79
79
  "@testing-library/react": "^16.3.3",
80
80
  "@types/express": "^5.0.6",
@@ -103,7 +103,7 @@
103
103
  },
104
104
  "peerDependencies": {
105
105
  "@playwright/test": ">=1.50.0",
106
- "@seriousgaming/sdk": "^1.8.0"
106
+ "@seriousgaming/sdk": "^1.10.0"
107
107
  },
108
108
  "peerDependenciesMeta": {
109
109
  "@playwright/test": {
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- deleteSettingsEditor
4
- } from "./cli-G7FX7ZIU.js";
5
- import "./cli-UYV3BDPA.js";
6
- import "./cli-KMT235FV.js";
7
- import "./cli-S5IVGDDD.js";
8
- import "./cli-3HPAKEJJ.js";
9
- import "./cli-3VV2JLHX.js";
10
- import "./cli-MPU4FLA7.js";
11
- import "./cli-VTLFQHDO.js";
12
- import "./cli-QUNIRH7A.js";
13
- import "./cli-UTHPCZYL.js";
14
- import "./cli-BC4KKNLA.js";
15
- import "./cli-UADUC4JD.js";
16
- import "./cli-2QM63J3I.js";
17
- import "./cli-QAVLRCQ5.js";
18
- import "./cli-NU4SCD5D.js";
19
- import "./cli-UZCQL6YP.js";
20
- import "./cli-SOQJHK4Q.js";
21
- import "./cli-7S4G4EKK.js";
22
- import "./cli-O3IMNLN2.js";
23
- import "./cli-25RWY5BQ.js";
24
- import "./cli-QWQMPCL6.js";
25
- import "./cli-OUFXSQOW.js";
26
- import "./cli-F2D4GGUA.js";
27
- import "./cli-DMKRP33X.js";
28
- import "./cli-AEAFLZGY.js";
29
-
30
- // cli/commands/resources/scenario-editor/delete.ts
31
- function deleteScenarioEditor(options) {
32
- return deleteSettingsEditor("scenario_editor", options);
33
- }
34
- export {
35
- deleteScenarioEditor
36
- };
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- generateCommand
4
- } from "./cli-UZCQL6YP.js";
5
- import "./cli-SOQJHK4Q.js";
6
- import "./cli-7S4G4EKK.js";
7
- import "./cli-O3IMNLN2.js";
8
- import "./cli-25RWY5BQ.js";
9
- import "./cli-QWQMPCL6.js";
10
- import "./cli-OUFXSQOW.js";
11
- import "./cli-F2D4GGUA.js";
12
- import "./cli-DMKRP33X.js";
13
- import "./cli-AEAFLZGY.js";
14
- export {
15
- generateCommand
16
- };
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- submitPatch,
4
- submitSharedPatch,
5
- tickCommand
6
- } from "./cli-KFVA7DT3.js";
7
- import "./cli-E665NKUQ.js";
8
- import "./cli-HJPNNORV.js";
9
- import "./cli-Q5BKFFDL.js";
10
- import "./cli-726NJARI.js";
11
- import "./cli-42ZUP4X3.js";
12
- import "./cli-K6M6YB67.js";
13
- import "./cli-Y33ULHYO.js";
14
- import "./cli-WWNTBK37.js";
15
- import "./cli-4LKXZQ2B.js";
16
- import "./cli-7CW2BBJG.js";
17
- import "./cli-S5IVGDDD.js";
18
- import "./cli-QUNIRH7A.js";
19
- import "./cli-O3IMNLN2.js";
20
- import "./cli-25RWY5BQ.js";
21
- import "./cli-QWQMPCL6.js";
22
- import "./cli-OUFXSQOW.js";
23
- import "./cli-F2D4GGUA.js";
24
- import "./cli-DMKRP33X.js";
25
- import "./cli-AEAFLZGY.js";
26
- export {
27
- submitPatch,
28
- submitSharedPatch,
29
- tickCommand
30
- };
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- createSettingsEditor
4
- } from "./cli-G7FX7ZIU.js";
5
- import "./cli-UYV3BDPA.js";
6
- import "./cli-KMT235FV.js";
7
- import "./cli-S5IVGDDD.js";
8
- import "./cli-3HPAKEJJ.js";
9
- import "./cli-3VV2JLHX.js";
10
- import "./cli-MPU4FLA7.js";
11
- import "./cli-VTLFQHDO.js";
12
- import "./cli-QUNIRH7A.js";
13
- import "./cli-UTHPCZYL.js";
14
- import "./cli-BC4KKNLA.js";
15
- import "./cli-UADUC4JD.js";
16
- import "./cli-2QM63J3I.js";
17
- import "./cli-QAVLRCQ5.js";
18
- import "./cli-NU4SCD5D.js";
19
- import "./cli-UZCQL6YP.js";
20
- import "./cli-SOQJHK4Q.js";
21
- import "./cli-7S4G4EKK.js";
22
- import "./cli-O3IMNLN2.js";
23
- import "./cli-25RWY5BQ.js";
24
- import "./cli-QWQMPCL6.js";
25
- import "./cli-OUFXSQOW.js";
26
- import "./cli-F2D4GGUA.js";
27
- import "./cli-DMKRP33X.js";
28
- import "./cli-AEAFLZGY.js";
29
-
30
- // cli/commands/resources/scenario-editor/new.ts
31
- function createScenarioEditor(definitionInput, options) {
32
- return createSettingsEditor("scenario_editor", definitionInput, options);
33
- }
34
- export {
35
- createScenarioEditor
36
- };
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- updateSettingsEditor
4
- } from "./cli-G7FX7ZIU.js";
5
- import "./cli-UYV3BDPA.js";
6
- import "./cli-KMT235FV.js";
7
- import "./cli-S5IVGDDD.js";
8
- import "./cli-3HPAKEJJ.js";
9
- import "./cli-3VV2JLHX.js";
10
- import "./cli-MPU4FLA7.js";
11
- import "./cli-VTLFQHDO.js";
12
- import "./cli-QUNIRH7A.js";
13
- import "./cli-UTHPCZYL.js";
14
- import "./cli-BC4KKNLA.js";
15
- import "./cli-UADUC4JD.js";
16
- import "./cli-2QM63J3I.js";
17
- import "./cli-QAVLRCQ5.js";
18
- import "./cli-NU4SCD5D.js";
19
- import "./cli-UZCQL6YP.js";
20
- import "./cli-SOQJHK4Q.js";
21
- import "./cli-7S4G4EKK.js";
22
- import "./cli-O3IMNLN2.js";
23
- import "./cli-25RWY5BQ.js";
24
- import "./cli-QWQMPCL6.js";
25
- import "./cli-OUFXSQOW.js";
26
- import "./cli-F2D4GGUA.js";
27
- import "./cli-DMKRP33X.js";
28
- import "./cli-AEAFLZGY.js";
29
-
30
- // cli/commands/resources/scenario-editor/update.ts
31
- function updateScenarioEditor(definitionInput, options) {
32
- return updateSettingsEditor("scenario_editor", definitionInput, options);
33
- }
34
- export {
35
- updateScenarioEditor
36
- };
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- updateSettingsEditor
4
- } from "./cli-G7FX7ZIU.js";
5
- import "./cli-UYV3BDPA.js";
6
- import "./cli-KMT235FV.js";
7
- import "./cli-S5IVGDDD.js";
8
- import "./cli-3HPAKEJJ.js";
9
- import "./cli-3VV2JLHX.js";
10
- import "./cli-MPU4FLA7.js";
11
- import "./cli-VTLFQHDO.js";
12
- import "./cli-QUNIRH7A.js";
13
- import "./cli-UTHPCZYL.js";
14
- import "./cli-BC4KKNLA.js";
15
- import "./cli-UADUC4JD.js";
16
- import "./cli-2QM63J3I.js";
17
- import "./cli-QAVLRCQ5.js";
18
- import "./cli-NU4SCD5D.js";
19
- import "./cli-UZCQL6YP.js";
20
- import "./cli-SOQJHK4Q.js";
21
- import "./cli-7S4G4EKK.js";
22
- import "./cli-O3IMNLN2.js";
23
- import "./cli-25RWY5BQ.js";
24
- import "./cli-QWQMPCL6.js";
25
- import "./cli-OUFXSQOW.js";
26
- import "./cli-F2D4GGUA.js";
27
- import "./cli-DMKRP33X.js";
28
- import "./cli-AEAFLZGY.js";
29
-
30
- // cli/commands/resources/setup/update.ts
31
- function updateSetup(definitionInput, options) {
32
- return updateSettingsEditor("setup", definitionInput, options);
33
- }
34
- export {
35
- updateSetup
36
- };
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- createSettingsEditor
4
- } from "./cli-G7FX7ZIU.js";
5
- import "./cli-UYV3BDPA.js";
6
- import "./cli-KMT235FV.js";
7
- import "./cli-S5IVGDDD.js";
8
- import "./cli-3HPAKEJJ.js";
9
- import "./cli-3VV2JLHX.js";
10
- import "./cli-MPU4FLA7.js";
11
- import "./cli-VTLFQHDO.js";
12
- import "./cli-QUNIRH7A.js";
13
- import "./cli-UTHPCZYL.js";
14
- import "./cli-BC4KKNLA.js";
15
- import "./cli-UADUC4JD.js";
16
- import "./cli-2QM63J3I.js";
17
- import "./cli-QAVLRCQ5.js";
18
- import "./cli-NU4SCD5D.js";
19
- import "./cli-UZCQL6YP.js";
20
- import "./cli-SOQJHK4Q.js";
21
- import "./cli-7S4G4EKK.js";
22
- import "./cli-O3IMNLN2.js";
23
- import "./cli-25RWY5BQ.js";
24
- import "./cli-QWQMPCL6.js";
25
- import "./cli-OUFXSQOW.js";
26
- import "./cli-F2D4GGUA.js";
27
- import "./cli-DMKRP33X.js";
28
- import "./cli-AEAFLZGY.js";
29
-
30
- // cli/commands/resources/setup/new.ts
31
- function createSetup(definitionInput, options) {
32
- return createSettingsEditor("setup", definitionInput, options);
33
- }
34
- export {
35
- createSetup
36
- };