@seriousgaming/sdk-tools 1.9.0 → 1.11.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 (178) hide show
  1. package/dist/agent/guidance.md +31 -23
  2. package/dist/{cli-KJV3GGBA.js → cli-226ZJ72R.js} +1 -1
  3. package/dist/{cli-VRGVHSXH.js → cli-25SJZI7N.js} +44 -9
  4. package/dist/{cli-YI3WZF3C.js → cli-27TQVLVF.js} +11 -11
  5. package/dist/cli-27Z5T52R.js +30 -0
  6. package/dist/cli-3VLBFWHN.js +36 -0
  7. package/dist/{cli-DXHPYN4N.js → cli-44CM2AH2.js} +1 -1
  8. package/dist/{cli-2PMLR6WG.js → cli-4F24FUW6.js} +15 -15
  9. package/dist/{cli-6GDPO5VU.js → cli-4FJL3KQZ.js} +2 -2
  10. package/dist/{cli-2BF7KBBJ.js → cli-5ATO27Z4.js} +15 -15
  11. package/dist/{cli-AA5GMEUL.js → cli-5EH4WTH4.js} +4 -4
  12. package/dist/{cli-MPWTXNF6.js → cli-5M6KDNVX.js} +2 -2
  13. package/dist/{cli-J2OTL6JH.js → cli-5O7XENQY.js} +5 -5
  14. package/dist/{cli-XA4IL7IM.js → cli-5RRPUL6V.js} +11 -11
  15. package/dist/{cli-JEMWAIAA.js → cli-5TTJWM2R.js} +15 -15
  16. package/dist/{cli-S3YIYAXC.js → cli-5UKWX3IU.js} +12 -12
  17. package/dist/{cli-AEAFLZGY.js → cli-5VZBFMCK.js} +5 -1
  18. package/dist/{cli-AGYCXRPR.js → cli-5Z4D3F6Y.js} +3 -3
  19. package/dist/{cli-ZHFHOWJI.js → cli-6AMK3DYS.js} +11 -11
  20. package/dist/{cli-G7JTIP5G.js → cli-6BLVI2JM.js} +11 -7
  21. package/dist/{cli-SBKTGFY4.js → cli-6JWDFCUV.js} +17 -17
  22. package/dist/{cli-7OCEVQQN.js → cli-6O7YCK2M.js} +2 -2
  23. package/dist/{cli-GZE4V7RC.js → cli-6P6V2EHY.js} +19 -19
  24. package/dist/{cli-KD2RQS35.js → cli-77T4LJQF.js} +22 -19
  25. package/dist/{cli-IC5FOT2J.js → cli-7JUNA74L.js} +1 -1
  26. package/dist/{cli-2FXZZLCL.js → cli-AH6AMAIB.js} +1 -1
  27. package/dist/{cli-NTI22MRE.js → cli-ATAJSIXH.js} +16 -16
  28. package/dist/{cli-OOTGO3KW.js → cli-ATHATKI5.js} +49 -49
  29. package/dist/{cli-QWO3XJR3.js → cli-ATWJCB2G.js} +4 -4
  30. package/dist/{cli-QIHVXDMW.js → cli-B2QAJ5RQ.js} +15 -15
  31. package/dist/{cli-MN7X4UG2.js → cli-B3EFE7ZF.js} +1 -1
  32. package/dist/{cli-HJPNNORV.js → cli-BC67QHD5.js} +2 -2
  33. package/dist/cli-BINVO5R7.js +36 -0
  34. package/dist/{cli-PJO4BKSV.js → cli-BJFYGVJV.js} +16 -16
  35. package/dist/{cli-C45A5VX6.js → cli-BQ36DV5C.js} +3 -3
  36. package/dist/{cli-IJPRZSJ5.js → cli-BZOKZ7LP.js} +24 -22
  37. package/dist/{cli-GHIMH6JU.js → cli-C32Q5E5I.js} +1 -1
  38. package/dist/{cli-35K37SYY.js → cli-D3S7NJZ3.js} +14 -14
  39. package/dist/{cli-KGJHEDR2.js → cli-DBMEH4Y5.js} +23 -21
  40. package/dist/{cli-A7PITFRR.js → cli-DH35TZ2Q.js} +5 -3
  41. package/dist/{cli-A3P3PO6Z.js → cli-DQE7ITIR.js} +15 -15
  42. package/dist/{cli-BV7MX7JE.js → cli-EEO5ZPAZ.js} +3 -3
  43. package/dist/{cli-3RMP4HKZ.js → cli-ERJNDBDH.js} +2 -2
  44. package/dist/{cli-2JEICVMA.js → cli-F3YJKP6D.js} +3 -3
  45. package/dist/{cli-2VV5IPSY.js → cli-FT3X3D4P.js} +15 -15
  46. package/dist/{cli-LZFUSEJT.js → cli-FYPW25VD.js} +13 -13
  47. package/dist/{cli-CVOLMK3Z.js → cli-G2GLW5Z4.js} +1 -1
  48. package/dist/{cli-BYXNPBVG.js → cli-G3TU6CP6.js} +15 -15
  49. package/dist/{cli-4L7S27XO.js → cli-GO64NABP.js} +1 -1
  50. package/dist/{cli-XRVH5WV6.js → cli-GSOV26O5.js} +13 -13
  51. package/dist/{cli-2UOUIVHW.js → cli-H6PP2MZT.js} +24 -12
  52. package/dist/{cli-6Y4XIVQS.js → cli-HGCOEL5T.js} +3 -3
  53. package/dist/cli-HLI5UEKX.js +36 -0
  54. package/dist/{cli-B5LZEFLU.js → cli-HMDYG6PS.js} +15 -15
  55. package/dist/{cli-7CW2BBJG.js → cli-HNDFANQG.js} +1 -1
  56. package/dist/{cli-MSSJLABW.js → cli-IKSLPAZN.js} +3 -3
  57. package/dist/{cli-AJ5CABGJ.js → cli-JHLWBRXB.js} +15 -15
  58. package/dist/{cli-5PTCQTS6.js → cli-JXQLHJO2.js} +1 -1
  59. package/dist/{cli-H7T6E7OA.js → cli-K4HSQWXC.js} +2 -2
  60. package/dist/{cli-WJO75KP7.js → cli-KIZTASLL.js} +3 -3
  61. package/dist/{cli-MX7GFQ6N.js → cli-KJA6GLZI.js} +14 -14
  62. package/dist/{cli-KINJAQTJ.js → cli-L7F4XKCB.js} +19 -19
  63. package/dist/{cli-BC4KKNLA.js → cli-LHMRUJVN.js} +4 -2
  64. package/dist/{cli-CQUSM3SF.js → cli-LPFSJ625.js} +19 -19
  65. package/dist/{cli-BNN36WZJ.js → cli-MDVC5ZNM.js} +13 -13
  66. package/dist/{cli-TLRTLTGK.js → cli-MSNSXVGF.js} +18 -18
  67. package/dist/{cli-5BPQ73OM.js → cli-NKKCDO6K.js} +15 -15
  68. package/dist/{cli-L5ZKQNMI.js → cli-OBLEROSC.js} +15 -15
  69. package/dist/cli-OF36EA62.js +36 -0
  70. package/dist/{cli-MZM4MW7C.js → cli-OM32UURE.js} +19 -19
  71. package/dist/{cli-J75EBRAJ.js → cli-OMTHTWYJ.js} +17 -17
  72. package/dist/{cli-K6M6YB67.js → cli-OTBCA54D.js} +1 -1
  73. package/dist/cli-OVIJRBFI.js +36 -0
  74. package/dist/{cli-IVZ7AHUJ.js → cli-OXLOGXT3.js} +3 -3
  75. package/dist/{cli-NU4SCD5D.js → cli-P3NUTOPK.js} +1 -1
  76. package/dist/{cli-D6AC3ZCX.js → cli-PNS4KWWC.js} +22 -19
  77. package/dist/{cli-7N7WFRWA.js → cli-PXQYY6KM.js} +0 -0
  78. package/dist/{cli-MTAGL3QE.js → cli-Q7QSWNY2.js} +15 -15
  79. package/dist/{cli-7V6GUIIS.js → cli-QDBYFITU.js} +2 -2
  80. package/dist/{cli-QK2OD24J.js → cli-QEFYDXMH.js} +9 -2
  81. package/dist/{cli-MYBDWJP7.js → cli-QPV3TYOM.js} +20 -20
  82. package/dist/{cli-W4BHSBAX.js → cli-QTCTWYCM.js} +3 -3
  83. package/dist/{cli-HCMVZXWK.js → cli-R5SNTPND.js} +17 -17
  84. package/dist/{cli-RHYQYXE2.js → cli-REAM7LSC.js} +18 -18
  85. package/dist/{cli-GHQIATHP.js → cli-RHL4B4H7.js} +6 -5
  86. package/dist/{cli-RL5EBZL7.js → cli-RKPQLB7J.js} +3 -3
  87. package/dist/{cli-E77R7ZYB.js → cli-RMD5WSUQ.js} +15 -15
  88. package/dist/{cli-OX3254NS.js → cli-S3NHXAJM.js} +17 -17
  89. package/dist/{cli-6COAU7JR.js → cli-SRXDLMXY.js} +17 -17
  90. package/dist/{cli-DMKRP33X.js → cli-TCQJL2GY.js} +1 -1
  91. package/dist/{cli-KO26S2CL.js → cli-TEBV2OIW.js} +31 -14
  92. package/dist/{cli-USBJQAYI.js → cli-TI2FOFPA.js} +13 -13
  93. package/dist/{cli-7RLZIWFP.js → cli-TLSTSZAC.js} +19 -19
  94. package/dist/{cli-2CSI2UU2.js → cli-UEQMK4WX.js} +1 -1
  95. package/dist/cli-UIYKPSIY.js +36 -0
  96. package/dist/{cli-2I6UN6C3.js → cli-UQC46YSV.js} +3 -3
  97. package/dist/{cli-BF6L37O3.js → cli-UULZSQBV.js} +3 -3
  98. package/dist/{cli-OK6XWVIN.js → cli-UVIURDZC.js} +17 -17
  99. package/dist/{cli-6KL5B7EC.js → cli-VXLHOZSO.js} +15 -15
  100. package/dist/{cli-UR63LFVK.js → cli-W3RG2MRI.js} +2 -2
  101. package/dist/{cli-G54355N5.js → cli-WJVPSVF2.js} +22 -19
  102. package/dist/{cli-YD4SBAHQ.js → cli-WNBP3LOD.js} +19 -19
  103. package/dist/{cli-DJCQ5XFR.js → cli-WNHMJM3Z.js} +15 -15
  104. package/dist/{cli-CL3KF5KS.js → cli-WQ7JBZNW.js} +2 -2
  105. package/dist/{cli-VTLFQHDO.js → cli-WW54THXN.js} +1 -1
  106. package/dist/cli-WZNIW6ZO.js +16 -0
  107. package/dist/{cli-BT47H36C.js → cli-X3TSTTYI.js} +2 -2
  108. package/dist/{cli-ICLCA6VD.js → cli-X52TXCNF.js} +19 -19
  109. package/dist/{cli-ZZSPFLTK.js → cli-X64BNBQH.js} +26 -4
  110. package/dist/{cli-CKV44U7P.js → cli-XJ7JESC2.js} +19 -19
  111. package/dist/{cli-EDZF5Q2E.js → cli-XKAIDYIE.js} +14 -14
  112. package/dist/{cli-CPX4YA3P.js → cli-XNOAO6DY.js} +11 -11
  113. package/dist/{cli-R6YAZP6E.js → cli-XOYUTNER.js} +19 -19
  114. package/dist/{cli-3VV2JLHX.js → cli-XW3JLRSA.js} +1 -1
  115. package/dist/{cli-S7PLSPGE.js → cli-YYXAGJQR.js} +15 -15
  116. package/dist/{cli-LFUKHLHI.js → cli-ZGCG6C22.js} +17 -17
  117. package/dist/{cli-QRAYIXNE.js → cli-ZJW6HQ6N.js} +5 -5
  118. package/dist/{cli-Y33ULHYO.js → cli-ZNQBF4Z3.js} +1 -1
  119. package/dist/cli.js +52 -52
  120. package/dist/client/index.d.ts +1 -1
  121. package/dist/client/test-session.d.ts +44 -6
  122. package/dist/client.js +100 -12
  123. package/dist/dev/console/assets/{index-CVNjiRUh.js → index-Ch6HHb2T.js} +1 -1
  124. package/dist/dev/console/index.html +1 -1
  125. package/dist/dev/surfaces.d.ts +8 -2
  126. package/dist/docs/api/index.md +3 -1
  127. package/dist/docs/api/sdk-tools-client.md +38 -6
  128. package/dist/docs/api/sdk-tools-vite.md +21 -0
  129. package/dist/docs/api/sdk.md +2 -0
  130. package/dist/docs/changelog.md +49 -0
  131. package/dist/docs/cli-error-codes.md +41 -39
  132. package/dist/docs/cli-reference.md +2 -1
  133. package/dist/docs/guides/endpoints.md +1 -1
  134. package/dist/docs/guides/engine-testing.md +49 -14
  135. package/dist/docs/guides/engine.md +2 -2
  136. package/dist/docs/guides/scenario-editor.md +1 -1
  137. package/dist/docs/guides/setup.md +22 -5
  138. package/dist/docs/guides/testing.md +3 -8
  139. package/dist/docs/guides/upgrading.md +15 -0
  140. package/dist/docs/page-index.md +6 -5
  141. package/dist/docs/recipes/create-game.md +1 -1
  142. package/dist/docs/recipes/fix-duplicate-packages.md +8 -19
  143. package/dist/docs/recipes/give-setup-a-menu.md +7 -1
  144. package/dist/docs/recipes/write-setup-notes.md +2 -2
  145. package/dist/host/protocol.d.ts +8 -5
  146. package/dist/oxlint/logic.json +184 -0
  147. package/dist/playwright.js +100 -12
  148. package/dist/runtime/manifest-version.d.ts +1 -1
  149. package/dist/runtime.js +1 -1
  150. package/dist/schema.json +20 -0
  151. package/dist/templates/package/README.md.liquid +1 -0
  152. package/dist/templates/package/claude/rules/workflow-create-engine.md +1 -1
  153. package/dist/templates/package/claude/rules/workflow-create-user-interface.md +1 -1
  154. package/dist/templates/package/claude/rules/workflow-test-engine-or-ui.md +1 -1
  155. package/dist/templates/package/claude/rules/workflow-update-sdk-version.md +2 -2
  156. package/dist/templates/package/claude/settings.json.template +1 -0
  157. package/dist/templates/package/oxfmtrc.json.template +8 -1
  158. package/dist/templates/package/oxlintrc.json.template +1 -180
  159. package/dist/templates/package/package.json.liquid +1 -0
  160. package/dist/templates/package/vite.config.ts.liquid +2 -8
  161. package/dist/templates/package/vitest.config.ts.liquid +2 -8
  162. package/dist/templates/starter-game/package.json +2 -1
  163. package/dist/templates/starter-game/testing/engine/game.engine.test.ts +62 -37
  164. package/dist/templates/starter-game/vite.config.ts +2 -8
  165. package/dist/templates/starter-game/vitest.config.ts +4 -3
  166. package/dist/utils/error-codes.d.ts +6 -2
  167. package/dist/utils/resource-scan.d.ts +5 -0
  168. package/dist/vite/index.d.ts +30 -0
  169. package/dist/vite.js +12 -0
  170. package/package.json +12 -4
  171. package/dist/cli-3I6AI4AA.js +0 -36
  172. package/dist/cli-3YGNWZC6.js +0 -30
  173. package/dist/cli-4X3X4HB2.js +0 -16
  174. package/dist/cli-6ZBQELF2.js +0 -36
  175. package/dist/cli-CUZUIYCQ.js +0 -36
  176. package/dist/cli-DNCJURUU.js +0 -36
  177. package/dist/cli-UKC7KXWU.js +0 -36
  178. package/dist/cli-WA2PDQUB.js +0 -36
