@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,88 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ deleteHookFiles,
4
+ findHookReferences
5
+ } from "./cli-4SIWLHQO.js";
6
+ import "./cli-IUS2YCD3.js";
7
+ import "./cli-QUNIRH7A.js";
8
+ import "./cli-J4UBELKF.js";
9
+ import {
10
+ loadPackageContext
11
+ } from "./cli-XSVGKI3R.js";
12
+ import "./cli-TT36JCU5.js";
13
+ import "./cli-OXAUOWCN.js";
14
+ import {
15
+ operationError,
16
+ recordOperationResult
17
+ } from "./cli-KSGB2ZLK.js";
18
+ import {
19
+ confirmAction
20
+ } from "./cli-ZTWOE3ZT.js";
21
+ import {
22
+ generateCommand
23
+ } from "./cli-LQOHATY2.js";
24
+ import "./cli-IEMKI7J7.js";
25
+ import "./cli-OMWC75CC.js";
26
+ import "./cli-BYCHKSSH.js";
27
+ import "./cli-25RWY5BQ.js";
28
+ import "./cli-QWQMPCL6.js";
29
+ import "./cli-VQ6HVQW4.js";
30
+ import "./cli-F2D4GGUA.js";
31
+ import {
32
+ logger
33
+ } from "./cli-4YB3ROVR.js";
34
+ import "./cli-N6H6T2E2.js";
35
+
36
+ // cli/commands/resources/hook/delete.ts
37
+ async function deleteHook(identifier, options) {
38
+ logger.info("\nDeleting hook...\n");
39
+ loadPackageContext(options.workingDir);
40
+ const references = findHookReferences({
41
+ packagePath: options.workingDir,
42
+ identifier
43
+ });
44
+ logger.info(`Hook: ${identifier}`);
45
+ if (references.length > 0) {
46
+ logger.info("\nThis hook is referenced in:");
47
+ for (const ref of references) {
48
+ logger.info(` - ${ref}`);
49
+ }
50
+ logger.info("\nThese references will be removed.");
51
+ }
52
+ const confirmed = await confirmAction(
53
+ { message: "Are you sure you want to delete this hook?" },
54
+ options.yes
55
+ );
56
+ if (!confirmed) {
57
+ logger.info("\nDeletion cancelled.\n");
58
+ return;
59
+ }
60
+ logger.info("");
61
+ const result = deleteHookFiles({
62
+ packagePath: options.workingDir,
63
+ identifier
64
+ });
65
+ if (!result.success) {
66
+ throw operationError(result, "Failed to delete hook files");
67
+ }
68
+ recordOperationResult(result);
69
+ for (const file of result.filesDeleted || []) {
70
+ logger.info(` \u2713 Deleted: ${file}`);
71
+ }
72
+ for (const ref of result.referencesRemoved || []) {
73
+ logger.info(` \u2713 Removed reference from: ${ref}`);
74
+ }
75
+ logger.info(" \u2713 Updated seriousgaming.sdk.json");
76
+ logger.info("\nRegenerating TypeScript types...\n");
77
+ try {
78
+ await generateCommand({ workingDir: options.workingDir });
79
+ logger.success("TypeScript types regenerated successfully!");
80
+ } catch (error) {
81
+ logger.warn("\nWarning: Failed to regenerate TypeScript types:");
82
+ logger.warn(error instanceof Error ? error.message : "Unknown error");
83
+ }
84
+ logger.success("Hook deleted successfully!");
85
+ }
86
+ export {
87
+ deleteHook
88
+ };
@@ -0,0 +1,131 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ promptForSettings
4
+ } from "./cli-ZDOTXEKL.js";
5
+ import {
6
+ loadResourceIdentifiers
7
+ } from "./cli-Q6ZBZYK2.js";
8
+ import {
9
+ readAuthoredBundle
10
+ } from "./cli-4VFZHLDG.js";
11
+ import {
12
+ resolveInputSource
13
+ } from "./cli-4UWFQNGF.js";
14
+ import {
15
+ createWaitingRoomUserInterfaceFiles
16
+ } from "./cli-4SIWLHQO.js";
17
+ import "./cli-IUS2YCD3.js";
18
+ import "./cli-QUNIRH7A.js";
19
+ import "./cli-J4UBELKF.js";
20
+ import {
21
+ loadPackageContext
22
+ } from "./cli-XSVGKI3R.js";
23
+ import {
24
+ presentFields
25
+ } from "./cli-TT36JCU5.js";
26
+ import "./cli-OXAUOWCN.js";
27
+ import {
28
+ BUILD_COMMAND,
29
+ generateTypes,
30
+ operationError,
31
+ printOperationResult
32
+ } from "./cli-KSGB2ZLK.js";
33
+ import {
34
+ checkbox,
35
+ input
36
+ } from "./cli-ZTWOE3ZT.js";
37
+ import "./cli-LQOHATY2.js";
38
+ import "./cli-IEMKI7J7.js";
39
+ import "./cli-OMWC75CC.js";
40
+ import "./cli-BYCHKSSH.js";
41
+ import "./cli-25RWY5BQ.js";
42
+ import "./cli-QWQMPCL6.js";
43
+ import {
44
+ validateSDKWaitingRoomUserInterface
45
+ } from "./cli-VQ6HVQW4.js";
46
+ import "./cli-F2D4GGUA.js";
47
+ import {
48
+ logger
49
+ } from "./cli-4YB3ROVR.js";
50
+ import "./cli-N6H6T2E2.js";
51
+
52
+ // cli/commands/resources/waiting-room/new.ts
53
+ async function createWaitingRoomUserInterface(definitionInput, options) {
54
+ logger.info("\nCreating new waiting room user interface...\n");
55
+ loadPackageContext(options.workingDir, {
56
+ suggestNewPackage: true
57
+ });
58
+ const inputSource = await resolveInputSource(definitionInput, options.file);
59
+ const jsonDefinition = inputSource.kind === "json" ? inputSource.json : null;
60
+ if (jsonDefinition) {
61
+ const uiInput = readAuthoredBundle({
62
+ json: jsonDefinition,
63
+ type: "waiting_room",
64
+ command: "new",
65
+ validate: validateSDKWaitingRoomUserInterface
66
+ });
67
+ logger.info("Creating waiting room user interface files...\n");
68
+ const result2 = await createWaitingRoomUserInterfaceFiles({
69
+ packagePath: options.workingDir,
70
+ name: "Waiting room",
71
+ definition: uiInput.definition
72
+ });
73
+ if (!result2.success) {
74
+ throw operationError(result2, "Failed to create waiting room user interface files");
75
+ }
76
+ logger.success("Waiting room user interface created successfully!");
77
+ printOperationResult(result2);
78
+ await generateTypes(options.workingDir);
79
+ logger.info("Next steps:");
80
+ logger.info(" 1. Edit the UI components: waiting_room/src/App.tsx");
81
+ logger.info(` 2. Run "${BUILD_COMMAND}" to build your package`);
82
+ return;
83
+ }
84
+ logger.info("No JSON definition provided. Starting interactive mode...\n");
85
+ const name = await input({
86
+ message: "Display name (human-readable):",
87
+ default: "Waiting room"
88
+ });
89
+ logger.info("");
90
+ const availableCapabilities = loadResourceIdentifiers(options.workingDir, "capability");
91
+ const reads = [];
92
+ const writes = [];
93
+ if (availableCapabilities.length > 0) {
94
+ logger.info("Select capabilities for this waiting room user interface.\n");
95
+ logger.info("Tip: Use arrow keys to navigate, space to select, enter to continue.\n");
96
+ const readCapabilities = await checkbox({
97
+ message: "Capabilities this waiting room UI reads from:",
98
+ choices: availableCapabilities.map((id) => ({ name: id, value: id })),
99
+ pageSize: 10
100
+ });
101
+ reads.push(...readCapabilities);
102
+ const writeCapabilities = await checkbox({
103
+ message: "Capabilities this waiting room UI writes to:",
104
+ choices: availableCapabilities.map((id) => ({ name: id, value: id })),
105
+ pageSize: 10
106
+ });
107
+ writes.push(...writeCapabilities);
108
+ logger.info("");
109
+ } else {
110
+ logger.info("No existing capabilities found in this package.\n");
111
+ }
112
+ const settings = await promptForSettings(options.workingDir, "waiting room user interface");
113
+ logger.info("Creating waiting room user interface files...\n");
114
+ const result = await createWaitingRoomUserInterfaceFiles({
115
+ packagePath: options.workingDir,
116
+ name,
117
+ definition: presentFields({ reads, writes, settings })
118
+ });
119
+ if (!result.success) {
120
+ throw operationError(result, "Failed to create waiting room user interface files");
121
+ }
122
+ logger.success("Waiting room user interface created successfully!");
123
+ printOperationResult(result);
124
+ await generateTypes(options.workingDir);
125
+ logger.info("Next steps:");
126
+ logger.info(" 1. Edit the UI components: waiting_room/src/App.tsx");
127
+ logger.info(` 2. Run "${BUILD_COMMAND}" to build your package`);
128
+ }
129
+ export {
130
+ createWaitingRoomUserInterface
131
+ };
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ CliError,
4
+ isJsonOutput
5
+ } from "./cli-N6H6T2E2.js";
6
+
7
+ // cli/utils/prompt.ts
8
+ var inquirer = () => import("@inquirer/prompts");
9
+ var override = null;
10
+ var assumeYes = false;
11
+ var usage;
12
+ function promptBlocker() {
13
+ if (override !== null) return override ? null : "prompts are disabled";
14
+ if (isJsonOutput()) return "JSON output is on";
15
+ if (process.env.CI) return "CI is set";
16
+ if (!process.stdin.isTTY || !process.stdout.isTTY) return "there is no terminal to ask on";
17
+ return null;
18
+ }
19
+ function setAssumeYes(value) {
20
+ assumeYes = value;
21
+ }
22
+ function setPromptUsage(value) {
23
+ usage = value;
24
+ }
25
+ function refusal(message) {
26
+ const blocker = promptBlocker();
27
+ if (blocker === null) return void 0;
28
+ return Promise.reject(promptRequired(message, blocker));
29
+ }
30
+ function promptRequired(message, blocker) {
31
+ return new CliError(
32
+ "PROMPT_REQUIRED",
33
+ `This command needs an answer to "${message.trim()}", and ${blocker}.`,
34
+ {
35
+ hint: "Pass the input instead: as an argument, with --file, or on stdin" + (usage ? `, e.g. ${usage}` : "") + "."
36
+ }
37
+ );
38
+ }
39
+ var input = ((config, context) => refusal(config.message) ?? inquirer().then((prompts) => prompts.input(config, context)));
40
+ var select = ((config, context) => refusal(config.message) ?? inquirer().then((prompts) => prompts.select(config, context)));
41
+ var checkbox = ((config, context) => refusal(config.message) ?? inquirer().then((prompts) => prompts.checkbox(config, context)));
42
+ var confirm = ((config, context) => refusal(config.message) ?? inquirer().then((prompts) => prompts.confirm(config, context)));
43
+ async function confirmAction(config, yes = false) {
44
+ if (yes || assumeYes) return true;
45
+ const blocker = promptBlocker();
46
+ if (blocker !== null) {
47
+ throw new CliError(
48
+ "PROMPT_REQUIRED",
49
+ `This command asks "${config.message.trim()}" before it continues, and ${blocker}.`,
50
+ { hint: "Pass --yes to confirm." }
51
+ );
52
+ }
53
+ const prompts = await inquirer();
54
+ return prompts.confirm({ message: config.message, default: config.default ?? false });
55
+ }
56
+
57
+ export {
58
+ setAssumeYes,
59
+ setPromptUsage,
60
+ input,
61
+ select,
62
+ checkbox,
63
+ confirm,
64
+ confirmAction
65
+ };