@seriousgaming/sdk-tools 1.7.0 → 1.9.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 (188) hide show
  1. package/dist/agent/guidance.md +1 -0
  2. package/dist/{cli-SOFCTQAL.js → cli-2BF7KBBJ.js} +15 -15
  3. package/dist/cli-2CSI2UU2.js +110 -0
  4. package/dist/{cli-2BH7FX27.js → cli-2FXZZLCL.js} +1 -1
  5. package/dist/{cli-H3J3ICCQ.js → cli-2I6UN6C3.js} +3 -3
  6. package/dist/{cli-MYJGGLC5.js → cli-2JEICVMA.js} +3 -3
  7. package/dist/{cli-7RYIEKMB.js → cli-2PMLR6WG.js} +15 -15
  8. package/dist/{cli-JRIIAZ33.js → cli-2UOUIVHW.js} +53 -38
  9. package/dist/{cli-OQG3Y4RU.js → cli-2VV5IPSY.js} +15 -15
  10. package/dist/{cli-ZRPWZOCW.js → cli-35K37SYY.js} +20 -16
  11. package/dist/cli-3I6AI4AA.js +36 -0
  12. package/dist/{cli-YSPZZQCP.js → cli-3RMP4HKZ.js} +2 -2
  13. package/dist/{cli-4UWFQNGF.js → cli-3VV2JLHX.js} +1 -1
  14. package/dist/cli-3YGNWZC6.js +30 -0
  15. package/dist/{cli-TPNQLYPC.js → cli-4L7S27XO.js} +1 -1
  16. package/dist/cli-4X3X4HB2.js +16 -0
  17. package/dist/{cli-TJ3PLRHF.js → cli-5BPQ73OM.js} +15 -15
  18. package/dist/{cli-UTM4QU67.js → cli-5PTCQTS6.js} +282 -96
  19. package/dist/{cli-ZTZ5H55T.js → cli-6COAU7JR.js} +17 -17
  20. package/dist/{cli-QVASWX2A.js → cli-6GDPO5VU.js} +2 -2
  21. package/dist/{cli-TFMNNVJ7.js → cli-6KL5B7EC.js} +15 -15
  22. package/dist/{cli-NOQBWJQN.js → cli-6Y4XIVQS.js} +3 -3
  23. package/dist/cli-6ZBQELF2.js +36 -0
  24. package/dist/{cli-MMN4BPO4.js → cli-7CW2BBJG.js} +1 -1
  25. package/dist/{cli-LQ4VSM5R.js → cli-7N7WFRWA.js} +0 -0
  26. package/dist/{cli-JR5AZLLK.js → cli-7OCEVQQN.js} +2 -2
  27. package/dist/{cli-Z5HWENER.js → cli-7RLZIWFP.js} +19 -19
  28. package/dist/{cli-J4DKUUTK.js → cli-7V6GUIIS.js} +2 -2
  29. package/dist/{cli-6ZSMW4HR.js → cli-A3P3PO6Z.js} +15 -15
  30. package/dist/{cli-4VZIJYKU.js → cli-A7PITFRR.js} +2 -2
  31. package/dist/{cli-4XCQUM3E.js → cli-AA5GMEUL.js} +4 -4
  32. package/dist/{cli-N6H6T2E2.js → cli-AEAFLZGY.js} +12 -0
  33. package/dist/{cli-C47GJATR.js → cli-AGYCXRPR.js} +3 -3
  34. package/dist/{cli-T4HWGMY4.js → cli-AJ5CABGJ.js} +15 -15
  35. package/dist/{cli-FZ7QAZZP.js → cli-B5LZEFLU.js} +15 -15
  36. package/dist/{cli-XSVGKI3R.js → cli-BC4KKNLA.js} +1 -1
  37. package/dist/{cli-EJVAQCMQ.js → cli-BF6L37O3.js} +114 -5
  38. package/dist/{cli-ZQ2Y3U7F.js → cli-BNN36WZJ.js} +13 -13
  39. package/dist/{cli-FXY3DKPW.js → cli-BT47H36C.js} +2 -2
  40. package/dist/{cli-XTANOFQR.js → cli-BV7MX7JE.js} +3 -3
  41. package/dist/{cli-PVA52RC2.js → cli-BYXNPBVG.js} +15 -15
  42. package/dist/{cli-MJUYJIEP.js → cli-C45A5VX6.js} +3 -3
  43. package/dist/{cli-HM7CD4VU.js → cli-CKV44U7P.js} +19 -19
  44. package/dist/{cli-LQERHJFE.js → cli-CL3KF5KS.js} +2 -2
  45. package/dist/{cli-SX3ULO5P.js → cli-CPX4YA3P.js} +11 -11
  46. package/dist/{cli-CV4JGVJR.js → cli-CQUSM3SF.js} +19 -19
  47. package/dist/cli-CUZUIYCQ.js +36 -0
  48. package/dist/{cli-YOTGR3NB.js → cli-CVOLMK3Z.js} +1 -1
  49. package/dist/{cli-TFZ53OA2.js → cli-D6AC3ZCX.js} +18 -18
  50. package/dist/{cli-PIO7NWMH.js → cli-DJCQ5XFR.js} +15 -15
  51. package/dist/{cli-4YB3ROVR.js → cli-DMKRP33X.js} +1 -1
  52. package/dist/cli-DNCJURUU.js +36 -0
  53. package/dist/{cli-TIDQ4WUE.js → cli-DXHPYN4N.js} +1 -1
  54. package/dist/{cli-FP32D3T6.js → cli-E77R7ZYB.js} +15 -15
  55. package/dist/{cli-PKQNOGBO.js → cli-EDZF5Q2E.js} +63 -17
  56. package/dist/{cli-IPP5FDCH.js → cli-G54355N5.js} +18 -18
  57. package/dist/{cli-SWZY7L7K.js → cli-G7JTIP5G.js} +6 -6
  58. package/dist/{cli-C5QOJJWX.js → cli-GHIMH6JU.js} +1 -1
  59. package/dist/{cli-LE5ICDAF.js → cli-GHQIATHP.js} +4 -4
  60. package/dist/{cli-ESA6YNPF.js → cli-GZE4V7RC.js} +19 -19
  61. package/dist/{cli-4CHKF4DQ.js → cli-H7T6E7OA.js} +2 -2
  62. package/dist/{cli-TDYKRXUA.js → cli-HCMVZXWK.js} +17 -17
  63. package/dist/{cli-WU43JT4T.js → cli-HJPNNORV.js} +2 -2
  64. package/dist/{cli-MYJGMA6U.js → cli-IC5FOT2J.js} +1 -1
  65. package/dist/{cli-VYR326C6.js → cli-ICLCA6VD.js} +19 -19
  66. package/dist/{cli-CXCL7VRK.js → cli-IJPRZSJ5.js} +20 -20
  67. package/dist/{cli-VL2P354N.js → cli-IVZ7AHUJ.js} +3 -3
  68. package/dist/{cli-B6YHEKIJ.js → cli-J2OTL6JH.js} +5 -5
  69. package/dist/{cli-SOMIB4B4.js → cli-J75EBRAJ.js} +17 -17
  70. package/dist/{cli-WAZD75KE.js → cli-JEMWAIAA.js} +15 -15
  71. package/dist/{cli-TDSQSCX4.js → cli-K6M6YB67.js} +1 -1
  72. package/dist/{cli-WG36UJRK.js → cli-KD2RQS35.js} +18 -18
  73. package/dist/{cli-GTWEGYSU.js → cli-KGJHEDR2.js} +19 -19
  74. package/dist/{cli-EDCAH2TC.js → cli-KINJAQTJ.js} +19 -19
  75. package/dist/cli-KJV3GGBA.js +1973 -0
  76. package/dist/{cli-X7E3637I.js → cli-KO26S2CL.js} +50 -26
  77. package/dist/{cli-MULKSLA4.js → cli-L5ZKQNMI.js} +15 -15
  78. package/dist/{cli-ATI6OLJU.js → cli-LFUKHLHI.js} +17 -17
  79. package/dist/{cli-GHLILDH7.js → cli-LZFUSEJT.js} +13 -13
  80. package/dist/{cli-RZITKPJX.js → cli-MN7X4UG2.js} +1 -1
  81. package/dist/{cli-HCRTYQQS.js → cli-MPWTXNF6.js} +2 -2
  82. package/dist/{cli-HHPMAV4F.js → cli-MSSJLABW.js} +3 -3
  83. package/dist/{cli-DHOWZCXT.js → cli-MTAGL3QE.js} +15 -15
  84. package/dist/{cli-JIZTQVL2.js → cli-MX7GFQ6N.js} +14 -14
  85. package/dist/{cli-7TOLC62D.js → cli-MYBDWJP7.js} +20 -20
  86. package/dist/{cli-VPON5HGB.js → cli-MZM4MW7C.js} +19 -19
  87. package/dist/{cli-UBQCSUDH.js → cli-NTI22MRE.js} +16 -16
  88. package/dist/{cli-ZTWOE3ZT.js → cli-NU4SCD5D.js} +1 -1
  89. package/dist/{cli-DEBCP7UH.js → cli-OK6XWVIN.js} +17 -17
  90. package/dist/{cli-6HB6HTC6.js → cli-OOTGO3KW.js} +47 -47
  91. package/dist/{cli-2DQJACAH.js → cli-OX3254NS.js} +17 -17
  92. package/dist/{cli-GEQUJF4L.js → cli-PJO4BKSV.js} +16 -16
  93. package/dist/{cli-R7RG2VMW.js → cli-QIHVXDMW.js} +15 -15
  94. package/dist/{cli-57V4ARER.js → cli-QK2OD24J.js} +1 -1
  95. package/dist/{cli-OANH3BTQ.js → cli-QRAYIXNE.js} +5 -5
  96. package/dist/{cli-GPAN6XK2.js → cli-QWO3XJR3.js} +4 -4
  97. package/dist/{cli-JRMHSMYT.js → cli-R6YAZP6E.js} +19 -19
  98. package/dist/{cli-FXWWYBYU.js → cli-RHYQYXE2.js} +18 -18
  99. package/dist/{cli-C3OERMIR.js → cli-RL5EBZL7.js} +3 -3
  100. package/dist/{cli-XR2XSWQN.js → cli-S3YIYAXC.js} +12 -12
  101. package/dist/{cli-NPPY557S.js → cli-S7PLSPGE.js} +15 -15
  102. package/dist/{cli-NEOLMC2P.js → cli-SBKTGFY4.js} +17 -17
  103. package/dist/{cli-BOXXMDSX.js → cli-TLRTLTGK.js} +18 -18
  104. package/dist/cli-UKC7KXWU.js +36 -0
  105. package/dist/{cli-FWFRKQNE.js → cli-UR63LFVK.js} +2 -2
  106. package/dist/{cli-ZKG3OPZ6.js → cli-USBJQAYI.js} +13 -13
  107. package/dist/{cli-M7WEAIRF.js → cli-VRGVHSXH.js} +106 -28
  108. package/dist/{cli-IUS2YCD3.js → cli-VTLFQHDO.js} +1 -1
  109. package/dist/{cli-JGFJWZFU.js → cli-W4BHSBAX.js} +3 -3
  110. package/dist/cli-WA2PDQUB.js +36 -0
  111. package/dist/{cli-HYEU3QS6.js → cli-WJO75KP7.js} +3 -3
  112. package/dist/{cli-3PIJLSRQ.js → cli-XA4IL7IM.js} +11 -11
  113. package/dist/{cli-LRQDF3ZO.js → cli-XRVH5WV6.js} +13 -13
  114. package/dist/{cli-SRHBXZCN.js → cli-Y33ULHYO.js} +1 -1
  115. package/dist/{cli-G5DQGZ2E.js → cli-YD4SBAHQ.js} +19 -19
  116. package/dist/{cli-64AA7367.js → cli-YI3WZF3C.js} +11 -11
  117. package/dist/{cli-JPAXKLVT.js → cli-ZHFHOWJI.js} +11 -11
  118. package/dist/{cli-MM3A4SPH.js → cli-ZZSPFLTK.js} +7265 -4467
  119. package/dist/cli.js +52 -52
  120. package/dist/client.js +17518 -16558
  121. package/dist/core/save-scenario.d.ts +1 -0
  122. package/dist/core/session-start-gate.d.ts +25 -0
  123. package/dist/core/session.d.ts +4 -0
  124. package/dist/dev/console/assets/{index-CnXlPeLX.js → index-CVNjiRUh.js} +31 -27
  125. package/dist/dev/console/index.html +1 -1
  126. package/dist/docs/api/deck.md +1 -1
  127. package/dist/docs/api/index.md +1 -1
  128. package/dist/docs/api/sdk-e2e.md +7 -6
  129. package/dist/docs/api/sdk-projection.md +1 -0
  130. package/dist/docs/api/sdk-tools-client.md +3 -1
  131. package/dist/docs/api/sdk-tools-playwright.md +1 -8
  132. package/dist/docs/api/sdk-ui.md +40 -64
  133. package/dist/docs/api/sdk.md +10 -1
  134. package/dist/docs/changelog.md +25 -0
  135. package/dist/docs/cli-error-codes.md +7 -1
  136. package/dist/docs/cli-reference.md +3 -0
  137. package/dist/docs/concepts/index.md +1 -0
  138. package/dist/docs/guides/engine.md +5 -0
  139. package/dist/docs/guides/file-handling.md +4 -1
  140. package/dist/docs/guides/llm-integration.md +3 -2
  141. package/dist/docs/guides/multi-team-games.md +2 -0
  142. package/dist/docs/guides/patterns.md +5 -0
  143. package/dist/docs/guides/session.md +1 -1
  144. package/dist/docs/guides/settings.md +2 -0
  145. package/dist/docs/guides/setup.md +67 -6
  146. package/dist/docs/guides/speech-generation.md +1 -0
  147. package/dist/docs/guides/testing.md +2 -0
  148. package/dist/docs/guides/tick-controller.md +2 -0
  149. package/dist/docs/guides/type-safety.md +2 -1
  150. package/dist/docs/guides/ui-files-and-llms.md +3 -1
  151. package/dist/docs/guides/upgrading.md +4 -0
  152. package/dist/docs/guides/validators.md +27 -4
  153. package/dist/docs/guides/waiting-room.md +2 -0
  154. package/dist/docs/page-index.md +10 -7
  155. package/dist/docs/recipes/call-endpoint-from-ui.md +1 -0
  156. package/dist/docs/recipes/create-scenario-editor.md +2 -1
  157. package/dist/docs/recipes/create-setup.md +19 -10
  158. package/dist/docs/recipes/declare-api-uses.md +1 -0
  159. package/dist/docs/recipes/describe-setup-with-endpoint.md +69 -0
  160. package/dist/docs/recipes/give-setup-a-menu.md +90 -0
  161. package/dist/docs/recipes/index.md +4 -1
  162. package/dist/docs/recipes/share-logic-between-engine-and-ui.md +2 -2
  163. package/dist/docs/recipes/test-user-interface.md +1 -1
  164. package/dist/docs/recipes/validate-scenarios.md +9 -3
  165. package/dist/docs/recipes/write-setup-notes.md +57 -0
  166. package/dist/docs/troubleshooting.md +2 -1
  167. package/dist/execution/executor.d.ts +12 -0
  168. package/dist/execution/scenario-gates.d.ts +40 -0
  169. package/dist/host.js +1082 -467
  170. package/dist/playwright.js +17529 -16569
  171. package/dist/runtime/manifest-version.d.ts +1 -1
  172. package/dist/runtime.js +4 -2
  173. package/dist/setup/setup-notes.d.ts +42 -0
  174. package/dist/templates/package/package.json.liquid +15 -15
  175. package/dist/templates/starter-game/package.json +13 -13
  176. package/dist/utils/error-codes.d.ts +13 -1
  177. package/dist/validation/package-validation.d.ts +1 -1
  178. package/package.json +22 -23
  179. package/dist/cli-57C72YKJ.js +0 -36
  180. package/dist/cli-5G7TZHD3.js +0 -36
  181. package/dist/cli-7MBLH4M3.js +0 -36
  182. package/dist/cli-C6G65H6S.js +0 -256
  183. package/dist/cli-L5IG7MY2.js +0 -36
  184. package/dist/cli-SPGUVL6Z.js +0 -36
  185. package/dist/cli-UY4VDI7W.js +0 -30
  186. package/dist/cli-WM6SQJ6Q.js +0 -16
  187. package/dist/cli-ZBTFLZUL.js +0 -36
  188. package/dist/cli-ZF7IFB54.js +0 -4026