@@ -38,10 +38,10 @@ pnpm run --silent sdk docs view recipes/index.md # every recipe, o
38
38
  pnpm run --silent sdk docs view recipes/create-hook.md # one document
39
39
  pnpm run --silent sdk docs view guides/session.md --outline # the headings of a page, with section lengths
40
40
  pnpm run --silent sdk docs view guides/session.md --section 'Building the session UI' # one section
41
- pnpm run --silent sdk docs view cli-reference.md # every command and flag
41
+ pnpm run --silent sdk docs view cli-reference.md --outline # every command, to pick a section from
42
42
  ```
43
43
 
44
- Some guides run past 50,000 characters, more than one read may show you. Before reading a long page whole, find it in `page-index.md`, list its headings with `--outline`, and read the section you need with `--section`.
44
+ Some pages run past 50,000 characters, more than one read may show you. Before reading a long page whole, find it in `page-index.md`, list its headings with `--outline`, and read the section you need with `--section`. Never read `cli-reference.md`, `changelog.md` or `guides/upgrading.md` whole: each is far longer than that, and `pnpm run sdk <command> --help` answers a question about one command.
45
45
 
46
46
  The same files are on disk in `node_modules/@seriousgaming/sdk-tools/dist/docs/`, so you can search them with `grep -rn`. Start from `recipes/` for a task, `guides/` for a whole subject, and `concepts/` for the model.
47
47
 
@@ -110,17 +110,24 @@ Pass `--json` to any command (or set `SERIOUSGAMING_JSON=1`) and it prints exact
110
110
  { "ok": false, "command": "build", "error": { "code": "PACKAGE_INVALID", "message": "…", "hint": "…" }, "diagnostics": [{ "severity": "error", "code": "SETTINGS_UNKNOWN_KEY", "file": "scenarios/hard/scenario.sdk.json", "pointer": "/definition/settings/engine/BaseDemnd", "hint": "Did you mean 'BaseDemand'?", "message": "…" }], "warnings": [] }
111
111
  ```
