@seriousgaming/sdk-tools 1.5.0 → 1.6.1

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 (169) hide show
  1. package/dist/agent/guidance.md +350 -0
  2. package/dist/bundling/ui-bundler.d.ts +12 -0
  3. package/dist/cli-25RWY5BQ.js +41 -0
  4. package/dist/cli-2BH7FX27.js +52 -0
  5. package/dist/cli-2GZYGRVL.js +36 -0
  6. package/dist/cli-2NU2LPEE.js +97 -0
  7. package/dist/cli-3BRC32CP.js +132 -0
  8. package/dist/cli-3D3ZXWOV.js +111 -0
  9. package/dist/cli-3ZKWV3PN.js +96 -0
  10. package/dist/cli-45OCBG53.js +60 -0
  11. package/dist/cli-4LKXZQ2B.js +48 -0
  12. package/dist/cli-4PXNOJQX.js +81 -0
  13. package/dist/cli-4SIWLHQO.js +717 -0
  14. package/dist/cli-4UWFQNGF.js +54 -0
  15. package/dist/cli-4VFZHLDG.js +202 -0
  16. package/dist/cli-4YB3ROVR.js +78 -0
  17. package/dist/cli-5ACDPCXI.js +21 -0
  18. package/dist/cli-5IAW3LIF.js +38 -0
  19. package/dist/cli-5SM367K7.js +30 -0
  20. package/dist/cli-64AB62PM.js +25 -0
  21. package/dist/cli-6K3VQQUS.js +307 -0
  22. package/dist/cli-6QB2VFPY.js +80 -0
  23. package/dist/cli-6SGCYEEC.js +649 -0
  24. package/dist/cli-6UTPHWRQ.js +207 -0
  25. package/dist/cli-6VNKQ3OX.js +391 -0
  26. package/dist/cli-72XDEFU3.js +61 -0
  27. package/dist/cli-7A6MKCUJ.js +463 -0
  28. package/dist/cli-7XLHO2FE.js +226 -0
  29. package/dist/cli-AV2FYC5G.js +225 -0
  30. package/dist/cli-B6YHEKIJ.js +248 -0
  31. package/dist/cli-BJMS3VX3.js +1837 -0
  32. package/dist/cli-BUQI5UU4.js +43 -0
  33. package/dist/cli-BWX5E7TQ.js +23 -0
  34. package/dist/cli-BYCHKSSH.js +1331 -0
  35. package/dist/cli-C3CMJSNL.js +89 -0
  36. package/dist/cli-C47GJATR.js +42 -0
  37. package/dist/cli-C5QOJJWX.js +46 -0
  38. package/dist/cli-C6ZLPK2U.js +124 -0
  39. package/dist/cli-CD5CIJZI.js +72 -0
  40. package/dist/cli-DDJYUKQG.js +36 -0
  41. package/dist/cli-DFBTZEBX.js +167 -0
  42. package/dist/cli-DOXRQ3S5.js +60 -0
  43. package/dist/cli-EVI36HEM.js +79 -0
  44. package/dist/cli-F2D4GGUA.js +549 -0
  45. package/dist/cli-FQRVFGN6.js +0 -0
  46. package/dist/cli-FWFRKQNE.js +11 -0
  47. package/dist/cli-G6CANSPL.js +88 -0
  48. package/dist/cli-GFNDW2DL.js +124 -0
  49. package/dist/cli-HCRTYQQS.js +16 -0
  50. package/dist/cli-HFX3YPUL.js +76 -0
  51. package/dist/cli-HKORECAG.js +53 -0
  52. package/dist/cli-HOE3WLFH.js +73 -0
  53. package/dist/cli-HSIHDN6K.js +187 -0
  54. package/dist/cli-HW53ICZC.js +89 -0
  55. package/dist/cli-IDVUHGKG.js +218 -0
  56. package/dist/cli-IEMKI7J7.js +1387 -0
  57. package/dist/cli-ILFDANBR.js +101 -0
  58. package/dist/cli-ILKCQNM6.js +8 -0
  59. package/dist/cli-IP4RXGHM.js +2847 -0
  60. package/dist/cli-IUS2YCD3.js +31 -0
  61. package/dist/cli-J4DKUUTK.js +138 -0
  62. package/dist/cli-J4UBELKF.js +37 -0
  63. package/dist/cli-JJSWBW4H.js +89 -0
  64. package/dist/cli-JVI24FI6.js +68 -0
  65. package/dist/cli-JZCLIT3O.js +135 -0
  66. package/dist/cli-JZOZOEZM.js +131 -0
  67. package/dist/cli-KGM6RRQW.js +185 -0
  68. package/dist/cli-KGT5L7VZ.js +13641 -0
  69. package/dist/cli-KOGRWFN7.js +89 -0
  70. package/dist/cli-KSGB2ZLK.js +101 -0
  71. package/dist/cli-L7VYSXQK.js +243 -0
  72. package/dist/cli-LK3V4RI5.js +36 -0
  73. package/dist/cli-LQOHATY2.js +126 -0
  74. package/dist/cli-MJUYJIEP.js +13 -0
  75. package/dist/cli-MJV47HKI.js +143 -0
  76. package/dist/cli-MMN4BPO4.js +145 -0
  77. package/dist/cli-MOPSZ3CS.js +88 -0
  78. package/dist/cli-MU5LB43S.js +136 -0
  79. package/dist/cli-MYJGMA6U.js +40 -0
  80. package/dist/cli-N24OHSAN.js +36 -0
  81. package/dist/cli-N45DREM4.js +99 -0
  82. package/dist/cli-N6H6T2E2.js +616 -0
  83. package/dist/cli-NROTDF5Y.js +182 -0
  84. package/dist/cli-O5ABH2WK.js +226 -0
  85. package/dist/cli-OMWC75CC.js +256 -0
  86. package/dist/cli-OXAUOWCN.js +50 -0
  87. package/dist/cli-PGCIHPU7.js +143 -0
  88. package/dist/cli-Q6ZBZYK2.js +35 -0
  89. package/dist/cli-QUNIRH7A.js +57 -0
  90. package/dist/cli-QUSCIUOM.js +142 -0
  91. package/dist/cli-QVASWX2A.js +187 -0
  92. package/dist/cli-QWQMPCL6.js +253 -0
  93. package/dist/cli-QY5NZAR7.js +97 -0
  94. package/dist/cli-R2MUZQE2.js +62 -0
  95. package/dist/cli-RCIWBCXD.js +36 -0
  96. package/dist/cli-RLEGRWFM.js +81 -0
  97. package/dist/cli-RSW6EBBD.js +89 -0
  98. package/dist/cli-RZITKPJX.js +367 -0
  99. package/dist/cli-S5IVGDDD.js +32 -0
  100. package/dist/cli-SRHBXZCN.js +159 -0
  101. package/dist/cli-TDSQSCX4.js +131 -0
  102. package/dist/cli-TIDQ4WUE.js +257 -0
  103. package/dist/cli-TT36JCU5.js +370 -0
  104. package/dist/cli-TTKICM5P.js +100 -0
  105. package/dist/cli-TTMBBEJC.js +131 -0
  106. package/dist/cli-UMEBPAZQ.js +16 -0
  107. package/dist/cli-UNAJ2OTE.js +15 -0
  108. package/dist/cli-UZZFNXRX.js +226 -0
  109. package/dist/cli-VDBW23SS.js +81 -0
  110. package/dist/cli-VL2P354N.js +46 -0
  111. package/dist/cli-VPRRICZA.js +304 -0
  112. package/dist/cli-VQ6HVQW4.js +4010 -0
  113. package/dist/cli-WR3NOY74.js +36 -0
  114. package/dist/cli-WU43JT4T.js +52 -0
  115. package/dist/cli-XAT25PRU.js +117 -0
  116. package/dist/cli-XOTNXEJA.js +124 -0
  117. package/dist/cli-XSLNH5PR.js +6417 -0
  118. package/dist/cli-XSVGKI3R.js +39 -0
  119. package/dist/cli-XZCJIKIV.js +124 -0
  120. package/dist/cli-Y3DDNMPX.js +97 -0
  121. package/dist/cli-Y3O5F4JN.js +90 -0
  122. package/dist/cli-YOTGR3NB.js +82 -0
  123. package/dist/cli-Z56ZIVA6.js +97 -0
  124. package/dist/cli-ZBN5KAIB.js +59 -0
  125. package/dist/cli-ZDOTXEKL.js +31 -0
  126. package/dist/cli-ZDUADFBY.js +88 -0
  127. package/dist/cli-ZJFQ7EEA.js +131 -0
  128. package/dist/cli-ZTWOE3ZT.js +65 -0
  129. package/dist/cli.js +148 -43093
  130. package/dist/client/build-surfaces.d.ts +33 -0
  131. package/dist/client/dev-server.d.ts +6 -0
  132. package/dist/client/index.d.ts +1 -0
  133. package/dist/client/playwright.d.ts +62 -0
  134. package/dist/client.js +228 -48
  135. package/dist/core/session.d.ts +15 -1
  136. package/dist/dev/console/assets/{index-BVF8exas.js → index-CuMOOH9m.js} +1 -1
  137. package/dist/dev/console/index.html +1 -1
  138. package/dist/dev/shell.d.ts +19 -0
  139. package/dist/dev/surfaces.d.ts +7 -0
  140. package/dist/docs/ai-agents.md +1 -1
  141. package/dist/docs/api/index.md +14 -12
  142. package/dist/docs/api/sdk-tools-client.md +29 -0
  143. package/dist/docs/api/sdk-tools-playwright.md +104 -0
  144. package/dist/docs/changelog.md +34 -0
  145. package/dist/docs/cli-and-dev-server.md +21 -0
  146. package/dist/docs/cli-reference.md +45 -31
  147. package/dist/docs/environment-variables.md +6 -0
  148. package/dist/docs/getting-started.md +1 -1
  149. package/dist/docs/guides/designing-a-game.md +29 -4
  150. package/dist/docs/guides/starter-game.md +3 -3
  151. package/dist/docs/guides/testing.md +33 -18
  152. package/dist/docs/guides/upgrading.md +19 -2
  153. package/dist/docs/page-index.md +10 -9
  154. package/dist/docs/recipes/e2e-testing.md +19 -20
  155. package/dist/playwright.js +32232 -0
  156. package/dist/templates/package/CLAUDE.md.template +7 -346
  157. package/dist/templates/package/claude/rules/workflow-create-engine.md +2 -2
  158. package/dist/templates/package/claude/rules/workflow-create-guide.md +2 -2
  159. package/dist/templates/package/claude/rules/workflow-create-user-interface.md +1 -1
  160. package/dist/templates/package/claude/rules/workflow-test-engine-or-ui.md +1 -1
  161. package/dist/templates/package/claude/rules/workflow-update-sdk-version.md +3 -3
  162. package/dist/templates/package/global-setup.ts.template +7 -18
  163. package/dist/templates/package/playwright.config.ts.liquid +8 -11
  164. package/dist/templates/starter-game/playwright.config.ts +8 -11
  165. package/dist/templates/starter-game/testing/e2e/game.spec.ts +1 -1
  166. package/dist/templates/starter-game/testing/e2e/global-setup.ts +7 -18
  167. package/dist/utils/prompt.d.ts +5 -5
  168. package/dist/utils/resource-scan.d.ts +39 -0
  169. package/package.json +7 -3
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ CliError
4
+ } from "./cli-N6H6T2E2.js";
5
+
6
+ // cli/utils/input-source.ts
7
+ import { readFileSync } from "fs";
8
+
9
+ // cli/utils/stdin.ts
10
+ var reads = /* @__PURE__ */ new WeakMap();
11
+ function readStdin() {
12
+ const stdin = process.stdin;
13
+ if (stdin.isTTY) return Promise.resolve(null);
14
+ const previous = reads.get(stdin);
15
+ if (previous) return previous;
16
+ const read = new Promise((resolve, reject) => {
17
+ let data = "";
18
+ stdin.setEncoding("utf-8");
19
+ stdin.on("data", (chunk) => {
20
+ data += chunk;
21
+ });
22
+ stdin.on("end", () => resolve(data.trim() || null));
23
+ stdin.on("error", reject);
24
+ });
25
+ reads.set(stdin, read);
26
+ return read;
27
+ }
28
+
29
+ // cli/utils/input-source.ts
30
+ async function resolveInputSource(positional, filePath) {
31
+ if (positional) {
32
+ return { kind: "json", json: positional };
33
+ }
34
+ if (filePath) {
35
+ try {
36
+ return { kind: "json", json: readFileSync(filePath, "utf-8") };
37
+ } catch (error) {
38
+ throw new CliError(
39
+ "FILE_NOT_FOUND",
40
+ `Could not read file "${filePath}"
41
+ ` + (error instanceof Error ? error.message : "Unknown error")
42
+ );
43
+ }
44
+ }
45
+ const stdinContent = await readStdin();
46
+ if (stdinContent !== null) {
47
+ return { kind: "json", json: stdinContent };
48
+ }
49
+ return { kind: "none" };
50
+ }
51
+
52
+ export {
53
+ resolveInputSource
54
+ };
@@ -0,0 +1,202 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ REMOVED_CONFIGURATION_SCHEMA,
4
+ REMOVED_CONFIGURATION_SURFACES,
5
+ REMOVED_DEMO,
6
+ REMOVED_GAME_CONFIGURATION,
7
+ REMOVED_UI_USES,
8
+ RENAMED_SCENARIO_CONFIGURATION,
9
+ findResourceMeta,
10
+ isNamelessInterface,
11
+ removedFromBundle
12
+ } from "./cli-VQ6HVQW4.js";
13
+ import {
14
+ resourceExample
15
+ } from "./cli-F2D4GGUA.js";
16
+ import {
17
+ CliError
18
+ } from "./cli-N6H6T2E2.js";
19
+
20
+ // cli/utils/validators.ts
21
+ var PACKAGE_IDENTIFIER_PATTERN = /^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$/;
22
+ var RESOURCE_IDENTIFIER_PATTERN = /^[a-z][a-z0-9_]*$/;
23
+ function getPackageIdentifierError(identifier) {
24
+ if (!identifier || !identifier.trim()) {
25
+ return "Identifier is required";
26
+ }
27
+ const trimmed = identifier.trim();
28
+ if (!trimmed.includes(".")) {
29
+ return "Identifier must contain at least one dot (e.g., com.example.name)";
30
+ }
31
+ if (trimmed.startsWith(".") || trimmed.endsWith(".")) {
32
+ return "Identifier cannot start or end with a dot";
33
+ }
34
+ if (/^\d/.test(trimmed)) {
35
+ return "Identifier must start with a lowercase letter";
36
+ }
37
+ if (/[A-Z]/.test(trimmed)) {
38
+ return "Identifier must be lowercase only";
39
+ }
40
+ if (!PACKAGE_IDENTIFIER_PATTERN.test(trimmed)) {
41
+ return "Identifier must be in namespace format: lowercase segments separated by dots";
42
+ }
43
+ return "";
44
+ }
45
+ function getResourceIdentifierError(identifier) {
46
+ if (!identifier || !identifier.trim()) {
47
+ return "Identifier is required";
48
+ }
49
+ const trimmed = identifier.trim();
50
+ if (trimmed.includes(".")) {
51
+ return "A resource is named by its directory, so its identifier is a single name with no dots";
52
+ }
53
+ if (!RESOURCE_IDENTIFIER_PATTERN.test(trimmed)) {
54
+ return "Identifier must start with a lowercase letter and contain only lowercase letters, numbers, and underscores";
55
+ }
56
+ return "";
57
+ }
58
+ var VERSION_PATTERN = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
59
+ function getVersionError(version) {
60
+ if (!version || !version.trim()) {
61
+ return "Version is required";
62
+ }
63
+ if (!VERSION_PATTERN.test(version.trim())) {
64
+ return "Version must be in semantic version format (e.g., 1.0.0)";
65
+ }
66
+ return "";
67
+ }
68
+ function assertShortIdentifier(identifier) {
69
+ if (typeof identifier !== "string" || !identifier.includes(".")) return;
70
+ throw new CliError(
71
+ "USAGE_BAD_ARGUMENT",
72
+ `Identifier "${identifier}" is in the old long form. A resource is named by its directory inside its package, so use "${identifier.split(".").pop()}".`
73
+ );
74
+ }
75
+
76
+ // cli/commands/resources/shared/authored-input.ts
77
+ function withExample(message, type, command) {
78
+ return new CliError(
79
+ "INPUT_INVALID",
80
+ `${message}
81
+
82
+ Expected format:
83
+ ${resourceExample(type, command)}`
84
+ );
85
+ }
86
+ function parseAuthoredInput(json, type, command) {
87
+ let input;
88
+ try {
89
+ input = JSON.parse(json);
90
+ } catch (error) {
91
+ throw withExample(
92
+ "Failed to parse JSON definition\n" + (error instanceof Error ? error.message : "Unknown error"),
93
+ type,
94
+ command
95
+ );
96
+ }
97
+ if (input === null || typeof input !== "object" || Array.isArray(input)) {
98
+ throw withExample("A definition is a JSON object.", type, command);
99
+ }
100
+ const bundle = input;
101
+ const meta = findResourceMeta(type);
102
+ if (meta) assertAuthorable(bundle, meta, type, command);
103
+ else assertNoRemovedManifestFields(bundle, (message) => withExample(message, type, command));
104
+ return bundle;
105
+ }
106
+ function assertNoRemovedManifestFields(manifest, toError = (message) => new CliError("INPUT_INVALID", message)) {
107
+ if (manifest.configuration !== void 0) throw toError(REMOVED_GAME_CONFIGURATION);
108
+ if (manifest.demo !== void 0) throw toError(REMOVED_DEMO);
109
+ if (manifest.configurationSurfaces !== void 0) {
110
+ throw toError(REMOVED_CONFIGURATION_SURFACES);
111
+ }
112
+ }
113
+ function readAuthoredBundle(request) {
114
+ const bundle = parseAuthoredInput(request.json, request.type, request.command);
115
+ const definition = bundle.definition ?? {};
116
+ const slot = findResourceMeta(request.type)?.slot;
117
+ const named = {
118
+ ...bundle,
119
+ definition: {
120
+ ...definition,
121
+ identifier: slot ?? definition.identifier ?? request.identifier
122
+ }
123
+ };
124
+ const validation = request.validate(named);
125
+ if (!validation.valid) {
126
+ throw new CliError(
127
+ "INPUT_INVALID",
128
+ `Validation error:
129
+ ${validation.errors}` + (request.validationHint ? `
130
+ ${request.validationHint}` : "")
131
+ );
132
+ }
133
+ return named;
134
+ }
135
+ function assertAuthorable(bundle, meta, type, command) {
136
+ const definition = bundle.definition;
137
+ const fields = definition !== null && typeof definition === "object" && !Array.isArray(definition) ? definition : {};
138
+ const label = meta.label.toLowerCase();
139
+ const Article = /^[aeiou]/.test(label) ? "An" : "A";
140
+ if (meta.slot && fields.identifier !== void 0) {
141
+ throw withExample(
142
+ `A game holds one ${label}, so it takes no \`identifier\`: it lives in the "${meta.slot}" slot, and the slot is the name everything downstream reads. Delete the field.`,
143
+ type,
144
+ command
145
+ );
146
+ }
147
+ if (!meta.slot) assertShortIdentifier(fields.identifier);
148
+ if (fields.configurationSchema !== void 0) {
149
+ throw withExample(REMOVED_CONFIGURATION_SCHEMA, type, command);
150
+ }
151
+ if (meta.type === "scenario" && fields.configuration !== void 0) {
152
+ throw withExample(RENAMED_SCENARIO_CONFIGURATION, type, command);
153
+ }
154
+ if (meta.type === "scenario" && fields.demo !== void 0) {
155
+ throw withExample(REMOVED_DEMO, type, command);
156
+ }
157
+ if (meta.kind === "ui" && fields.uses !== void 0) {
158
+ throw withExample(REMOVED_UI_USES, type, command);
159
+ }
160
+ if (meta.type === "engine" && fields.aggregate !== void 0) {
161
+ throw withExample(
162
+ "An engine is aggregate because it exports `InitAggregate` and `RunAggregate`, and the build reads that from the code, so it takes no `aggregate`. Delete the field, and pass `--aggregate` to scaffold logic with the pair.",
163
+ type,
164
+ command
165
+ );
166
+ }
167
+ if (isNamelessInterface(meta) && fields.locales !== void 0) {
168
+ throw withExample(
169
+ `A game holds one ${label}, so nothing labels it and the name is never shown. Delete \`locales\`; the screen's own strings belong in its \`src/i18n.ts\`.`,
170
+ type,
171
+ command
172
+ );
173
+ }
174
+ for (const removed of removedFromBundle(meta.type, bundle)) {
175
+ if (removed.field.path.join(".") === "definition.identifier") continue;
176
+ throw withExample(removed.explanation, type, command);
177
+ }
178
+ const layout = meta.layout;
179
+ if (!layout) return;
180
+ const [key, expected] = "logic" in layout ? ["logic", layout.logic] : ["ui", layout.ui];
181
+ if (bundle[key] === void 0) return;
182
+ const directory = "directory" in expected ? expected.directory : null;
183
+ const authored = bundle[key];
184
+ if (authored.entrypoint === expected.entrypoint && (directory === null ? authored.directory === void 0 : authored.directory === directory)) {
185
+ return;
186
+ }
187
+ const where = directory === null ? expected.entrypoint : `${directory}/${expected.entrypoint}`;
188
+ throw withExample(
189
+ `${Article} ${label} keeps its ${key === "logic" ? "code" : "entrypoint"} at "${where}", and the CLI writes that block itself. A different \`${key}\` is read by nothing, so it must say what is actually there.`,
190
+ type,
191
+ command
192
+ );
193
+ }
194
+
195
+ export {
196
+ getPackageIdentifierError,
197
+ getResourceIdentifierError,
198
+ getVersionError,
199
+ parseAuthoredInput,
200
+ assertNoRemovedManifestFields,
201
+ readAuthoredBundle
202
+ };
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ isJsonOutput,
4
+ recordWarning
5
+ } from "./cli-N6H6T2E2.js";
6
+
7
+ // cli/utils/logger.ts
8
+ var isVerbose = false;
9
+ function setVerboseMode(verbose) {
10
+ isVerbose = verbose;
11
+ }
12
+ function getVerboseMode() {
13
+ return isVerbose;
14
+ }
15
+ function progress(message, ...args) {
16
+ if (isJsonOutput()) console.error(message, ...args);
17
+ else console.log(message, ...args);
18
+ }
19
+ var logger = {
20
+ /**
21
+ * Log a message that should always appear (errors)
22
+ */
23
+ error: (message, ...args) => {
24
+ console.error(`\u274C ${message}`, ...args);
25
+ },
26
+ /**
27
+ * Log a warning message (always appears)
28
+ */
29
+ warn: (message, ...args) => {
30
+ console.warn(`\u26A0\uFE0F ${message}`, ...args);
31
+ recordWarning(message);
32
+ },
33
+ /**
34
+ * Log a success message (always appears)
35
+ */
36
+ success: (message, ...args) => {
37
+ progress(`\u2713 ${message}`, ...args);
38
+ },
39
+ /**
40
+ * Log an info message (only in verbose mode)
41
+ */
42
+ info: (message, ...args) => {
43
+ if (isVerbose) {
44
+ progress(message, ...args);
45
+ }
46
+ },
47
+ /**
48
+ * Log a debug message (only in verbose mode)
49
+ */
50
+ debug: (message, ...args) => {
51
+ if (isVerbose) {
52
+ progress(` ${message}`, ...args);
53
+ }
54
+ },
55
+ /**
56
+ * Log output section header
57
+ */
58
+ section: (message) => {
59
+ if (isVerbose) {
60
+ progress(`
61
+ ${message}`);
62
+ }
63
+ },
64
+ /**
65
+ * Log a blank line (only in verbose mode)
66
+ */
67
+ newline: () => {
68
+ if (isVerbose) {
69
+ progress("");
70
+ }
71
+ }
72
+ };
73
+
74
+ export {
75
+ setVerboseMode,
76
+ getVerboseMode,
77
+ logger
78
+ };
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ loadConfig
4
+ } from "./cli-VQ6HVQW4.js";
5
+ import "./cli-F2D4GGUA.js";
6
+ import "./cli-4YB3ROVR.js";
7
+ import {
8
+ printJson,
9
+ reportResult
10
+ } from "./cli-N6H6T2E2.js";
11
+
12
+ // cli/commands/resolve.ts
13
+ import { resolve } from "path";
14
+ async function resolveCommand(options) {
15
+ const configPath = resolve(options.workingDir, "seriousgaming.sdk.json");
16
+ const config = await loadConfig(configPath);
17
+ reportResult(config, () => printJson(config));
18
+ }
19
+ export {
20
+ resolveCommand
21
+ };
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ applyJsonPatch
4
+ } from "./cli-S5IVGDDD.js";
5
+ import {
6
+ findBundleFile
7
+ } from "./cli-OXAUOWCN.js";
8
+ import {
9
+ CliError
10
+ } from "./cli-N6H6T2E2.js";
11
+
12
+ // cli/utils/patch-resolution.ts
13
+ import { readFileSync } from "fs";
14
+ function resolvePatchedDefinition(args) {
15
+ let operations;
16
+ try {
17
+ operations = JSON.parse(args.patch);
18
+ } catch {
19
+ throw new CliError("INPUT_INVALID", "--patch must be a valid JSON Patch array");
20
+ }
21
+ const bundleFile = findBundleFile(args.workingDir, args.type, args.identifier);
22
+ if (!bundleFile) {
23
+ throw new CliError(
24
+ "RESOURCE_NOT_FOUND",
25
+ `${args.resourceLabel} "${args.identifier}" not found`
26
+ );
27
+ }
28
+ try {
29
+ const existing = JSON.parse(readFileSync(bundleFile, "utf-8"));
30
+ return JSON.stringify(applyJsonPatch(existing, operations));
31
+ } catch (error) {
32
+ throw new CliError("INPUT_INVALID", `Failed to apply patch: ${error.message}`);
33
+ }
34
+ }
35
+
36
+ export {
37
+ resolvePatchedDefinition
38
+ };
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ submitPatch,
4
+ submitSharedPatch,
5
+ tickCommand
6
+ } from "./cli-C6ZLPK2U.js";
7
+ import "./cli-6K3VQQUS.js";
8
+ import "./cli-WU43JT4T.js";
9
+ import "./cli-L7VYSXQK.js";
10
+ import "./cli-FQRVFGN6.js";
11
+ import "./cli-XSLNH5PR.js";
12
+ import "./cli-TDSQSCX4.js";
13
+ import "./cli-SRHBXZCN.js";
14
+ import "./cli-KGT5L7VZ.js";
15
+ import "./cli-4LKXZQ2B.js";
16
+ import "./cli-MMN4BPO4.js";
17
+ import "./cli-S5IVGDDD.js";
18
+ import "./cli-QUNIRH7A.js";
19
+ import "./cli-BYCHKSSH.js";
20
+ import "./cli-25RWY5BQ.js";
21
+ import "./cli-QWQMPCL6.js";
22
+ import "./cli-VQ6HVQW4.js";
23
+ import "./cli-F2D4GGUA.js";
24
+ import "./cli-4YB3ROVR.js";
25
+ import "./cli-N6H6T2E2.js";
26
+ export {
27
+ submitPatch,
28
+ submitSharedPatch,
29
+ tickCommand
30
+ };
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ normalizeSettingsSchema
4
+ } from "./cli-4SIWLHQO.js";
5
+ import {
6
+ CliError
7
+ } from "./cli-N6H6T2E2.js";
8
+
9
+ // cli/commands/resources/settings/defaults.ts
10
+ function assertEveryPropertyHasDefault(schema) {
11
+ const properties = normalizeSettingsSchema(schema).properties;
12
+ if (!properties || typeof properties !== "object") return;
13
+ const missing = Object.entries(properties).filter(
14
+ ([, property]) => property === null || typeof property !== "object" || !("default" in property)
15
+ ).map(([name]) => name);
16
+ if (missing.length === 0) return;
17
+ throw new CliError(
18
+ "INPUT_INVALID",
19
+ `Every settings property declares a default, and ${missing.map((name) => `"${name}"`).join(", ")} ${missing.length === 1 ? "does" : "do"} not. The default is the value a game plays with unless a scenario or the session overrides it, so add one.`
20
+ );
21
+ }
22
+
23
+ export {
24
+ assertEveryPropertyHasDefault
25
+ };