@@ -198,6 +198,7 @@ Every logic function is async, takes one args object, and returns what it writes
198
198
 
199
199
  ```typescript
200
200
  import type { InitializationFunction, RunFunction } from '@seriousgaming/sdk';
201
+
201
202
  import type { Context, Settings } from './types';
202
203
 
203
204
  export const Init: InitializationFunction<Context, Settings> = async ({ context, settings }) => ({
@@ -2,36 +2,36 @@
2
2
  import {
3
3
  deleteTickControllerFiles,
4
4
  findTickControllerReferences
5
- } from "./cli-LE5ICDAF.js";
6
- import "./cli-IUS2YCD3.js";
5
+ } from "./cli-GHQIATHP.js";
6
+ import "./cli-VTLFQHDO.js";
7
7
  import "./cli-QUNIRH7A.js";
8
- import "./cli-YSPZZQCP.js";
8
+ import "./cli-3RMP4HKZ.js";
9
9
  import {
10
10
  loadPackageContext
11
- } from "./cli-XSVGKI3R.js";
12
- import "./cli-FXY3DKPW.js";
13
- import "./cli-57V4ARER.js";
11
+ } from "./cli-BC4KKNLA.js";
12
+ import "./cli-BT47H36C.js";
13
+ import "./cli-QK2OD24J.js";
14
14
  import {
15
15
  operationError,
16
16
  recordOperationResult
17
- } from "./cli-JGFJWZFU.js";
17
+ } from "./cli-W4BHSBAX.js";
18
18
  import {
19
19
  confirmAction
20
- } from "./cli-ZTWOE3ZT.js";
20
+ } from "./cli-NU4SCD5D.js";
21
21
  import {
22
22
  generateCommand
23
- } from "./cli-H3J3ICCQ.js";
24
- import "./cli-SWZY7L7K.js";
25
- import "./cli-C6G65H6S.js";
26
- import "./cli-UTM4QU67.js";
23
+ } from "./cli-2I6UN6C3.js";
24
+ import "./cli-G7JTIP5G.js";
25
+ import "./cli-2CSI2UU2.js";
26
+ import "./cli-5PTCQTS6.js";
27
27
  import "./cli-25RWY5BQ.js";
28
28
  import "./cli-QWQMPCL6.js";
29
- import "./cli-ZF7IFB54.js";
29
+ import "./cli-ZZSPFLTK.js";
30
30
  import "./cli-F2D4GGUA.js";
31
31
  import {
32
32
  logger
33
- } from "./cli-4YB3ROVR.js";
34
- import "./cli-N6H6T2E2.js";
33
+ } from "./cli-DMKRP33X.js";
34
+ import "./cli-AEAFLZGY.js";
35
35
 
36
36
  // cli/commands/resources/tick-controller/delete.ts
37
37
  async function deleteTickController(options) {
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ getPluralResourceMeta
4
+ } from "./cli-ZZSPFLTK.js";
5
+
6
+ // cli/generation/ts-type.ts
7
+ import { existsSync, readFileSync, statSync } from "fs";
8
+ import { dirname, isAbsolute, join, relative, resolve, sep } from "path";
9
+ var RELATIVE_IMPORT = /import\((['"])(\.{1,2}\/[^'"]+)\1\)/g;
10
+ var ABSOLUTE_IMPORT = /import\((['"])(\/[^'"]+|[A-Za-z]:[\\/][^'"]+)\1\)/g;
11
+ var NAMED_IMPORT = /import\((['"])([^'"]+)\1\)\.([A-Za-z_$][\w$]*)/g;
12
+ var MODULE_EXTENSIONS = [".ts", ".tsx", ".d.ts", "/index.ts", "/index.tsx"];
13
+ function capabilityDirectory(workingDir, identifier) {
14
+ return join(workingDir, getPluralResourceMeta("capability").pluralDir, identifier);
15
+ }
16
+ function mapTsTypes(schema, rewrite) {
17
+ if (Array.isArray(schema)) return schema.map((item) => mapTsTypes(item, rewrite));
18
+ if (schema === null || typeof schema !== "object") return schema;
19
+ return Object.fromEntries(
20
+ Object.entries(schema).map(([key, value]) => [
21
+ key,
22
+ key === "tsType" && typeof value === "string" ? rewrite(value) : mapTsTypes(value, rewrite)
23
+ ])
24
+ );
25
+ }
26
+ function collectTsTypes(schema, into = []) {
27
+ if (Array.isArray(schema)) {
28
+ for (const item of schema) collectTsTypes(item, into);
29
+ } else if (schema !== null && typeof schema === "object") {
30
+ for (const [key, value] of Object.entries(schema)) {
31
+ if (key === "tsType" && typeof value === "string") into.push(value);
32
+ else collectTsTypes(value, into);
33
+ }
34
+ }
35
+ return into;
36
+ }
37
+ function absolutiseTsTypes(capabilities, workingDir) {
38
+ return capabilities.map((capability) => {
39
+ const schema = capability.definition.variablesSchema;
40
+ if (collectTsTypes(schema).length === 0) return capability;
41
+ const base = capabilityDirectory(workingDir, capability.definition.identifier);
42
+ return {
43
+ ...capability,
44
+ definition: {
45
+ ...capability.definition,
46
+ variablesSchema: mapTsTypes(
47
+ schema,
48
+ (tsType) => tsType.replace(
49
+ RELATIVE_IMPORT,
50
+ (_match, quote, path) => `import(${quote}${resolve(base, path)}${quote})`
51
+ )
52
+ )
53
+ }
54
+ };
55
+ });
56
+ }
57
+ function relativiseTsTypes(schema, outputPath) {
58
+ const from = dirname(outputPath);
59
+ return mapTsTypes(
60
+ schema,
61
+ (tsType) => tsType.replace(ABSOLUTE_IMPORT, (_match, quote, path) => {
62
+ let rel = relative(from, path).split(sep).join("/");
63
+ if (!rel.startsWith(".")) rel = `./${rel}`;
64
+ return `import(${quote}${rel}${quote})`;
65
+ })
66
+ );
67
+ }
68
+ function validateTsTypes(capabilities, workingDir) {
69
+ const errors = [];
70
+ for (const capability of capabilities) {
71
+ const { identifier } = capability.definition;
72
+ const base = capabilityDirectory(workingDir, identifier);
73
+ for (const tsType of collectTsTypes(capability.definition.variablesSchema)) {
74
+ for (const match of tsType.matchAll(NAMED_IMPORT)) {
75
+ const [, , specifier, name] = match;
76
+ if (!specifier.startsWith(".") && !isAbsolute(specifier)) continue;
77
+ const target = resolve(base, specifier);
78
+ const file = [target, ...MODULE_EXTENSIONS.map((ext) => `${target}${ext}`)].find(
79
+ (candidate) => existsSync(candidate) && statSync(candidate).isFile()
80
+ );
81
+ if (!file) {
82
+ errors.push(
83
+ `Capability "${identifier}" has tsType "${tsType}", but "${specifier}" resolves to no module from ${relative(workingDir, base) || "."}. A tsType path is relative to the capability's own directory.`
84
+ );
85
+ continue;
86
+ }
87
+ if (!exportsName(readFileSync(file, "utf-8"), name)) {
88
+ errors.push(
89
+ `Capability "${identifier}" has tsType "${tsType}", but ${relative(workingDir, file)} does not export "${name}".`
90
+ );
91
+ }
92
+ }
93
+ }
94
+ }
95
+ return errors;
96
+ }
97
+ function exportsName(source, name) {
98
+ const escaped = name.replace(/[$]/g, "\\$");
99
+ const declared = new RegExp(
100
+ `export\\s+(?:declare\\s+)?(?:interface|type|class|enum|const|let|var|function|abstract\\s+class)\\s+${escaped}\\b`
101
+ );
102
+ const listed = new RegExp(`export\\s+(?:type\\s+)?\\{[^}]*\\b${escaped}\\b[^}]*\\}`);
103
+ return declared.test(source) || listed.test(source) || /export\s+\*\s+from/.test(source);
104
+ }
105
+
106
+ export {
107
+ absolutiseTsTypes,
108
+ relativiseTsTypes,
109
+ validateTsTypes
110
+ };
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  CliError,
8
8
  reportResult