112
112
 
113
- After every change, run these in order and stop at the first that fails:
113
+ After every change, run the package's own check. It stops at the first step that fails, and it is the package's script, so it may hold more steps than these:
114
114
 
115
115
  ```bash
116
- pnpm run --silent sdk build --validate-only --json # the package: bundles, references, settings
117
- pnpm run typecheck # tsc over the whole package
118
- pnpm run lint # oxlint, warnings included
119
- pnpm test:run # unit and component tests beside each resource
120
- pnpm test:engine # whole games, in-process
121
- pnpm run --silent sdk tick --no-server --json # one tick in the restricted production runtime
116
+ pnpm check
122
117
  ```
123
118
 
119
+ ```bash
120
+ pnpm run --silent sdk build --validate-only # the package: bundles, references, settings
121
+ pnpm run typecheck # tsc over the whole package
122
+ pnpm run lint # oxlint, warnings included; flags a host global in logic
123
+ pnpm test:run # unit and component tests beside each resource
124
+ pnpm test:engine # whole games, in-process, in the restricted runtime
125
+ ```
126
+
127
+ `pnpm test:engine` runs logic in the same restricted runtime `sdk tick` does, so a global the production runtime lacks fails there as `ReferenceError`. Keep a test in `testing/engine/` that starts every scenario and plays a tick: a scenario's settings are only exercised when the game is played on them. A package scaffolded before 1.11 has no `check` script; add it from `guides/upgrading.md`, or run the five steps in order. When a step fails, rerun that one command with `--json` for the diagnostics.
128
+
129
+ `pnpm run --silent sdk tick --no-server --summary` plays one tick by hand, as a smoke test, and prints only the session head.
130
+
124
131
  Branch on `ok`, the exit code and `error.code`, never on the message:
