@seriousgaming/sdk-tools 1.9.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 (146) hide show
  1. package/dist/{cli-KJV3GGBA.js → cli-226ZJ72R.js} +1 -1
  2. package/dist/{cli-VRGVHSXH.js → cli-25SJZI7N.js} +44 -9
  3. package/dist/{cli-OK6XWVIN.js → cli-267QJ2DS.js} +17 -17
  4. package/dist/cli-27Z5T52R.js +30 -0
  5. package/dist/{cli-H7T6E7OA.js → cli-2AH6D32V.js} +2 -2
  6. package/dist/{cli-A3P3PO6Z.js → cli-2ANX6E3A.js} +15 -15
  7. package/dist/{cli-J75EBRAJ.js → cli-2AVPNSAX.js} +17 -17
  8. package/dist/{cli-6COAU7JR.js → cli-33MZSPPK.js} +17 -17
  9. package/dist/{cli-USBJQAYI.js → cli-35GV2F6R.js} +13 -13
  10. package/dist/{cli-BYXNPBVG.js → cli-36GABN2A.js} +15 -15
  11. package/dist/{cli-DXHPYN4N.js → cli-44CM2AH2.js} +1 -1
  12. package/dist/{cli-BV7MX7JE.js → cli-467VRXGP.js} +3 -3
  13. package/dist/{cli-OOTGO3KW.js → cli-4A7RWFNO.js} +49 -49
  14. package/dist/{cli-6GDPO5VU.js → cli-4FJL3KQZ.js} +2 -2
  15. package/dist/{cli-CL3KF5KS.js → cli-4JNF3O5N.js} +2 -2
  16. package/dist/{cli-BT47H36C.js → cli-5DWR7RPQ.js} +2 -2
  17. package/dist/{cli-AA5GMEUL.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-XA4IL7IM.js → cli-5RRPUL6V.js} +11 -11
  21. package/dist/{cli-PJO4BKSV.js → cli-5SHG2M7E.js} +16 -16
  22. package/dist/{cli-LZFUSEJT.js → cli-5TKPT3CY.js} +13 -13
  23. package/dist/{cli-YI3WZF3C.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-G7JTIP5G.js → cli-6BLVI2JM.js} +11 -7
  28. package/dist/{cli-S3YIYAXC.js → cli-6CYAOUYT.js} +12 -12
  29. package/dist/{cli-7OCEVQQN.js → cli-6O7YCK2M.js} +2 -2
  30. package/dist/{cli-IC5FOT2J.js → cli-7JUNA74L.js} +1 -1
  31. package/dist/{cli-CPX4YA3P.js → cli-7NUFHMGE.js} +11 -11
  32. package/dist/{cli-GZE4V7RC.js → cli-A3AJQZEN.js} +19 -19
  33. package/dist/{cli-2FXZZLCL.js → cli-AH6AMAIB.js} +1 -1
  34. package/dist/{cli-QWO3XJR3.js → cli-ATWJCB2G.js} +4 -4
  35. package/dist/{cli-MN7X4UG2.js → cli-B3EFE7ZF.js} +1 -1
  36. package/dist/{cli-3RMP4HKZ.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-A7PITFRR.js → cli-CLO7HKEQ.js} +2 -2
  42. package/dist/{cli-2BF7KBBJ.js → cli-CQ4ZR3ZQ.js} +15 -15
  43. package/dist/{cli-KINJAQTJ.js → cli-EXUPHPDJ.js} +19 -19
  44. package/dist/{cli-2JEICVMA.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-4L7S27XO.js → cli-GO64NABP.js} +1 -1
  48. package/dist/{cli-QK2OD24J.js → cli-GRSQRFRG.js} +1 -1
  49. package/dist/{cli-XRVH5WV6.js → cli-GSOV26O5.js} +13 -13
  50. package/dist/{cli-6Y4XIVQS.js → cli-HGCOEL5T.js} +3 -3
  51. package/dist/{cli-R6YAZP6E.js → cli-HHRP6FP6.js} +19 -19
  52. package/dist/{cli-TLRTLTGK.js → cli-HN442ZVK.js} +18 -18
  53. package/dist/{cli-7CW2BBJG.js → cli-HNDFANQG.js} +1 -1
  54. package/dist/{cli-CKV44U7P.js → cli-HNG6PZW2.js} +19 -19
  55. package/dist/cli-I3ZAZYWP.js +36 -0
  56. package/dist/{cli-MSSJLABW.js → cli-IKSLPAZN.js} +3 -3
  57. package/dist/{cli-DJCQ5XFR.js → cli-ILHHJR2S.js} +15 -15
  58. package/dist/{cli-D6AC3ZCX.js → cli-IPTHJT3J.js} +18 -18
  59. package/dist/{cli-2VV5IPSY.js → cli-IQBY7Z7Q.js} +15 -15
  60. package/dist/{cli-IJPRZSJ5.js → cli-J42N4PJG.js} +20 -20
  61. package/dist/{cli-6KL5B7EC.js → cli-JAVMRERQ.js} +15 -15
  62. package/dist/{cli-AJ5CABGJ.js → cli-JHLWBRXB.js} +15 -15
  63. package/dist/{cli-7RLZIWFP.js → cli-JMNPMDXH.js} +19 -19
  64. package/dist/{cli-5PTCQTS6.js → cli-JXQLHJO2.js} +1 -1
  65. package/dist/{cli-WJO75KP7.js → cli-KIZTASLL.js} +3 -3
  66. package/dist/{cli-MX7GFQ6N.js → cli-KJA6GLZI.js} +14 -14
  67. package/dist/{cli-RL5EBZL7.js → cli-KNXY43YV.js} +3 -3
  68. package/dist/{cli-L5ZKQNMI.js → cli-L54SXUK6.js} +15 -15
  69. package/dist/{cli-ZHFHOWJI.js → cli-LLJQI2QP.js} +11 -11
  70. package/dist/{cli-NTI22MRE.js → cli-LNEZ6KDW.js} +16 -16
  71. package/dist/{cli-KO26S2CL.js → cli-M6AZFIMV.js} +26 -12
  72. package/dist/{cli-BNN36WZJ.js → cli-MDVC5ZNM.js} +13 -13
  73. package/dist/{cli-JEMWAIAA.js → cli-MGZYQDCH.js} +15 -15
  74. package/dist/{cli-35K37SYY.js → cli-MUOLHQNL.js} +14 -14
  75. package/dist/{cli-2UOUIVHW.js → cli-NAZTYKZT.js} +11 -11
  76. package/dist/{cli-LFUKHLHI.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-5BPQ73OM.js → cli-OXU6TTEN.js} +15 -15
  81. package/dist/{cli-NU4SCD5D.js → cli-P3NUTOPK.js} +1 -1
  82. package/dist/{cli-E77R7ZYB.js → cli-PBSLPO6G.js} +15 -15
  83. package/dist/{cli-OX3254NS.js → cli-PTXOKO2Y.js} +17 -17
  84. package/dist/{cli-7N7WFRWA.js → cli-PXQYY6KM.js} +0 -0
  85. package/dist/{cli-HCMVZXWK.js → cli-PYAST3G5.js} +17 -17
  86. package/dist/{cli-7V6GUIIS.js → cli-QDBYFITU.js} +2 -2
  87. package/dist/{cli-W4BHSBAX.js → cli-QTCTWYCM.js} +3 -3
  88. package/dist/{cli-QIHVXDMW.js → cli-QW7VXL2V.js} +15 -15
  89. package/dist/cli-RFAPPYXK.js +36 -0
  90. package/dist/{cli-KD2RQS35.js → cli-RSF5R3HC.js} +18 -18
  91. package/dist/{cli-YD4SBAHQ.js → cli-RUEPTOWG.js} +19 -19
  92. package/dist/{cli-G54355N5.js → cli-SOO6SEIS.js} +18 -18
  93. package/dist/{cli-DMKRP33X.js → cli-TCQJL2GY.js} +1 -1
  94. package/dist/{cli-MYBDWJP7.js → cli-TDLIPYKT.js} +20 -20
  95. package/dist/{cli-2CSI2UU2.js → cli-UEQMK4WX.js} +1 -1
  96. package/dist/{cli-2I6UN6C3.js → cli-UQC46YSV.js} +3 -3
  97. package/dist/{cli-GHQIATHP.js → cli-URCHZDTS.js} +4 -4
  98. package/dist/{cli-BF6L37O3.js → cli-UULZSQBV.js} +3 -3
  99. package/dist/{cli-CQUSM3SF.js → cli-VALLLE6Y.js} +19 -19
  100. package/dist/{cli-MTAGL3QE.js → cli-VZVHS5AP.js} +15 -15
  101. package/dist/{cli-UR63LFVK.js → cli-W3RG2MRI.js} +2 -2
  102. package/dist/{cli-RHYQYXE2.js → cli-WG7MAOCS.js} +18 -18
  103. package/dist/{cli-KGJHEDR2.js → cli-WLSACMYA.js} +19 -19
  104. package/dist/{cli-SBKTGFY4.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-ZZSPFLTK.js → cli-X64BNBQH.js} +26 -4
  108. package/dist/{cli-MZM4MW7C.js → cli-XB5PI2XT.js} +19 -19
  109. package/dist/cli-XEEOJGBL.js +36 -0
  110. package/dist/{cli-EDZF5Q2E.js → cli-XKAIDYIE.js} +14 -14
  111. package/dist/{cli-2PMLR6WG.js → cli-XR3O2YTV.js} +15 -15
  112. package/dist/{cli-3VV2JLHX.js → cli-XW3JLRSA.js} +1 -1
  113. package/dist/{cli-S7PLSPGE.js → cli-YFLQ7XOO.js} +15 -15
  114. package/dist/{cli-B5LZEFLU.js → cli-YZJBFKRI.js} +15 -15
  115. package/dist/{cli-ICLCA6VD.js → cli-Z3DITVBE.js} +19 -19
  116. package/dist/{cli-QRAYIXNE.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 +10 -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 +22 -5
  129. package/dist/docs/page-index.md +2 -2
  130. package/dist/docs/recipes/give-setup-a-menu.md +7 -1
  131. package/dist/docs/recipes/write-setup-notes.md +2 -2
  132. package/dist/host/protocol.d.ts +8 -5
  133. package/dist/playwright.js +84 -9
  134. package/dist/runtime/manifest-version.d.ts +1 -1
  135. package/dist/runtime.js +1 -1
  136. package/dist/schema.json +20 -0
  137. package/dist/utils/error-codes.d.ts +6 -2
  138. package/package.json +3 -3
  139. package/dist/cli-3I6AI4AA.js +0 -36
  140. package/dist/cli-3YGNWZC6.js +0 -30
  141. package/dist/cli-4X3X4HB2.js +0 -16
  142. package/dist/cli-6ZBQELF2.js +0 -36
  143. package/dist/cli-CUZUIYCQ.js +0 -36
  144. package/dist/cli-DNCJURUU.js +0 -36
  145. package/dist/cli-UKC7KXWU.js +0 -36
  146. package/dist/cli-WA2PDQUB.js +0 -36
package/dist/client.js CHANGED
@@ -623,7 +623,11 @@ var ERROR_CODES = {
623
623
  },
624
624
  SETUP_NOTES_UNCONFIGURED: {
625
625
  category: "package",
626
- description: "A warning: the setup notes name a setting the setup UI does not `configures`, so a host refuses the change they describe."
626
+ 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."
627
+ },
628
+ EDITOR_SETTINGS_CONFIGURED: {
629
+ category: "package",
630
+ 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."
627
631
  },
628
632
  SETTINGS_UNGATED: {
629
633
  category: "package",
@@ -1439,6 +1443,16 @@ var schema_default = {
1439
1443
  uniqueItems: true,
1440
1444
  default: []
1441
1445
  },
1446
+ settings: {
1447
+ type: "array",
1448
+ 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",
1449
+ items: {
1450
+ type: "string",
1451
+ pattern: "^[a-z][a-z0-9_]*$"
1452
+ },
1453
+ uniqueItems: true,
1454
+ default: []
1455
+ },
1442
1456
  endpoints: {
1443
1457
  type: "array",
1444
1458
  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.",
@@ -1472,6 +1486,16 @@ var schema_default = {
1472
1486
  uniqueItems: true,
1473
1487
  default: []
1474
1488
  },
1489
+ settings: {
1490
+ type: "array",
1491
+ 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",
1492
+ items: {
1493
+ type: "string",
1494
+ pattern: "^[a-z][a-z0-9_]*$"
1495
+ },
1496
+ uniqueItems: true,
1497
+ default: []
1498
+ },
1475
1499
  endpoints: {
1476
1500
  type: "array",
1477
1501
  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.",
@@ -15211,7 +15235,7 @@ var BASES = [
15211
15235
  sites: []
15212
15236
  },
15213
15237
  // The two settings editors (§6.5): one layout, both naming the settings
15214
- // they edit in `configures`. Neither ever lived under a plural directory;
15238
+ // they edit in `configures` and those they only read in `settings`. Neither ever lived under a plural directory;
15215
15239
  // the version 2 settings editors they replace did, and the loader refuses
15216
15240
  // that directory with its own message.
15217
15241
  {
@@ -15223,6 +15247,7 @@ var BASES = [
15223
15247
  kind: "ui",
15224
15248
  label: "Setup user interface",
15225
15249
  declaresEndpoints: true,
15250
+ readsSettings: true,
15226
15251
  sites: []
15227
15252
  },
15228
15253
  {
@@ -15234,6 +15259,7 @@ var BASES = [
15234
15259
  kind: "ui",
15235
15260
  label: "Scenario editor",
15236
15261
  declaresEndpoints: true,
15262
+ readsSettings: true,
15237
15263
  sites: []
15238
15264
  },
15239
15265
  {
@@ -29116,6 +29142,16 @@ function collectUnknownSettingsReferences(config) {
29116
29142
  const resources = [
29117
29143
  { label: 'Engine "engine"', type: "engine", definition: config.engine?.definition },
29118
29144
  { label: 'User Interface "ui"', type: "ui", definition: config.ui?.definition },
29145
+ {
29146
+ label: 'Setup User Interface "setup"',
29147
+ type: "setup",
29148
+ definition: config.setup?.definition
29149
+ },
29150
+ {
29151
+ label: 'Scenario Editor "scenario_editor"',
29152
+ type: "scenario_editor",
29153
+ definition: config.scenario_editor?.definition
29154
+ },
29119
29155
  {
29120
29156
  label: 'Session User Interface "session"',
29121
29157
  type: "session",
@@ -29958,13 +29994,17 @@ var VALIDATION_DESCRIPTORS = [
29958
29994
  type: "setup",
29959
29995
  resources: (config) => slot(config.setup),
29960
29996
  identify: named2,
29961
- checks: [uiFiles, (setup, context) => setupNotesChecks(setup, context)]
29997
+ checks: [
29998
+ uiFiles,
29999
+ (setup, context) => setupNotesChecks(setup, context),
30000
+ editorSettingsChecks
30001
+ ]
29962
30002
  }),
29963
30003
  descriptor({
29964
30004
  type: "scenario_editor",
29965
30005
  resources: (config) => slot(config.scenario_editor),
29966
30006
  identify: named2,
29967
- checks: [uiFiles]
30007
+ checks: [uiFiles, editorSettingsChecks]
29968
30008
  }),
29969
30009
  descriptor({
29970
30010
  type: "tick_controller",
@@ -30248,11 +30288,32 @@ async function validateLoadedPackage(config, options) {
30248
30288
  }
30249
30289
  };
30250
30290
  }
30291
+ function editorSettingsChecks(editor) {
30292
+ const slot2 = editor.definition.identifier;
30293
+ const configures = new Set(editor.definition.configures ?? []);
30294
+ const warnings = [];
30295
+ const findings = [];
30296
+ (editor.definition.settings ?? []).forEach((identifier, index3) => {
30297
+ if (!configures.has(identifier)) return;
30298
+ 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.`;
30299
+ warnings.push(message);
30300
+ findings.push({
30301
+ severity: "warning",
30302
+ code: "EDITOR_SETTINGS_CONFIGURED",
30303
+ message,
30304
+ file: bundleFileOf(slot2, slot2),
30305
+ pointer: pointerOf("definition", "settings", index3),
30306
+ resource: { type: slot2, identifier: slot2 }
30307
+ });
30308
+ });
30309
+ return { errors: [], warnings, findings };
30310
+ }
30251
30311
  function setupNotesChecks(setup, context) {
30252
30312
  const directory = resolve7(context.workingDir, setup.rootDirectory);
30253
30313
  const schemas = settingsSchemas(context.config);
30254
30314
  const identifiers = new Set(Object.keys(schemas));
30255
30315
  const configures = new Set(setup.definition.configures ?? []);
30316
+ const reads = new Set(setup.definition.settings ?? []);
30256
30317
  const resource = { type: "setup", identifier: "setup" };
30257
30318
  const outcome = {
30258
30319
  errors: [],
@@ -30268,8 +30329,8 @@ function setupNotesChecks(setup, context) {
30268
30329
  for (const { path: path3, line } of notesSettingReferences(markdown, identifiers)) {
30269
30330
  if (!settingPathDeclared(schemas, path3)) continue;
30270
30331
  const identifier = parseSettingPath(path3)?.identifier ?? "";
30271
- if (!configures.has(identifier)) {
30272
- 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.`;
30332
+ if (!configures.has(identifier) && !reads.has(identifier)) {
30333
+ 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.`;
30273
30334
  outcome.warnings.push(message);
30274
30335
  outcome.findings.push({
30275
30336
  severity: "warning",
@@ -31234,7 +31295,10 @@ function toSurface(kind2, bundle, hidden) {
31234
31295
  endpoints: endpoints ?? [],
31235
31296
  crossTeamReads: visible(crossTeamReads),
31236
31297
  crossTeamParticipants: crossTeamParticipants === true,
31237
- settings: (kind2 === "setup" || kind2 === "scenario-editor" ? configures : settings) ?? []
31298
+ ...kind2 === "setup" || kind2 === "scenario-editor" ? {
31299
+ settings: [.../* @__PURE__ */ new Set([...configures ?? [], ...settings ?? []])],
31300
+ configures: configures ?? []
31301
+ } : { settings: settings ?? [] }
31238
31302
  };
31239
31303
  }
31240
31304
  var SURFACE_SLOT = {
@@ -31341,10 +31405,21 @@ function buildBatch(options) {
31341
31405
  // The two settings editors are sent the same batch (§12.3): neither is
31342
31406
  // told which slot it fills, since each is its own bundle.
31343
31407
  case "setup":
31344
- return [{ type: "setSettings", payload: settingsFor(state2, surface) }, ...common];
31408
+ return [
31409
+ {
31410
+ type: "setSettings",
31411
+ payload: settingsFor(state2, surface),
31412
+ configures: surface.configures ?? []
31413
+ },
31414
+ ...common
31415
+ ];
31345
31416
  case "scenario-editor":
31346
31417
  return [
31347
- { type: "setSettings", payload: draftSettingsFor(state2, surface, options.viewer) },
31418
+ {
31419
+ type: "setSettings",
31420
+ payload: draftSettingsFor(state2, surface, options.viewer),
31421
+ configures: surface.configures ?? []
31422
+ },
31348
31423
  ...common
31349
31424
  ];
31350
31425
  case "presentation":