9
- } from "./cli-N6H6T2E2.js";
9
+ } from "./cli-AEAFLZGY.js";
10
10
 
11
11
  // cli/commands/blob.ts
12
12
  import { existsSync } from "fs";
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  generateAllTypes
4
- } from "./cli-SWZY7L7K.js";
4
+ } from "./cli-G7JTIP5G.js";
5
5
  import {
6
6
  loadConfig
7
- } from "./cli-ZF7IFB54.js";
7
+ } from "./cli-ZZSPFLTK.js";
8
8
  import {
9
9
  logger
10
- } from "./cli-4YB3ROVR.js";
10
+ } from "./cli-DMKRP33X.js";
11
11
 
12
12
  // cli/commands/generate.ts
13
13
  import { resolve } from "path";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveSession
4
- } from "./cli-OANH3BTQ.js";
4
+ } from "./cli-QRAYIXNE.js";
5
5
  import {
6
6
  emit,
7
7
  participantsFromArgument,
@@ -11,13 +11,13 @@ import {
11
11
  teamCountFromFlag,
12
12
  teamIndexFromArgument,
13
13
  tickReport
14
- } from "./cli-GPAN6XK2.js";
14
+ } from "./cli-QWO3XJR3.js";
15
15
  import {
16
16
  applyJsonPatch
17
17
  } from "./cli-S5IVGDDD.js";