125
132
 
126
133
  | Exit | Meaning | What to do |
@@ -157,15 +164,15 @@ A slot command takes no identifier. `new` refuses a slot that is already filled,
157
164
  ### Playing the game from the CLI
158
165
 
159
166
  ```bash
160
- pnpm run --silent sdk init # start the session, or rebuild it at tick 0
161
- pnpm run --silent sdk tick --patch '[{"op":"replace","path":"/<capability>/<variable>","value":70}]'
167
+ pnpm run --silent sdk init --summary # start the session, or rebuild it at tick 0
168
+ pnpm run --silent sdk tick --summary --patch '[{"op":"replace","path":"/<capability>/<variable>","value":70}]'
162
169
  pnpm run --silent sdk patch '[{"op":"replace","path":"/<capability>/<variable>","value":0}]'
163
170
  pnpm run --silent sdk view # the current state (--full for the whole projection)
164
171
  pnpm run --silent sdk undo # undo the last tick
165
172
  pnpm run --silent sdk reset # back to tick 0
166
173
  ```
167
174
 
168
- Patch paths start at the capability. `--team N` picks the team in a game with several. `pnpm run sdk configure '{"<settings>":{"<property>":60}}'` overrides settings for the session, keyed by settings identifier, and restarts a running session on the new values.
175
+ `init`, `tick` and `view` print every team's context unless you pass `--summary`, which prints only the session head (the tick count and whether the game is complete). Pass it whenever you are not about to read the context, and use `view --team N` when you are. Patch paths start at the capability. `--team N` picks the team in a game with several. `pnpm run sdk configure '{"<settings>":{"<property>":60}}'` overrides settings for the session, keyed by settings identifier, and restarts a running session on the new values.
169
176
 
170
177
  **Know which session a command touches:**
171
178
 
@@ -215,7 +222,7 @@ export const Run: RunFunction<Context, Settings> = async ({ context, meta }) =>
215
222
 
216
223
  - The args are `{ context, settings, callbacks, meta, participants }`, plus `state` for an engine. `settings` is keyed by settings identifier and already resolved for the session; `guides/settings.md` has the order
217
224
  - Hooks, aggregate engines (`{ shared: { capabilities }, teams: [{ capabilities }] }`) and writing endpoints (`{ response, capabilities }`) return the same way. A flat return fails the call
218
- - **To remove a key**, return its path in `deletes` beside `capabilities` (`deletes: [['orders', 'Open', id]]`), under a capability in `writes`. Leaving a key out never removes it
225
+ - **To remove a key**, return its path in `deletes` beside `capabilities` (`deletes: [['orders', 'Open', id]]`), under a capability in `writes`. A variable you return replaces the old one whole, so an entry survives only because you spread the old map into the new one; `deletes` removes it whichever way the map was built, and reads the same in a surface's `setData`
219
226
  - `Init` is optional: without it each team starts from the capabilities' defaults