18
18
  import {
19
19
  CliError
20
- } from "./cli-N6H6T2E2.js";
20
+ } from "./cli-AEAFLZGY.js";
21
21
 
22
22
  // cli/commands/tick.ts
23
23
  import dotenv from "dotenv";
@@ -2,35 +2,35 @@
2
2
  import {
3
3
  deleteEngineFiles,
4
4
  findEngineReferences
5
- } from "./cli-LE5ICDAF.js";
6
- import "./cli-IUS2YCD3.js";
5
+ } from "./cli-GHQIATHP.js";
6
+ import "./cli-VTLFQHDO.js";
7
7
  import "./cli-QUNIRH7A.js";
8
- import "./cli-YSPZZQCP.js";
8
+ import "./cli-3RMP4HKZ.js";
9
9
  import {
10
10
  loadPackageContext
11
- } from "./cli-XSVGKI3R.js";
12
- import "./cli-FXY3DKPW.js";
13
- import "./cli-57V4ARER.js";
11
+ } from "./cli-BC4KKNLA.js";
12
+ import "./cli-BT47H36C.js";
13
+ import "./cli-QK2OD24J.js";
14
14
  import {
15
15
  operationError,
16
16
  recordOperationResult,
17
17
  regenerateTypes
18
- } from "./cli-JGFJWZFU.js";
18
+ } from "./cli-W4BHSBAX.js";
19
19
  import {
20
20
  confirmAction
21
- } from "./cli-ZTWOE3ZT.js";
22
- import "./cli-H3J3ICCQ.js";
23
- import "./cli-SWZY7L7K.js";
24
- import "./cli-C6G65H6S.js";
25
- import "./cli-UTM4QU67.js";
21
+ } from "./cli-NU4SCD5D.js";
22
+ import "./cli-2I6UN6C3.js";
23
+ import "./cli-G7JTIP5G.js";
24
+ import "./cli-2CSI2UU2.js";
25
+ import "./cli-5PTCQTS6.js";
26
26
  import "./cli-25RWY5BQ.js";
27
27
  import "./cli-QWQMPCL6.js";
28
- import "./cli-ZF7IFB54.js";
28
+ import "./cli-ZZSPFLTK.js";
29
29
  import "./cli-F2D4GGUA.js";
30
30
  import {
31
31
  logger
32
- } from "./cli-4YB3ROVR.js";
33
- import "./cli-N6H6T2E2.js";
32
+ } from "./cli-DMKRP33X.js";
33
+ import "./cli-AEAFLZGY.js";
34
34
 
35
35
  // cli/commands/resources/engine/delete.ts
36
36
  async function deleteEngine(options) {
@@ -1,49 +1,50 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  validatePackage
4
- } from "./cli-M7WEAIRF.js";
4
+ } from "./cli-VRGVHSXH.js";
5
5
  import "./cli-ILKCQNM6.js";
6
- import "./cli-TPNQLYPC.js";
7
- import "./cli-MM3A4SPH.js";
6
+ import "./cli-4L7S27XO.js";
7
+ import "./cli-KJV3GGBA.js";
8
8
  import "./cli-4LKXZQ2B.js";
9
9
  import {
10
10
  readSdkToolsVersion
11
- } from "./cli-IUS2YCD3.js";
11
+ } from "./cli-VTLFQHDO.js";
12
12
  import {
13
13
  distPath
14
- } from "./cli-57V4ARER.js";
14
+ } from "./cli-QK2OD24J.js";
15
15
  import {
16
16
  generateAllTypes
17
- } from "./cli-SWZY7L7K.js";
18
- import "./cli-C6G65H6S.js";
19
- import "./cli-UTM4QU67.js";
17
+ } from "./cli-G7JTIP5G.js";
18
+ import "./cli-2CSI2UU2.js";
19
+ import "./cli-5PTCQTS6.js";
20
20
  import "./cli-25RWY5BQ.js";