220
227
  - `Run` may return `complete: true` to end the game, and an engine may return `state` beside `capabilities` for private memory between ticks (type it with `RunFunction`'s fourth parameter)
221
228
  - A step of a split engine is a `StepFunction<Context, Settings>`: steps pass the context flat, and only the exported function wraps the result
@@ -286,7 +293,8 @@ const result = await Run(
286
293
 
287
294
  const session = await createTestSession<Context, SharedContext>({ packagePath });
288
295
  await session.setData(0, { decisions: { Price: 4 } }); // a write to a capability the UI declares
289
- await session.tick();
296
+ const result = await session.tick();
297
+ expect(result.ok, JSON.stringify(result)).toBe(true); // a failure carries `logicError`: file, line, tick, team
290
298
  expect(session.team(0).context.results.Day).toBe(1);
291
299
  ```
292
300
 
@@ -335,15 +343,15 @@ Upgrade only when the user asks, or when the changelog has a fix the task needs,
335
343
 
336
344
  ## Troubleshooting
337
345
 
338
- | Problem | Solution |
339
- | ------------------------------------- | ------------------------------------------------------------------------------------------ |
340
- | Types not updating | `pnpm run generate` |
341
- | A capability is missing in code | Add it to the resource's `reads` or `writes`; `update` regenerates the types |
342
- | A surface's write is refused | Add the capability to that surface's `writes` |
343
- | Build failing | `pnpm run --silent sdk build --validate-only --json`, then read `diagnostics` |
344
- | Edit not showing, or `SETTINGS_STALE` | A setting, `teams` or a capability's scope applies only at init: `sdk init` |
345
- | A hook reads empty data in a surface | Two copies of a package with React context: add it to `resolve.dedupe` in `vite.config.ts` |
346
- | Anything else | `pnpm run --silent sdk docs view troubleshooting.md` |
346
+ | Problem | Solution |
347
+ | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
348
+ | Types not updating | `pnpm run generate` |
349
+ | A capability is missing in code | Add it to the resource's `reads` or `writes`; `update` regenerates the types |
350
+ | A surface's write is refused | Add the capability to that surface's `writes` |
351
+ | Build failing | `pnpm run --silent sdk build --validate-only --json`, then read `diagnostics` |
352
+ | Edit not showing, or `SETTINGS_STALE` | A setting, `teams` or a capability's scope applies only at init: `sdk init` |
353
+ | A hook reads empty data in a surface | Two copies of a package with React context: add it to `resolve.dedupe` in `vite.config.ts`, beside `REACT_CONTEXT_PACKAGES` |
354
+ | Anything else | `pnpm run --silent sdk docs view troubleshooting.md` |
347
355
 
348
356
  Keep `DESIGN.md` up to date as the game changes, and hold to two habits for every surface:
349
357
 
@@ -19,7 +19,7 @@ import {
19
19
  unicodeWhitespace,
20
20
  unified,
21
21
  visit
22
- } from "./cli-ZZSPFLTK.js";
22
+ } from "./cli-X64BNBQH.js";
23
23
 
24
24
  // cli/utils/schema-members.ts
25
25
  function memberSchemas(schema, key) {
@@ -12,7 +12,7 @@ import {
12
12
  validateUIFiles,
13
13
  validateUserInterface,
14
14
  validateValidator
15
- } from "./cli-4L7S27XO.js";
15
+ } from "./cli-GO64NABP.js";
16
16
  import {
17
17
  fileSettingDeclarationErrors,
18
18
  isChapterEmpty,
@@ -21,10 +21,10 @@ import {
21
21
  referenceLocale,
22
22
  settingReferences,
23
23
  strayFences
24
- } from "./cli-KJV3GGBA.js";
24
+ } from "./cli-226ZJ72R.js";
25
25
  import {
26
26
  validateTsTypes
27
- } from "./cli-2CSI2UU2.js";
27
+ } from "./cli-UEQMK4WX.js";
28
28
  import {
29
29
  LogicLoader,
30
30
  SCENARIO_VALIDATION,
@@ -34,7 +34,7 @@ import {
34
34
  isBlocking,
35
35
  resolveCapabilityScope,
36
36
  runScenarioGates
37
- } from "./cli-5PTCQTS6.js";
37
+ } from "./cli-JXQLHJO2.js";
38
38
  import {
39
39
  describeAssetByReference
40
40
  } from "./cli-QWQMPCL6.js";
@@ -65,7 +65,7 @@ import {
65
65
  teamsMaxOf,
66
66
  unenforceableLockMessage,
67
67
  unenforceableLocks
68
- } from "./cli-ZZSPFLTK.js";
68
+ } from "./cli-X64BNBQH.js";
69
69
 
70
70
  // cli/validation/package-validation.ts
71
71
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
@@ -863,6 +863,16 @@ function collectUnknownSettingsReferences(config) {
863
863
  const resources = [
864
864
  { label: 'Engine "engine"', type: "engine", definition: config.engine?.definition },
865
865
  { label: 'User Interface "ui"', type: "ui", definition: config.ui?.definition },
866
+ {
867
+ label: 'Setup User Interface "setup"',
868
+ type: "setup",
869
+ definition: config.setup?.definition
870
+ },
871
+ {
872
+ label: 'Scenario Editor "scenario_editor"',
873
+ type: "scenario_editor",
874
+ definition: config.scenario_editor?.definition
875
+ },
866
876
  {
867
877
  label: 'Session User Interface "session"',
868
878
  type: "session",
@@ -1499,13 +1509,17 @@ var VALIDATION_DESCRIPTORS = [
1499
1509
  type: "setup",
1500
1510
  resources: (config) => slot(config.setup),
1501
1511
  identify: named,
1502
- checks: [uiFiles, (setup, context) => setupNotesChecks(setup, context)]
1512
+ checks: [
1513
+ uiFiles,
1514
+ (setup, context) => setupNotesChecks(setup, context),
1515
+ editorSettingsChecks
1516
+ ]
1503
1517
  }),
1504
1518
  descriptor({
1505
1519
  type: "scenario_editor",
1506
1520
  resources: (config) => slot(config.scenario_editor),
1507
1521
  identify: named,
1508
- checks: [uiFiles]
1522
+ checks: [uiFiles, editorSettingsChecks]
1509
1523
  }),
1510
1524
  descriptor({
1511
1525
  type: "tick_controller",
@@ -1789,11 +1803,32 @@ async function validateLoadedPackage(config, options) {
1789
1803
  }
1790
1804
  };
1791
1805
  }
1806
+ function editorSettingsChecks(editor) {
1807
+ const slot2 = editor.definition.identifier;
1808
+ const configures = new Set(editor.definition.configures ?? []);
1809
+ const warnings = [];
1810
+ const findings = [];
1811
+ (editor.definition.settings ?? []).forEach((identifier, index) => {
1812
+ if (!configures.has(identifier)) return;
1813
+ 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.`;
1814
+ warnings.push(message);
1815
+ findings.push({
1816
+ severity: "warning",
1817
+ code: "EDITOR_SETTINGS_CONFIGURED",
1818
+ message,
1819
+ file: bundleFileOf(slot2, slot2),
1820
+ pointer: pointerOf("definition", "settings", index),
1821
+ resource: { type: slot2, identifier: slot2 }
1822
+ });
1823
+ });
1824
+ return { errors: [], warnings, findings };
1825
+ }
1792
1826
  function setupNotesChecks(setup, context) {
1793
1827
  const directory = resolve2(context.workingDir, setup.rootDirectory);
1794
1828
  const schemas = settingsSchemas(context.config);
1795
1829
  const identifiers = new Set(Object.keys(schemas));
1796
1830
  const configures = new Set(setup.definition.configures ?? []);
1831
+ const reads = new Set(setup.definition.settings ?? []);
1797
1832
  const resource = { type: "setup", identifier: "setup" };
1798
1833
  const outcome = {
1799
1834
  errors: [],
@@ -1809,8 +1844,8 @@ function setupNotesChecks(setup, context) {
1809
1844
  for (const { path, line } of notesSettingReferences(markdown, identifiers)) {
1810
1845
  if (!settingPathDeclared(schemas, path)) continue;
1811
1846
  const identifier = parseSettingPath(path)?.identifier ?? "";
1812
- if (!configures.has(identifier)) {
1813
- const message = `Setup notes ${file}, line ${line}, name \`${path}\`, 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.`;
1847
+ if (!configures.has(identifier) && !reads.has(identifier)) {
1848
+ const message = `Setup notes ${file}, line ${line}, name \`${path}\`, 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.`;
1814
1849
  outcome.warnings.push(message);
1815
1850
  outcome.findings.push({
1816
1851
  severity: "warning",
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runResourceCommand
4
- } from "./cli-WJO75KP7.js";
4
+ } from "./cli-KIZTASLL.js";
5
5
  import {
6
6
  RESOURCE_DESCRIPTORS_BY_TYPE,
7
7
  supportedTypes
8
- } from "./cli-OOTGO3KW.js";
9
- import "./cli-W4BHSBAX.js";
10
- import "./cli-NU4SCD5D.js";
11
- import "./cli-2I6UN6C3.js";
12
- import "./cli-G7JTIP5G.js";
13
- import "./cli-2CSI2UU2.js";
14
- import "./cli-5PTCQTS6.js";
8
+ } from "./cli-ATHATKI5.js";
9
+ import "./cli-QTCTWYCM.js";
10
+ import "./cli-P3NUTOPK.js";
11
+ import "./cli-UQC46YSV.js";
12
+ import "./cli-6BLVI2JM.js";
13
+ import "./cli-UEQMK4WX.js";
14
+ import "./cli-JXQLHJO2.js";
15
15
  import "./cli-25RWY5BQ.js";
16
16
  import "./cli-QWQMPCL6.js";
17
- import "./cli-ZZSPFLTK.js";
17
+ import "./cli-X64BNBQH.js";
18
18
  import "./cli-F2D4GGUA.js";
19
- import "./cli-DMKRP33X.js";
19
+ import "./cli-TCQJL2GY.js";
20
20
  import {
21
21
  CliError
22
- } from "./cli-AEAFLZGY.js";
22
+ } from "./cli-5VZBFMCK.js";
23
23
 
24
24
  // cli/commands/update.ts
25
25
  async function updateCommand(resourceType, identifierOrDefinition, definition, options) {
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ submitPatch,
4
+ submitSharedPatch,
5
+ tickCommand
6
+ } from "./cli-F3YJKP6D.js";
7
+ import "./cli-ZJW6HQ6N.js";
8
+ import "./cli-BC67QHD5.js";
9
+ import "./cli-ATWJCB2G.js";
10
+ import "./cli-PXQYY6KM.js";
11
+ import "./cli-UULZSQBV.js";
12
+ import "./cli-OTBCA54D.js";
13
+ import "./cli-ZNQBF4Z3.js";
14
+ import "./cli-226ZJ72R.js";
15
+ import "./cli-4LKXZQ2B.js";
16
+ import "./cli-HNDFANQG.js";
17
+ import "./cli-S5IVGDDD.js";
18
+ import "./cli-QUNIRH7A.js";
19
+ import "./cli-JXQLHJO2.js";
20
+ import "./cli-25RWY5BQ.js";
21
+ import "./cli-QWQMPCL6.js";
22
+ import "./cli-X64BNBQH.js";
23
+ import "./cli-F2D4GGUA.js";
24
+ import "./cli-TCQJL2GY.js";
25
+ import "./cli-5VZBFMCK.js";
26
+ export {
27
+ submitPatch,
28
+ submitSharedPatch,
29
+ tickCommand
30
+ };
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ createSettingsEditor
4
+ } from "./cli-5UKWX3IU.js";
5
+ import "./cli-EEO5ZPAZ.js";
6
+ import "./cli-DH35TZ2Q.js";
7
+ import "./cli-S5IVGDDD.js";
8
+ import "./cli-6O7YCK2M.js";
9
+ import "./cli-XW3JLRSA.js";
10
+ import "./cli-RHL4B4H7.js";
11
+ import "./cli-WW54THXN.js";
12
+ import "./cli-QUNIRH7A.js";
13
+ import "./cli-ERJNDBDH.js";
14
+ import "./cli-LHMRUJVN.js";
15
+ import "./cli-X3TSTTYI.js";
16
+ import "./cli-QEFYDXMH.js";
17
+ import "./cli-QTCTWYCM.js";
18
+ import "./cli-P3NUTOPK.js";
19
+ import "./cli-UQC46YSV.js";
20
+ import "./cli-6BLVI2JM.js";
21
+ import "./cli-UEQMK4WX.js";
22
+ import "./cli-JXQLHJO2.js";
23
+ import "./cli-25RWY5BQ.js";
24
+ import "./cli-QWQMPCL6.js";
25
+ import "./cli-X64BNBQH.js";
26
+ import "./cli-F2D4GGUA.js";
27
+ import "./cli-TCQJL2GY.js";
28
+ import "./cli-5VZBFMCK.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
+ };
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  CliError,
7
7
  reportResult
8
- } from "./cli-AEAFLZGY.js";
8
+ } from "./cli-5VZBFMCK.js";
9
9
 
10
10
  // cli/commands/docs.ts
11
11
  import { readFileSync as readFileSync2, readdirSync as readdirSync2, statSync as statSync2 } from "fs";
@@ -2,35 +2,35 @@
2
2
  import {
3
3
  deleteEngineFiles,
4
4
  findEngineReferences
5
- } from "./cli-GHQIATHP.js";
6
- import "./cli-VTLFQHDO.js";
5
+ } from "./cli-RHL4B4H7.js";
6
+ import "./cli-WW54THXN.js";
7
7
  import "./cli-QUNIRH7A.js";
8
- import "./cli-3RMP4HKZ.js";
8
+ import "./cli-ERJNDBDH.js";
9
9
  import {
10
10
  loadPackageContext
11
- } from "./cli-BC4KKNLA.js";
12
- import "./cli-BT47H36C.js";
13
- import "./cli-QK2OD24J.js";
11
+ } from "./cli-LHMRUJVN.js";
12
+ import "./cli-X3TSTTYI.js";
13
+ import "./cli-QEFYDXMH.js";
14
14
  import {
15
15
  operationError,
16
16
  recordOperationResult,
17
17
  regenerateTypes
18
- } from "./cli-W4BHSBAX.js";
18
+ } from "./cli-QTCTWYCM.js";
19
19
  import {
20
20
  confirmAction
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";
21
+ } from "./cli-P3NUTOPK.js";
22
+ import "./cli-UQC46YSV.js";
23
+ import "./cli-6BLVI2JM.js";
24
+ import "./cli-UEQMK4WX.js";
25
+ import "./cli-JXQLHJO2.js";
26
26
  import "./cli-25RWY5BQ.js";