21
21
  import "./cli-QWQMPCL6.js";
22
22
  import {
23
23
  LOGIC_NODE_BUILTIN,
24
24
  MANIFEST_VERSION,
25
+ SETUP_NOTES_DIRECTORY,
25
26
  SPEC_REVISION,
26
27
  Transpile,
27
28
  getResourceMeta,
28
29
  loadConfig
29
- } from "./cli-ZF7IFB54.js";
30
+ } from "./cli-ZZSPFLTK.js";
30
31
  import "./cli-F2D4GGUA.js";
31
32
  import {
32
33
  getVerboseMode,
33
34
  logger
34
- } from "./cli-4YB3ROVR.js";
35
+ } from "./cli-DMKRP33X.js";
35
36
  import {
36
37
  CliError,
37
38
  diagnosticLocation,
38
39
  isJsonOutput,
39
40
  recordDiagnostic,
40
41
  reportResult
41
- } from "./cli-N6H6T2E2.js";
42
+ } from "./cli-AEAFLZGY.js";
42
43
 
43
44
  // cli/commands/build.ts
44
- import { existsSync as existsSync3 } from "fs";
45
- import { cp as cp3, mkdir as mkdir8, rm, writeFile as writeFile6 } from "fs/promises";
46
- import { resolve as resolve7, join as join9, sep } from "path";
45
+ import { existsSync as existsSync4 } from "fs";
46
+ import { cp as cp4, mkdir as mkdir8, rm, writeFile as writeFile6 } from "fs/promises";
47
+ import { resolve as resolve7, join as join10, sep } from "path";
47
48
 
48
49
  // cli/bundling/endpoint-bundler.ts
49
50
  import { mkdir, writeFile } from "fs/promises";
@@ -201,13 +202,29 @@ async function bundleScenario(scenario, workingDir, buildDir) {
201
202
  }
202
203
  }
203
204
 
205
+ // cli/bundling/setup-notes-bundler.ts
206
+ import { existsSync as existsSync3 } from "fs";
207
+ import { cp as cp3 } from "fs/promises";
208
+ import { join as join6 } from "path";
209
+ async function bundleSetupNotes(setup, workingDir, buildDir) {
210
+ const source = join6(workingDir, setup.rootDirectory, SETUP_NOTES_DIRECTORY);
211
+ if (!existsSync3(source)) return;
212
+ const output = join6(
213
+ buildDir,
214
+ distPath(getResourceMeta("setup"), "setup"),
215
+ SETUP_NOTES_DIRECTORY
216
+ );
217
+ await cp3(source, output, { recursive: true });
218
+ logger.debug(` Copied setup notes -> ${output}`);
219
+ }
220
+
204
221
  // cli/bundling/tick-controller-bundler.ts
205
222
  import { mkdir as mkdir6, writeFile as writeFile4 } from "fs/promises";