27
27
  import "./cli-QWQMPCL6.js";
28
- import "./cli-ZZSPFLTK.js";
28
+ import "./cli-X64BNBQH.js";
29
29
  import "./cli-F2D4GGUA.js";
30
30
  import {
31
31
  logger
32
- } from "./cli-DMKRP33X.js";
33
- import "./cli-AEAFLZGY.js";
32
+ } from "./cli-TCQJL2GY.js";
33
+ import "./cli-5VZBFMCK.js";
34
34
 
35
35
  // cli/commands/resources/engine/delete.ts
36
36
  async function deleteEngine(options) {
@@ -4,11 +4,11 @@ import {
4
4
  } from "./cli-ILKCQNM6.js";
5
5
  import {
6
6
  logger
7
- } from "./cli-DMKRP33X.js";
7
+ } from "./cli-TCQJL2GY.js";
8
8
  import {
9
9
  CliError,
10
10
  reportResult
11
- } from "./cli-AEAFLZGY.js";
11
+ } from "./cli-5VZBFMCK.js";
12
12
 
13
13
  // cli/commands/package-version.ts
14
14
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -2,36 +2,36 @@
2
2
  import {
3
3
  deleteTickControllerFiles,
4
4
  findTickControllerReferences
5
- } from "./cli-GHQIATHP.js";
6
- import "./cli-VTLFQHDO.js";
5
+ } from "./cli-RHL4B4H7.js";
6
+ import "./cli-WW54THXN.js";
7
7
  import "./cli-QUNIRH7A.js";
8
- import "./cli-3RMP4HKZ.js";
8
+ import "./cli-ERJNDBDH.js";
9
9
  import {
10
10
  loadPackageContext
11
- } from "./cli-BC4KKNLA.js";
12
- import "./cli-BT47H36C.js";
13
- import "./cli-QK2OD24J.js";
11
+ } from "./cli-LHMRUJVN.js";
12
+ import "./cli-X3TSTTYI.js";
13
+ import "./cli-QEFYDXMH.js";
14
14
  import {
15
15
  operationError,
16
16
  recordOperationResult
17
- } from "./cli-W4BHSBAX.js";
17
+ } from "./cli-QTCTWYCM.js";
18
18
  import {
19
19
  confirmAction
20
- } from "./cli-NU4SCD5D.js";
20
+ } from "./cli-P3NUTOPK.js";
21
21
  import {
22
22
  generateCommand
23
- } from "./cli-2I6UN6C3.js";
24
- import "./cli-G7JTIP5G.js";
25
- import "./cli-2CSI2UU2.js";
26
- import "./cli-5PTCQTS6.js";
23
+ } from "./cli-UQC46YSV.js";
24
+ import "./cli-6BLVI2JM.js";
25
+ import "./cli-UEQMK4WX.js";
26
+ import "./cli-JXQLHJO2.js";
27
27
  import "./cli-25RWY5BQ.js";
28
28
  import "./cli-QWQMPCL6.js";
29
- import "./cli-ZZSPFLTK.js";
29
+ import "./cli-X64BNBQH.js";
30
30
  import "./cli-F2D4GGUA.js";
31
31
  import {
32
32
  logger
33
- } from "./cli-DMKRP33X.js";
34
- import "./cli-AEAFLZGY.js";
33
+ } from "./cli-TCQJL2GY.js";
34
+ import "./cli-5VZBFMCK.js";
35
35
 
36
36
  // cli/commands/resources/tick-controller/delete.ts
37
37
  async function deleteTickController(options) {
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  validateEngine
4
- } from "./cli-4L7S27XO.js";
4
+ } from "./cli-GO64NABP.js";
5
5
  import "./cli-4LKXZQ2B.js";
6
6
  import {
7
7
  LOGIC_NODE_BUILTIN,
8
8
  Transpile,
9
9
  loadConfig
10
- } from "./cli-ZZSPFLTK.js";
10
+ } from "./cli-X64BNBQH.js";
11
11
  import "./cli-F2D4GGUA.js";