206
- import { join as join6, resolve as resolve4 } from "path";
223
+ import { join as join7, resolve as resolve4 } from "path";
207
224
  async function bundleTickController(tickController, workingDir, buildDir) {
208
225
  logger.debug(`Bundling ${tickController.definition.identifier}...`);
209
- const tickControllerSourceDir = join6(workingDir, tickController.rootDirectory);
210
- const tickControllerOutputDir = join6(
226
+ const tickControllerSourceDir = join7(workingDir, tickController.rootDirectory);
227
+ const tickControllerOutputDir = join7(
211
228
  buildDir,
212
229
  distPath(getResourceMeta("tick_controller"), tickController.definition.identifier)
213
230
  );
@@ -228,9 +245,9 @@ async function bundleTickController(tickController, workingDir, buildDir) {
228
245
  entrypoint: logicEntrypoint,
229
246
  packageRoot: workingDir
230
247
  });
231
- const logicOutputDir = join6(tickControllerOutputDir, tickController.logic.directory);
248
+ const logicOutputDir = join7(tickControllerOutputDir, tickController.logic.directory);
232
249
  await mkdir6(logicOutputDir, { recursive: true });
233
- const outputPath = join6(logicOutputDir, "logic.js");
250
+ const outputPath = join7(logicOutputDir, "logic.js");
234
251
  await writeFile4(outputPath, bundledCode, "utf-8");
235
252
  logger.debug(` Bundled ${logicEntrypoint} -> ${outputPath}`);
236
253
  } finally {
@@ -241,12 +258,12 @@ async function bundleTickController(tickController, workingDir, buildDir) {
241
258
 
242
259
  // cli/bundling/ui-bundler.ts
243
260
  import { realpathSync } from "fs";
244
- import { join as join7, resolve as resolve5 } from "path";
261
+ import { join as join8, resolve as resolve5 } from "path";
245
262
  import react from "@vitejs/plugin-react";
246
263
  import { build, loadConfigFromFile, mergeConfig } from "vite";
247
264
  async function bundleUserInterface(ui, workingDir, buildDir, type) {
248
- const uiOutputDir = join7(buildDir, distPath(getResourceMeta(type), ui.definition.identifier));
249
- const uiRootDir = join7(workingDir, ui.rootDirectory);
265
+ const uiOutputDir = join8(buildDir, distPath(getResourceMeta(type), ui.definition.identifier));
266
+ const uiRootDir = join8(workingDir, ui.rootDirectory);
250
267
  const uiDir = realpathSync(uiRootDir);
251
268
  logger.debug(`Building ${ui.definition.identifier}...`);
252
269
  const isVerbose = getVerboseMode();
@@ -297,11 +314,11 @@ async function bundleUserInterface(ui, workingDir, buildDir, type) {
297
314
 
298
315
  // cli/bundling/validator-bundler.ts
299
316
  import { mkdir as mkdir7, writeFile as writeFile5 } from "fs/promises";
300
- import { join as join8, resolve as resolve6 } from "path";
317
+ import { join as join9, resolve as resolve6 } from "path";
301
318
  async function bundleValidator(validator, workingDir, buildDir) {
302
319
  logger.debug(`Bundling ${validator.definition.identifier}...`);
303
- const validatorSourceDir = join8(workingDir, validator.rootDirectory);
304
- const validatorOutputDir = join8(
320
+ const validatorSourceDir = join9(workingDir, validator.rootDirectory);
321
+ const validatorOutputDir = join9(
305
322
  buildDir,
306
323
  distPath(getResourceMeta("validator"), validator.definition.identifier)
307
324
  );
@@ -322,9 +339,9 @@ async function bundleValidator(validator, workingDir, buildDir) {
322
339
  entrypoint: logicEntrypoint,
323
340
  packageRoot: workingDir
324
341
  });
325
- const logicOutputDir = join8(validatorOutputDir, validator.logic.directory);
342
+ const logicOutputDir = join9(validatorOutputDir, validator.logic.directory);
326
343
  await mkdir7(logicOutputDir, { recursive: true });
327
- const outputPath = join8(logicOutputDir, "logic.js");
344
+ const outputPath = join9(logicOutputDir, "logic.js");
328
345
  await writeFile5(outputPath, bundledCode, "utf-8");
329
346
  logger.debug(` Bundled ${logicEntrypoint} -> ${outputPath}`);
330
347
  } finally {
@@ -496,12 +513,10 @@ async function buildCommand(options) {
496
513
  userInterfaces,
497
514
  (r) => bundleUserInterface(r, wd, buildDir, "ui")
498
515
  ),
499
- bundleStep(
500
- scaffoldDir("setup"),
501
- "the setup user interface",
502
- setupBuild,
503
- (r) => bundleUserInterface(r, wd, buildDir, "setup")
504
- ),
516
+ bundleStep(scaffoldDir("setup"), "the setup user interface", setupBuild, async (r) => {
517
+ await bundleUserInterface(r, wd, buildDir, "setup");
518
+ await bundleSetupNotes(r, wd, buildDir);
519
+ }),
505
520
  bundleStep(
506
521
  scaffoldDir("scenario_editor"),
507
522
  "the scenario editor",
@@ -559,7 +574,7 @@ async function buildCommand(options) {
559
574
  )
560
575
  ];
561
576
  for (const step of bundleSteps.filter((step2) => step2.hasContent)) {
562
- await mkdir8(join9(buildDir, step.subdir), { recursive: true });
577
+ await mkdir8(join10(buildDir, step.subdir), { recursive: true });
563
578
  }
564
579
  logger.debug(` Created ${buildDir}`);
565
580
  logger.newline();
@@ -567,10 +582,10 @@ async function buildCommand(options) {
567
582
  await step.run();
568
583
  }
569
584
  const sharedAssetsSource = resolve7(options.workingDir, "shared-assets");
570
- if (existsSync3(sharedAssetsSource)) {
585
+ if (existsSync4(sharedAssetsSource)) {
571
586
  logger.section("Step 5: Copying shared assets...");
572
- const sharedAssetsOutput = join9(buildDir, "shared-assets");
573
- await cp3(sharedAssetsSource, sharedAssetsOutput, { recursive: true });
587
+ const sharedAssetsOutput = join10(buildDir, "shared-assets");
588
+ await cp4(sharedAssetsSource, sharedAssetsOutput, { recursive: true });
574
589
  logger.debug(` Copied shared-assets -> ${sharedAssetsOutput}`);
575
590
  logger.newline();
576
591
  }
@@ -602,7 +617,7 @@ async function buildCommand(options) {
602
617
  validators: validators.map(logicBundle),
603
618
  endpoints: endpoints.map(logicBundle)
604
619
  };
605
- const configOutputPath = join9(buildDir, "seriousgaming.json");
620
+ const configOutputPath = join10(buildDir, "seriousgaming.json");
606
621
  await writeFile6(configOutputPath, JSON.stringify(configuration, null, 4), "utf-8");
607
622
  logger.debug(` Generated ${configOutputPath}`);
608
623
  logger.success("Build complete!");
@@ -2,35 +2,35 @@
2
2
  import {
3
3
  deleteUserInterfaceFiles,
4
4
  findUserInterfaceReferences
5
- } from "./cli-LE5ICDAF.js";
6
- import "./cli-IUS2YCD3.js";
5
+ } from "./cli-GHQIATHP.js";
6
+ import "./cli-VTLFQHDO.js";
7
7
  import "./cli-QUNIRH7A.js";
8
- import "./cli-YSPZZQCP.js";
8
+ import "./cli-3RMP4HKZ.js";
9
9
  import {
10
10
  loadPackageContext
11
- } from "./cli-XSVGKI3R.js";
12
- import "./cli-FXY3DKPW.js";
13
- import "./cli-57V4ARER.js";
11
+ } from "./cli-BC4KKNLA.js";
12
+ import "./cli-BT47H36C.js";
13
+ import "./cli-QK2OD24J.js";
14
14
  import {
15
15
  operationError,
16
16
  recordOperationResult,
17
17
  regenerateTypes
18
- } from "./cli-JGFJWZFU.js";
18
+ } from "./cli-W4BHSBAX.js";
19
19
  import {
20
20
  confirmAction
21
- } from "./cli-ZTWOE3ZT.js";
22
- import "./cli-H3J3ICCQ.js";
23
- import "./cli-SWZY7L7K.js";
24
- import "./cli-C6G65H6S.js";
25
- import "./cli-UTM4QU67.js";
21
+ } from "./cli-NU4SCD5D.js";
22
+ import "./cli-2I6UN6C3.js";
23
+ import "./cli-G7JTIP5G.js";
24
+ import "./cli-2CSI2UU2.js";
25
+ import "./cli-5PTCQTS6.js";
26
26
  import "./cli-25RWY5BQ.js";
27
27
  import "./cli-QWQMPCL6.js";
28
- import "./cli-ZF7IFB54.js";
28
+ import "./cli-ZZSPFLTK.js";
29
29
  import "./cli-F2D4GGUA.js";
30
30
  import {
31
31
  logger
32
- } from "./cli-4YB3ROVR.js";
33
- import "./cli-N6H6T2E2.js";
32
+ } from "./cli-DMKRP33X.js";
33
+ import "./cli-AEAFLZGY.js";
34
34
 
35
35
  // cli/commands/resources/ui/delete.ts
36
36
  async function deleteUserInterface(options) {
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveSession
4
- } from "./cli-OANH3BTQ.js";
5
- import "./cli-WU43JT4T.js";
4
+ } from "./cli-QRAYIXNE.js";
5
+ import "./cli-HJPNNORV.js";
6
6
  import {
7
7
  emit,
8
8
  participantsFromArgument,
@@ -10,31 +10,31 @@ import {
10
10
  teamIndexFromArgument,
11
11
  tickReport,
12
12
  wholeNumberFromFlag
13
- } from "./cli-GPAN6XK2.js";
14
- import "./cli-LQ4VSM5R.js";
13
+ } from "./cli-QWO3XJR3.js";
14
+ import "./cli-7N7WFRWA.js";
15
15
  import {
16
16
  IDLE_TIMER
17
- } from "./cli-EJVAQCMQ.js";
18
- import "./cli-TDSQSCX4.js";
19
- import "./cli-SRHBXZCN.js";
20
- import "./cli-MM3A4SPH.js";
17
+ } from "./cli-BF6L37O3.js";
18
+ import "./cli-K6M6YB67.js";
19
+ import "./cli-Y33ULHYO.js";
20
+ import "./cli-KJV3GGBA.js";
21
21
  import "./cli-4LKXZQ2B.js";
22
- import "./cli-MMN4BPO4.js";
22
+ import "./cli-7CW2BBJG.js";
23
23
  import "./cli-QUNIRH7A.js";
24
24
  import {
25
25
  loadPackageContext
26
- } from "./cli-XSVGKI3R.js";
27
- import "./cli-UTM4QU67.js";
26
+ } from "./cli-BC4KKNLA.js";
27
+ import "./cli-5PTCQTS6.js";
28
28
  import "./cli-25RWY5BQ.js";
29
29
  import "./cli-QWQMPCL6.js";
30
30
  import {
31
31
  loadConfig
32
- } from "./cli-ZF7IFB54.js";
32
+ } from "./cli-ZZSPFLTK.js";
33
33
  import "./cli-F2D4GGUA.js";
34
- import "./cli-4YB3ROVR.js";
34
+ import "./cli-DMKRP33X.js";
35
35
  import {
36
36
  CliError
37
- } from "./cli-N6H6T2E2.js";
37
+ } from "./cli-AEAFLZGY.js";
38
38
 
39
39
  // cli/commands/session.ts
40
40
  import { resolve } from "path";
@@ -69,14 +69,18 @@ async function undoCommand(options) {
69
69
  async function playCommand(options) {
70
70
  await withSession(options, async (session) => {
71
71
  const before = await session.state();
72
+ let warnings = [];
72
73
  if (before.session.inSetup) {
73
- raiseIfRefused(await session.send({ type: "play" }));
74
+ const result = await session.send({ type: "play" });
75
+ raiseIfRefused(result);
76
+ if ("ok" in result && result.ok) warnings = result.warnings ?? [];
74
77
  }
75
78
  const after = await session.state();
76
79
  emit({
77
80
  started: before.session.inSetup,
78
81
  ...tickReport(after),
79
- settings: after.settings
82
+ settings: after.settings,
83
+ ...warnings.length > 0 ? { warnings } : {}
80
84
  });
81
85
  });
82
86
  }
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ deleteSettingsEditor
4
+ } from "./cli-S3YIYAXC.js";
5
+ import "./cli-BV7MX7JE.js";
6
+ import "./cli-A7PITFRR.js";
7
+ import "./cli-S5IVGDDD.js";
8
+ import "./cli-7OCEVQQN.js";
9
+ import "./cli-3VV2JLHX.js";
10
+ import "./cli-GHQIATHP.js";
11
+ import "./cli-VTLFQHDO.js";
12
+ import "./cli-QUNIRH7A.js";
13
+ import "./cli-3RMP4HKZ.js";
14
+ import "./cli-BC4KKNLA.js";
15
+ import "./cli-BT47H36C.js";
16
+ import "./cli-QK2OD24J.js";
17
+ import "./cli-W4BHSBAX.js";
18
+ import "./cli-NU4SCD5D.js";
19
+ import "./cli-2I6UN6C3.js";
20
+ import "./cli-G7JTIP5G.js";
21
+ import "./cli-2CSI2UU2.js";
22
+ import "./cli-5PTCQTS6.js";
23
+ import "./cli-25RWY5BQ.js";
24
+ import "./cli-QWQMPCL6.js";
25
+ import "./cli-ZZSPFLTK.js";
26
+ import "./cli-F2D4GGUA.js";
27
+ import "./cli-DMKRP33X.js";
28
+ import "./cli-AEAFLZGY.js";
29
+
30
+ // cli/commands/resources/setup/delete.ts
31
+ function deleteSetup(options) {
32
+ return deleteSettingsEditor("setup", options);
33
+ }
34
+ export {
35
+ deleteSetup
36
+ };
@@ -4,10 +4,10 @@ import {
4
4
  deleteResourceFiles,
5
5
  findResourceReferences,
6
6
  updateResourceFiles
7
- } from "./cli-FXY3DKPW.js";
7
+ } from "./cli-BT47H36C.js";
8
8
  import {
9
9
  getResourceMeta
10
- } from "./cli-ZF7IFB54.js";
10
+ } from "./cli-ZZSPFLTK.js";
11
11
 
12
12
  // cli/templating/scenario.ts
13
13
  var scenarioMeta = getResourceMeta("scenario");
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CliError
4
- } from "./cli-N6H6T2E2.js";
4
+ } from "./cli-AEAFLZGY.js";
5
5
 
6
6
  // cli/utils/input-source.ts
7
7
  import { readFileSync } from "fs";