12
- import "./cli-DMKRP33X.js";
12
+ import "./cli-TCQJL2GY.js";
13
13
  import {
14
14
  CliError,
15
15
  reportResult
16
- } from "./cli-AEAFLZGY.js";
16
+ } from "./cli-5VZBFMCK.js";
17
17
 
18
18
  // cli/commands/build-engine.ts
19
19
  import { resolve, join } from "path";
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readSdkToolsVersion
4
- } from "./cli-VTLFQHDO.js";
4
+ } from "./cli-WW54THXN.js";
5
5
  import {
6
6
  reportResult
7
- } from "./cli-AEAFLZGY.js";
7
+ } from "./cli-5VZBFMCK.js";
8
8
 
9
9
  // cli/commands/version.ts
10
10
  async function versionCommand() {
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  bundlePackage
4
- } from "./cli-7V6GUIIS.js";
4
+ } from "./cli-QDBYFITU.js";
5
5
  import {
6
6
  loadEnvironmentConfig
7
- } from "./cli-K6M6YB67.js";
8
- import "./cli-7CW2BBJG.js";
7
+ } from "./cli-OTBCA54D.js";
8
+ import "./cli-HNDFANQG.js";
9
9
  import {
10
10
  DEFAULT_PLATFORM_HOST,
11
11
  formatPlatformErrors,
@@ -13,11 +13,11 @@ import {
13
13
  } from "./cli-25RWY5BQ.js";
14
14
  import {
15
15
  logger
16
- } from "./cli-DMKRP33X.js";
16
+ } from "./cli-TCQJL2GY.js";
17
17
  import {
18
18
  CliError,
19
19
  reportResult
20
- } from "./cli-AEAFLZGY.js";
20
+ } from "./cli-5VZBFMCK.js";
21
21
 
22
22
  // cli/commands/package-publish.ts
23
23
  import { existsSync, readFileSync, statSync } from "fs";
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveSession
4
- } from "./cli-QRAYIXNE.js";
5
- import "./cli-HJPNNORV.js";
6
- import "./cli-BF6L37O3.js";
7
- import "./cli-K6M6YB67.js";
8
- import "./cli-Y33ULHYO.js";
9
- import "./cli-KJV3GGBA.js";
4
+ } from "./cli-ZJW6HQ6N.js";
5
+ import "./cli-BC67QHD5.js";
6
+ import "./cli-UULZSQBV.js";
7
+ import "./cli-OTBCA54D.js";
8
+ import "./cli-ZNQBF4Z3.js";
9
+ import "./cli-226ZJ72R.js";
10
10
  import "./cli-4LKXZQ2B.js";
11
- import "./cli-7CW2BBJG.js";
11
+ import "./cli-HNDFANQG.js";
12
12
  import "./cli-QUNIRH7A.js";
13
- import "./cli-5PTCQTS6.js";
13
+ import "./cli-JXQLHJO2.js";
14
14
  import "./cli-25RWY5BQ.js";
15
15
  import "./cli-QWQMPCL6.js";
16
- import "./cli-ZZSPFLTK.js";
16
+ import "./cli-X64BNBQH.js";
17
17
  import "./cli-F2D4GGUA.js";
18
- import "./cli-DMKRP33X.js";
18
+ import "./cli-TCQJL2GY.js";
19
19
  import {
20
20
  CliError,
21
21
  reportResult
22
- } from "./cli-AEAFLZGY.js";
22
+ } from "./cli-5VZBFMCK.js";
23
23
 
24
24
  // cli/commands/endpoint-audit.ts
25
25
  function describe(entry) {
@@ -2,36 +2,36 @@
2
2
  import {
3
3
  deleteValidatorFiles,
4
4
  findValidatorReferences
5
- } from "./cli-GHQIATHP.js";
6
- import "./cli-VTLFQHDO.js";
5
+ } from "./cli-RHL4B4H7.js";
6
+ import "./cli-WW54THXN.js";
7
7
  import "./cli-QUNIRH7A.js";
8
- import "./cli-3RMP4HKZ.js";
8
+ import "./cli-ERJNDBDH.js";
9
9
  import {
10
10
  loadPackageContext
11
- } from "./cli-BC4KKNLA.js";
12
- import "./cli-BT47H36C.js";
13
- import "./cli-QK2OD24J.js";
11
+ } from "./cli-LHMRUJVN.js";
12
+ import "./cli-X3TSTTYI.js";
13
+ import "./cli-QEFYDXMH.js";
14
14
  import {
15
15
  operationError,
16
16
  recordOperationResult
17
- } from "./cli-W4BHSBAX.js";
17
+ } from "./cli-QTCTWYCM.js";
18
18
  import {
19
19
  confirmAction
20
- } from "./cli-NU4SCD5D.js";
20
+ } from "./cli-P3NUTOPK.js";
21
21
  import {
22
22
  generateCommand
23
- } from "./cli-2I6UN6C3.js";
24
- import "./cli-G7JTIP5G.js";
25
- import "./cli-2CSI2UU2.js";
26
- import "./cli-5PTCQTS6.js";
23
+ } from "./cli-UQC46YSV.js";
24
+ import "./cli-6BLVI2JM.js";
25
+ import "./cli-UEQMK4WX.js";
26
+ import "./cli-JXQLHJO2.js";
27
27
  import "./cli-25RWY5BQ.js";
28
28
  import "./cli-QWQMPCL6.js";
29
- import "./cli-ZZSPFLTK.js";
29
+ import "./cli-X64BNBQH.js";
30
30
  import "./cli-F2D4GGUA.js";
31
31
  import {
32
32
  logger
33
- } from "./cli-DMKRP33X.js";
34
- import "./cli-AEAFLZGY.js";
33
+ } from "./cli-TCQJL2GY.js";
34
+ import "./cli-5VZBFMCK.js";
35
35
 
36
36
  // cli/commands/resources/validator/delete.ts
37
37
  async function deleteValidator(identifier, options) {