@bitmagic/cli 0.1.83-dev.0 → 0.1.83-dev.2

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 (199) hide show
  1. package/README.md +70 -1
  2. package/assets/skills/publishing-to-steam/SKILL.md +218 -0
  3. package/dist/assets/vxl-summary.d.ts +6 -20
  4. package/dist/assets/vxl-summary.js +9 -100
  5. package/dist/assets/vxl-summary.js.map +1 -1
  6. package/dist/cli.d.ts +1 -0
  7. package/dist/cli.js +2 -0
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands/check.js +5 -0
  10. package/dist/commands/check.js.map +1 -1
  11. package/dist/commands/forge.js +1 -1
  12. package/dist/commands/forge.js.map +1 -1
  13. package/dist/commands/import.js +2 -4
  14. package/dist/commands/import.js.map +1 -1
  15. package/dist/commands/init.js +0 -3
  16. package/dist/commands/init.js.map +1 -1
  17. package/dist/commands/ios.js +88 -136
  18. package/dist/commands/ios.js.map +1 -1
  19. package/dist/commands/promote.js +2 -4
  20. package/dist/commands/promote.js.map +1 -1
  21. package/dist/commands/publish.js +0 -1
  22. package/dist/commands/publish.js.map +1 -1
  23. package/dist/commands/steam-build.d.ts +67 -0
  24. package/dist/commands/steam-build.js +286 -0
  25. package/dist/commands/steam-build.js.map +1 -0
  26. package/dist/commands/steam-portal.d.ts +1 -0
  27. package/dist/commands/steam-portal.js +319 -0
  28. package/dist/commands/steam-portal.js.map +1 -0
  29. package/dist/commands/steam-upload.d.ts +37 -0
  30. package/dist/commands/steam-upload.js +172 -0
  31. package/dist/commands/steam-upload.js.map +1 -0
  32. package/dist/commands/steam.d.ts +1 -0
  33. package/dist/commands/steam.js +502 -0
  34. package/dist/commands/steam.js.map +1 -0
  35. package/dist/commands/verify.js +6 -0
  36. package/dist/commands/verify.js.map +1 -1
  37. package/dist/editor/asset-viewer.js +5 -4
  38. package/dist/editor/asset-viewer.js.map +1 -1
  39. package/dist/editor/game-info-panel.d.ts +2 -2
  40. package/dist/editor/game-info-panel.js +1 -2
  41. package/dist/editor/game-info-panel.js.map +1 -1
  42. package/dist/editor/game-info.d.ts +1 -3
  43. package/dist/editor/game-info.js +1 -2
  44. package/dist/editor/game-info.js.map +1 -1
  45. package/dist/editor/server.js +2 -3
  46. package/dist/editor/server.js.map +1 -1
  47. package/dist/editor/shell-page.js +9 -7
  48. package/dist/editor/shell-page.js.map +1 -1
  49. package/dist/forge/browser-host.d.ts +6 -12
  50. package/dist/forge/browser-host.js +5 -11
  51. package/dist/forge/browser-host.js.map +1 -1
  52. package/dist/ios/native-overrides.d.ts +27 -0
  53. package/dist/ios/native-overrides.js +87 -0
  54. package/dist/ios/native-overrides.js.map +1 -0
  55. package/dist/ios/record-validate.d.ts +1 -33
  56. package/dist/ios/record-validate.js +2 -100
  57. package/dist/ios/record-validate.js.map +1 -1
  58. package/dist/ios/store-bridge.d.ts +26 -0
  59. package/dist/ios/store-bridge.js +224 -0
  60. package/dist/ios/store-bridge.js.map +1 -0
  61. package/dist/ios/storekit-config.d.ts +15 -0
  62. package/dist/ios/storekit-config.js +106 -0
  63. package/dist/ios/storekit-config.js.map +1 -0
  64. package/dist/ios/xcode-template.d.ts +12 -3
  65. package/dist/ios/xcode-template.js +158 -27
  66. package/dist/ios/xcode-template.js.map +1 -1
  67. package/dist/package/collect-urls.d.ts +1 -1
  68. package/dist/package/collect-urls.js +10 -2
  69. package/dist/package/collect-urls.js.map +1 -1
  70. package/dist/package/offline-payload.d.ts +35 -0
  71. package/dist/package/offline-payload.js +142 -0
  72. package/dist/package/offline-payload.js.map +1 -0
  73. package/dist/package/packaged-check.d.ts +39 -0
  74. package/dist/package/packaged-check.js +104 -0
  75. package/dist/package/packaged-check.js.map +1 -0
  76. package/dist/package/transform.d.ts +4 -4
  77. package/dist/package/transform.js +3 -3
  78. package/dist/project/context.d.ts +7 -2
  79. package/dist/project/context.js +1 -2
  80. package/dist/project/context.js.map +1 -1
  81. package/dist/project/published-three.d.ts +14 -0
  82. package/dist/project/published-three.js +93 -0
  83. package/dist/project/published-three.js.map +1 -0
  84. package/dist/publish/bundle.d.ts +1 -1
  85. package/dist/publish/bundle.js +8 -3
  86. package/dist/publish/bundle.js.map +1 -1
  87. package/dist/publish/platform.d.ts +1 -1
  88. package/dist/publish/platform.js +1 -1
  89. package/dist/publish/source-zip.d.ts +0 -1
  90. package/dist/publish/source-zip.js +1 -2
  91. package/dist/publish/source-zip.js.map +1 -1
  92. package/dist/scaffold/aliases.js +8 -5
  93. package/dist/scaffold/aliases.js.map +1 -1
  94. package/dist/scaffold/engine-download.d.ts +1 -1
  95. package/dist/scaffold/engine-download.js +1 -1
  96. package/dist/scaffold/export-zip.d.ts +0 -1
  97. package/dist/scaffold/export-zip.js +3 -6
  98. package/dist/scaffold/export-zip.js.map +1 -1
  99. package/dist/scaffold/import-project.js +1 -1
  100. package/dist/scaffold/project-export.js +0 -1
  101. package/dist/scaffold/project-export.js.map +1 -1
  102. package/dist/scaffold/project-files.d.ts +0 -1
  103. package/dist/scaffold/project-files.js +8 -5
  104. package/dist/scaffold/project-files.js.map +1 -1
  105. package/dist/scaffold/project.d.ts +15 -4
  106. package/dist/scaffold/project.js +30 -13
  107. package/dist/scaffold/project.js.map +1 -1
  108. package/dist/scaffold/skill-files.js +3 -1
  109. package/dist/scaffold/skill-files.js.map +1 -1
  110. package/dist/scaffold/steam-skill-files.d.ts +2 -0
  111. package/dist/scaffold/steam-skill-files.js +7 -0
  112. package/dist/scaffold/steam-skill-files.js.map +1 -0
  113. package/dist/scaffold/suggest-template.js +0 -1
  114. package/dist/scaffold/suggest-template.js.map +1 -1
  115. package/dist/scaffold/unity-skill-files.js +1 -1
  116. package/dist/steam/art-generate.d.ts +55 -0
  117. package/dist/steam/art-generate.js +173 -0
  118. package/dist/steam/art-generate.js.map +1 -0
  119. package/dist/steam/art-render.d.ts +25 -0
  120. package/dist/steam/art-render.js +157 -0
  121. package/dist/steam/art-render.js.map +1 -0
  122. package/dist/steam/art-use.d.ts +20 -0
  123. package/dist/steam/art-use.js +84 -0
  124. package/dist/steam/art-use.js.map +1 -0
  125. package/dist/steam/art.d.ts +98 -0
  126. package/dist/steam/art.js +243 -0
  127. package/dist/steam/art.js.map +1 -0
  128. package/dist/steam/check.d.ts +21 -0
  129. package/dist/steam/check.js +113 -0
  130. package/dist/steam/check.js.map +1 -0
  131. package/dist/steam/config.d.ts +57 -0
  132. package/dist/steam/config.js +145 -0
  133. package/dist/steam/config.js.map +1 -0
  134. package/dist/steam/electron-cache.d.ts +11 -0
  135. package/dist/steam/electron-cache.js +105 -0
  136. package/dist/steam/electron-cache.js.map +1 -0
  137. package/dist/steam/fuses.d.ts +16 -0
  138. package/dist/steam/fuses.js +75 -0
  139. package/dist/steam/fuses.js.map +1 -0
  140. package/dist/steam/icon-files.d.ts +16 -0
  141. package/dist/steam/icon-files.js +70 -0
  142. package/dist/steam/icon-files.js.map +1 -0
  143. package/dist/steam/image-info.d.ts +16 -0
  144. package/dist/steam/image-info.js +89 -0
  145. package/dist/steam/image-info.js.map +1 -0
  146. package/dist/steam/launch-check.d.ts +12 -0
  147. package/dist/steam/launch-check.js +101 -0
  148. package/dist/steam/launch-check.js.map +1 -0
  149. package/dist/steam/media.d.ts +48 -0
  150. package/dist/steam/media.js +151 -0
  151. package/dist/steam/media.js.map +1 -0
  152. package/dist/steam/package-macos.d.ts +52 -0
  153. package/dist/steam/package-macos.js +268 -0
  154. package/dist/steam/package-macos.js.map +1 -0
  155. package/dist/steam/package-windows.d.ts +24 -0
  156. package/dist/steam/package-windows.js +84 -0
  157. package/dist/steam/package-windows.js.map +1 -0
  158. package/dist/steam/paths.d.ts +37 -0
  159. package/dist/steam/paths.js +45 -0
  160. package/dist/steam/paths.js.map +1 -0
  161. package/dist/steam/playtest-shots.d.ts +18 -0
  162. package/dist/steam/playtest-shots.js +83 -0
  163. package/dist/steam/playtest-shots.js.map +1 -0
  164. package/dist/steam/portal-recipes.d.ts +25 -0
  165. package/dist/steam/portal-recipes.js +61 -0
  166. package/dist/steam/portal-recipes.js.map +1 -0
  167. package/dist/steam/portal.d.ts +58 -0
  168. package/dist/steam/portal.js +340 -0
  169. package/dist/steam/portal.js.map +1 -0
  170. package/dist/steam/raster.d.ts +59 -0
  171. package/dist/steam/raster.js +285 -0
  172. package/dist/steam/raster.js.map +1 -0
  173. package/dist/steam/shell-files.d.ts +17 -0
  174. package/dist/steam/shell-files.js +268 -0
  175. package/dist/steam/shell-files.js.map +1 -0
  176. package/dist/steam/specs.d.ts +61 -0
  177. package/dist/steam/specs.js +103 -0
  178. package/dist/steam/specs.js.map +1 -0
  179. package/dist/steam/steampipe.d.ts +46 -0
  180. package/dist/steam/steampipe.js +170 -0
  181. package/dist/steam/steampipe.js.map +1 -0
  182. package/dist/steam/store-copy.d.ts +89 -0
  183. package/dist/steam/store-copy.js +221 -0
  184. package/dist/steam/store-copy.js.map +1 -0
  185. package/dist/steam/tags.d.ts +9 -0
  186. package/dist/steam/tags.js +49 -0
  187. package/dist/steam/tags.js.map +1 -0
  188. package/dist/steam/trailer.d.ts +34 -0
  189. package/dist/steam/trailer.js +141 -0
  190. package/dist/steam/trailer.js.map +1 -0
  191. package/dist/verify/browser.d.ts +11 -0
  192. package/dist/verify/browser.js +195 -152
  193. package/dist/verify/browser.js.map +1 -1
  194. package/dist/verify/classify.d.ts +11 -2
  195. package/dist/verify/classify.js +16 -4
  196. package/dist/verify/classify.js.map +1 -1
  197. package/dist/verify/mobile-parity.d.ts +1 -1
  198. package/dist/verify/mobile-parity.js +1 -1
  199. package/package.json +5 -4
@@ -0,0 +1,319 @@
1
+ /**
2
+ * `bitmagic steam portal` — the Steamworks website in a Chrome window the creator logs in to,
3
+ * with commands any agent can drive it by: look at the page, fill a field, upload files, click.
4
+ * See steam/portal.ts for the window and the lines it will not cross.
5
+ */
6
+ import { defineCommand } from 'citty';
7
+ import * as fs from 'fs';
8
+ import * as os from 'os';
9
+ import * as path from 'path';
10
+ import { CliError } from '../errors.js';
11
+ import { createOutput } from '../output.js';
12
+ import { findDirWithFileUpwards, loadProjectContext } from '../project/context.js';
13
+ import { steamPaths } from '../steam/paths.js';
14
+ import { resolveSteamConfig } from '../steam/config.js';
15
+ import { readStoreCopy } from '../steam/store-copy.js';
16
+ import { STEAMWORKS_HOME, attachPortal, clickElement, closePortal, detach, fillElement, gotoUrl, lookAtPage, openPortal, pageText, portalDir, selectOption, setChecked, uploadToElement, } from '../steam/portal.js';
17
+ import { runPortalRecipe, RECIPES } from '../steam/portal-recipes.js';
18
+ const JSON_FLAG = {
19
+ type: 'boolean',
20
+ description: 'Print the result as JSON on stdout; all progress goes to stderr.',
21
+ };
22
+ /** Where `portal screenshot` writes: the project's check dir inside a project, else the portal dir. */
23
+ function screenshotTarget() {
24
+ const root = findDirWithFileUpwards('bitmagic.json');
25
+ return root !== null
26
+ ? path.join(steamPaths(root).checkDir, 'portal.png')
27
+ : path.join(portalDir(), 'portal.png');
28
+ }
29
+ async function withPage(fn) {
30
+ const { browser, page } = await attachPortal();
31
+ try {
32
+ return await fn(page);
33
+ }
34
+ finally {
35
+ await detach(browser);
36
+ }
37
+ }
38
+ function printLook(output, look) {
39
+ output.info(`${look.title} — ${look.url}${look.loggedIn ? '' : ' (not logged in)'}`);
40
+ if (look.headings.length > 0)
41
+ output.info(`Headings: ${look.headings.join(' | ')}`);
42
+ for (const notice of look.notices)
43
+ output.info(`Notice: ${notice}`);
44
+ for (const element of look.elements) {
45
+ const state = [
46
+ element.value !== undefined && element.value !== '' ? `= "${element.value}"` : '',
47
+ element.checked !== undefined ? (element.checked ? '[x]' : '[ ]') : '',
48
+ element.disabled ? '(disabled)' : '',
49
+ ].filter((part) => part !== '').join(' ');
50
+ output.info(` ${element.ref.padEnd(5)} ${element.role.padEnd(9)} ${element.label}${state ? ` ${state}` : ''}`);
51
+ }
52
+ }
53
+ /** A dotted path into store.json, e.g. `about` or `systemRequirements.windows.minimum.os`. */
54
+ function storeValue(field) {
55
+ const root = findDirWithFileUpwards('bitmagic.json');
56
+ if (root === null)
57
+ throw new CliError('--store reads .bitmagic/steam/store.json, so run it inside the game project.');
58
+ const copy = readStoreCopy(steamPaths(root).storePath);
59
+ if (copy === null)
60
+ throw new CliError('No store copy yet — `bitmagic steam init`, then write it.', 3);
61
+ let value = copy;
62
+ for (const key of field.split('.')) {
63
+ value = typeof value === 'object' && value !== null ? value[key] : undefined;
64
+ }
65
+ if (typeof value === 'number')
66
+ return String(value);
67
+ if (Array.isArray(value))
68
+ return value.join(', ');
69
+ if (typeof value !== 'string')
70
+ throw new CliError(`store.json has no text at "${field}".`);
71
+ return value;
72
+ }
73
+ const openCommand = defineCommand({
74
+ meta: {
75
+ name: 'open',
76
+ description: 'Open Steamworks in a dedicated Chrome window (or bring the open one to a page). The creator logs in there.',
77
+ },
78
+ args: {
79
+ url: { type: 'string', description: 'A Steamworks page to open instead of the home page.' },
80
+ app: { type: 'boolean', description: 'Open this game\'s app page (needs the app id from `steam init`).' },
81
+ json: JSON_FLAG,
82
+ },
83
+ async run({ args }) {
84
+ const output = createOutput(args.json === true);
85
+ let url = args.url;
86
+ if (args.app === true) {
87
+ const context = loadProjectContext();
88
+ const paths = steamPaths(context.root);
89
+ const config = resolveSteamConfig({ root: context.root, gameId: context.metadata.gameId, configPath: paths.configPath });
90
+ if (config.appId === undefined)
91
+ throw new CliError('No app id yet — `bitmagic steam init --app-id <id>`.', 3);
92
+ url = `${STEAMWORKS_HOME}apps/landing/${config.appId}`;
93
+ }
94
+ const result = await openPortal(url !== undefined ? { url } : {});
95
+ const look = await withPage(lookAtPage);
96
+ output.info(result.reused ? 'The Steamworks window was already open.' : 'Opened Steamworks in its own Chrome window.');
97
+ output.info(look.loggedIn
98
+ ? `Logged in. ${look.title} — ${look.url}`
99
+ : 'Not logged in yet. The creator logs in in that window — their password and Steam Guard code are theirs to type, '
100
+ + 'nobody else\'s. Then run `bitmagic steam portal status`.');
101
+ output.result({ ok: true, ...result, loggedIn: look.loggedIn, url: look.url });
102
+ },
103
+ });
104
+ const statusCommand = defineCommand({
105
+ meta: { name: 'status', description: 'Whether the window is open and logged in, and which page it is on.' },
106
+ args: { json: JSON_FLAG },
107
+ async run({ args }) {
108
+ const output = createOutput(args.json === true);
109
+ const look = await withPage(lookAtPage);
110
+ output.info(`${look.loggedIn ? 'Logged in' : 'NOT logged in'} — ${look.title} — ${look.url}`);
111
+ output.result({ ok: true, loggedIn: look.loggedIn, url: look.url, title: look.title });
112
+ },
113
+ });
114
+ const lookCommand = defineCommand({
115
+ meta: {
116
+ name: 'look',
117
+ description: 'Describe the current page: headings, notices, and every control numbered e1, e2, … for fill/click/upload.',
118
+ },
119
+ args: {
120
+ screenshot: { type: 'boolean', description: 'Also save a screenshot of the page and print its path.' },
121
+ json: JSON_FLAG,
122
+ },
123
+ async run({ args }) {
124
+ const output = createOutput(args.json === true);
125
+ const result = await withPage(async (page) => {
126
+ const look = await lookAtPage(page);
127
+ let shot;
128
+ if (args.screenshot === true) {
129
+ shot = screenshotTarget();
130
+ fs.mkdirSync(path.dirname(shot), { recursive: true });
131
+ await page.screenshot({ path: shot, fullPage: false });
132
+ }
133
+ return { look, shot };
134
+ });
135
+ printLook(output, result.look);
136
+ if (result.shot)
137
+ output.info(`Screenshot: ${result.shot}`);
138
+ output.result({ ok: true, ...result.look, ...(result.shot ? { screenshot: result.shot } : {}) });
139
+ },
140
+ });
141
+ const textCommand = defineCommand({
142
+ meta: { name: 'text', description: 'Print the page\'s visible text — to read instructions, errors and what was saved.' },
143
+ args: { max: { type: 'string', description: 'Characters to print (default 20000).' }, json: JSON_FLAG },
144
+ async run({ args }) {
145
+ const output = createOutput(args.json === true);
146
+ const text = await withPage((page) => pageText(page, args.max !== undefined ? Number(args.max) : 20_000));
147
+ output.info(text);
148
+ output.result({ ok: true, text });
149
+ },
150
+ });
151
+ const screenshotCommand = defineCommand({
152
+ meta: { name: 'screenshot', description: 'Save a screenshot of the page and print its path, to look at it.' },
153
+ args: { full: { type: 'boolean', description: 'The whole scrolling page, not just the window.' }, json: JSON_FLAG },
154
+ async run({ args }) {
155
+ const output = createOutput(args.json === true);
156
+ const target = screenshotTarget();
157
+ fs.mkdirSync(path.dirname(target), { recursive: true });
158
+ await withPage((page) => page.screenshot({ path: target, fullPage: args.full === true }));
159
+ output.info(target);
160
+ output.result({ ok: true, path: target });
161
+ },
162
+ });
163
+ const gotoCommand = defineCommand({
164
+ meta: { name: 'goto', description: 'Go to a Steamworks page (full URL, or a path such as /apps/landing/<appid>).' },
165
+ args: { url: { type: 'positional', required: true, description: 'URL or path on partner.steamgames.com.' }, json: JSON_FLAG },
166
+ async run({ args }) {
167
+ const output = createOutput(args.json === true);
168
+ const look = await withPage(async (page) => {
169
+ await gotoUrl(page, args.url);
170
+ return lookAtPage(page);
171
+ });
172
+ printLook(output, look);
173
+ output.result({ ok: true, ...look });
174
+ },
175
+ });
176
+ const clickCommand = defineCommand({
177
+ meta: {
178
+ name: 'click',
179
+ description: 'Click an element by its ref from `look`. Submit/publish/release/pay/delete buttons need --approved.',
180
+ },
181
+ args: {
182
+ ref: { type: 'positional', required: true, description: 'An element ref from `look`, e.g. e12.' },
183
+ approved: {
184
+ type: 'boolean',
185
+ description: 'The creator has explicitly approved THIS step (a submission, publish, release, payment or deletion).',
186
+ },
187
+ json: JSON_FLAG,
188
+ },
189
+ async run({ args }) {
190
+ const output = createOutput(args.json === true);
191
+ const result = await withPage(async (page) => {
192
+ const label = await clickElement(page, args.ref, { approved: args.approved === true });
193
+ await page.waitForTimeout(800);
194
+ return { label, look: await lookAtPage(page) };
195
+ });
196
+ output.info(`Clicked "${result.label}".`);
197
+ printLook(output, result.look);
198
+ output.result({ ok: true, clicked: result.label, ...result.look });
199
+ },
200
+ });
201
+ const fillCommand = defineCommand({
202
+ meta: {
203
+ name: 'fill',
204
+ description: 'Type into a field by its ref: --value text, --file <path>, or --store <field of store.json>. Never a password.',
205
+ },
206
+ args: {
207
+ ref: { type: 'positional', required: true, description: 'An element ref from `look`.' },
208
+ value: { type: 'string', description: 'The text to put in the field.' },
209
+ file: { type: 'string', description: 'Read the text from this file.' },
210
+ store: { type: 'string', description: 'Take the text from .bitmagic/steam/store.json, e.g. about, shortDescription, systemRequirements.windows.minimum.os.' },
211
+ json: JSON_FLAG,
212
+ },
213
+ async run({ args }) {
214
+ const output = createOutput(args.json === true);
215
+ const sources = [args.value, args.file, args.store].filter((source) => source !== undefined);
216
+ if (sources.length !== 1)
217
+ throw new CliError('Pass exactly one of --value, --file or --store.');
218
+ const value = args.value ?? (args.file !== undefined ? fs.readFileSync(path.resolve(args.file), 'utf-8') : storeValue(args.store ?? ''));
219
+ await withPage((page) => fillElement(page, args.ref, value));
220
+ output.info(`Filled ${args.ref} (${value.length} characters). Nothing is saved until the page's own Save is clicked.`);
221
+ output.result({ ok: true, ref: args.ref, characters: value.length });
222
+ },
223
+ });
224
+ const uploadCommand = defineCommand({
225
+ meta: { name: 'upload', description: 'Give files to a file input by its ref (comma-separated paths).' },
226
+ args: {
227
+ ref: { type: 'positional', required: true, description: 'A file input ref from `look`.' },
228
+ files: { type: 'positional', required: true, description: 'Comma-separated file paths.' },
229
+ json: JSON_FLAG,
230
+ },
231
+ async run({ args }) {
232
+ const output = createOutput(args.json === true);
233
+ const files = args.files.split(',').map((file) => path.resolve(file.trim().replace(/^~(?=$|\/)/, os.homedir())));
234
+ const look = await withPage(async (page) => {
235
+ await uploadToElement(page, args.ref, files);
236
+ await page.waitForTimeout(1500);
237
+ return lookAtPage(page);
238
+ });
239
+ output.info(`Gave ${files.length} file(s) to ${args.ref}.`);
240
+ printLook(output, look);
241
+ output.result({ ok: true, files, ...look });
242
+ },
243
+ });
244
+ const selectCommand = defineCommand({
245
+ meta: { name: 'select', description: 'Choose an option in a dropdown by its ref.' },
246
+ args: {
247
+ ref: { type: 'positional', required: true, description: 'A select ref from `look`.' },
248
+ option: { type: 'positional', required: true, description: 'The option\'s visible text (or value).' },
249
+ json: JSON_FLAG,
250
+ },
251
+ async run({ args }) {
252
+ const output = createOutput(args.json === true);
253
+ const chosen = await withPage((page) => selectOption(page, args.ref, args.option));
254
+ output.info(`Selected ${chosen.join(', ')} in ${args.ref}.`);
255
+ output.result({ ok: true, selected: chosen });
256
+ },
257
+ });
258
+ const checkCommand = defineCommand({
259
+ meta: { name: 'check', description: 'Tick (or with --off untick) a checkbox by its ref.' },
260
+ args: {
261
+ ref: { type: 'positional', required: true, description: 'A checkbox ref from `look`.' },
262
+ off: { type: 'boolean', description: 'Untick instead.' },
263
+ json: JSON_FLAG,
264
+ },
265
+ async run({ args }) {
266
+ const output = createOutput(args.json === true);
267
+ await withPage((page) => setChecked(page, args.ref, args.off !== true));
268
+ output.info(`${args.off === true ? 'Unticked' : 'Ticked'} ${args.ref}.`);
269
+ output.result({ ok: true });
270
+ },
271
+ });
272
+ const runCommand = defineCommand({
273
+ meta: {
274
+ name: 'run',
275
+ description: `Run a scripted Steamworks step from the store kit: ${Object.keys(RECIPES).join(', ')}. Stops before anything is submitted.`,
276
+ },
277
+ args: {
278
+ recipe: { type: 'positional', required: true, description: `One of: ${Object.keys(RECIPES).join(', ')}.` },
279
+ json: JSON_FLAG,
280
+ },
281
+ async run({ args }) {
282
+ const output = createOutput(args.json === true);
283
+ const context = loadProjectContext();
284
+ const result = await withPage((page) => runPortalRecipe(args.recipe, { page, root: context.root, gameId: context.metadata.gameId, log: output.info }));
285
+ output.result({ ok: true, ...result });
286
+ },
287
+ });
288
+ const closeCommand = defineCommand({
289
+ meta: { name: 'close', description: 'Close the Steamworks window. The login is kept in its profile for next time.' },
290
+ args: { json: JSON_FLAG },
291
+ async run({ args }) {
292
+ const output = createOutput(args.json === true);
293
+ const closed = await closePortal();
294
+ output.info(closed ? 'Closed the Steamworks window.' : 'No Steamworks window was open.');
295
+ output.result({ ok: true, closed });
296
+ },
297
+ });
298
+ export const steamPortalCommand = defineCommand({
299
+ meta: {
300
+ name: 'portal',
301
+ description: 'Drive the Steamworks website in a Chrome window the creator logs in to: look, fill, upload, click, run steps.',
302
+ },
303
+ subCommands: {
304
+ open: openCommand,
305
+ status: statusCommand,
306
+ look: lookCommand,
307
+ text: textCommand,
308
+ screenshot: screenshotCommand,
309
+ goto: gotoCommand,
310
+ click: clickCommand,
311
+ fill: fillCommand,
312
+ upload: uploadCommand,
313
+ select: selectCommand,
314
+ check: checkCommand,
315
+ run: runCommand,
316
+ close: closeCommand,
317
+ },
318
+ });
319
+ //# sourceMappingURL=steam-portal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steam-portal.js","sourceRoot":"","sources":["../../src/commands/steam-portal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAe,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,MAAM,EACN,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,eAAe,GAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGtE,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,kEAAkE;CACvE,CAAC;AAEX,uGAAuG;AACvG,SAAS,gBAAgB;I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AI,CAAC,MAAM,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAAC;QACzF,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAC;IAC9C,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,+GAA+G;KAC7H;IACD,WAAW,EAAE;QACX,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,WAAW;QACjB,UAAU,EAAE,iBAAiB;QAC7B,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,KAAK,EAAE,YAAY;QACnB,GAAG,EAAE,UAAU;QACf,KAAK,EAAE,YAAY;KACpB;CACF,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ declare const loginCommand: import("citty").CommandDef<{
2
+ readonly account: {
3
+ readonly type: "string";
4
+ readonly description: "The Steam login NAME to upload with. Remembered in .bitmagic/steam.json.";
5
+ };
6
+ readonly json: {
7
+ readonly type: "boolean";
8
+ readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
9
+ };
10
+ }>;
11
+ declare const uploadCommand: import("citty").CommandDef<{
12
+ readonly platform: {
13
+ readonly type: "string";
14
+ readonly description: "windows, macos, or all (default: every platform `steam build` produced).";
15
+ };
16
+ readonly branch: {
17
+ readonly type: "string";
18
+ readonly description: "Set the build live on this BETA branch. The default branch can only be set live in Steamworks.";
19
+ };
20
+ readonly description: {
21
+ readonly type: "string";
22
+ readonly description: "A note for this build in Steamworks' build list.";
23
+ };
24
+ readonly preview: {
25
+ readonly type: "boolean";
26
+ readonly description: "Run the build without uploading (SteamPipe preview), to check the scripts and file lists.";
27
+ };
28
+ readonly 'allow-unnotarized': {
29
+ readonly type: "boolean";
30
+ readonly description: "Upload a macOS app that was not notarized (a test build — Steam requires notarization).";
31
+ };
32
+ readonly json: {
33
+ readonly type: "boolean";
34
+ readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
35
+ };
36
+ }>;
37
+ export { loginCommand as steamLoginCommand, uploadCommand as steamUploadCommand };
@@ -0,0 +1,172 @@
1
+ /**
2
+ * `bitmagic steam login` and `bitmagic steam upload` — SteamPipe through steamcmd.
3
+ *
4
+ * `login` is the creator's, in their own terminal, once per machine: steamcmd asks for the Steam
5
+ * password and a Steam Guard code, and nobody but the account holder types those. `upload` then
6
+ * runs non-interactively on steamcmd's cached login — an agent can run it — and stops with that
7
+ * remedy if steamcmd ever asks for a password again.
8
+ */
9
+ import { defineCommand } from 'citty';
10
+ import * as fs from 'fs';
11
+ import * as path from 'path';
12
+ import { readJsonFile, writeJsonAtomic } from '../atomic-json.js';
13
+ import { CliError } from '../errors.js';
14
+ import { createOutput } from '../output.js';
15
+ import { loadProjectContext } from '../project/context.js';
16
+ import { computeFingerprint } from '../publish/fingerprint.js';
17
+ import { readBuildRecord } from './steam-build.js';
18
+ import { requireAppId, resolveSteamConfig, updateSteamConfigFile } from '../steam/config.js';
19
+ import { macosContentRoot, steamPaths, windowsContentRoot } from '../steam/paths.js';
20
+ import { appBuildVdf, depotBuildVdf, ensureSteamcmd, rosettaMissing, runSteamcmd, runSteamcmdInteractive, } from '../steam/steampipe.js';
21
+ const JSON_FLAG = {
22
+ type: 'boolean',
23
+ description: 'Print the result as JSON on stdout; all progress goes to stderr.',
24
+ };
25
+ const ROSETTA_REMEDY = 'steamcmd for macOS is an Intel program, and this Mac has no Rosetta 2. The creator installs it once with '
26
+ + '`softwareupdate --install-rosetta` (it asks them to accept Apple\'s licence), then runs this again.';
27
+ function requireAccount(account) {
28
+ if (account === undefined) {
29
+ throw new CliError('No Steam account on file for uploads. Run `bitmagic steam login --account <steam login name>` in a terminal — '
30
+ + 'use an account with the "Edit App Metadata" and "Publish App Changes To Steam" permissions for this app.', 3);
31
+ }
32
+ return account;
33
+ }
34
+ const loginCommand = defineCommand({
35
+ meta: {
36
+ name: 'login',
37
+ description: 'Log steamcmd in once on this machine. Interactive: the creator types their password and Steam Guard code.',
38
+ },
39
+ args: {
40
+ account: { type: 'string', description: 'The Steam login NAME to upload with. Remembered in .bitmagic/steam.json.' },
41
+ json: JSON_FLAG,
42
+ },
43
+ async run({ args }) {
44
+ const output = createOutput(args.json === true);
45
+ const context = loadProjectContext();
46
+ const paths = steamPaths(context.root);
47
+ if (args.account !== undefined)
48
+ updateSteamConfigFile(paths.configPath, { account: args.account.trim() });
49
+ const config = resolveSteamConfig({ root: context.root, gameId: context.metadata.gameId, configPath: paths.configPath });
50
+ const account = requireAccount(config.account);
51
+ if (!process.stdin.isTTY || !process.stdout.isTTY) {
52
+ throw new CliError('This needs a real terminal: steamcmd asks for the Steam password and a Steam Guard code, and only the creator types '
53
+ + `those. Ask the creator to run \`bitmagic steam login --account ${account}\` in their own terminal.`, 3);
54
+ }
55
+ const executable = await ensureSteamcmd(output.info);
56
+ if (rosettaMissing())
57
+ throw new CliError(ROSETTA_REMEDY, 3);
58
+ output.info(`Starting steamcmd as ${account}. It updates itself on first run, then asks for the password and Steam Guard code.`);
59
+ const status = runSteamcmdInteractive(executable, ['+login', account, '+quit']);
60
+ if (status !== 0)
61
+ throw new CliError(`steamcmd exited with ${status}; the login did not complete.`);
62
+ const check = await runSteamcmd(executable, ['+login', account, '+quit'], () => undefined, 5 * 60_000);
63
+ if (check.needsLogin || !check.ok)
64
+ throw new CliError('steamcmd still asks for a password, so the login was not cached. Run `bitmagic steam login` again.');
65
+ output.info('steamcmd is logged in and remembers it. `bitmagic steam upload` can run without a password from now on.');
66
+ output.result({ ok: true, account });
67
+ },
68
+ });
69
+ function uploadsPath(root) {
70
+ return path.join(steamPaths(root).steampipeDir, 'uploads.json');
71
+ }
72
+ const uploadCommand = defineCommand({
73
+ meta: {
74
+ name: 'upload',
75
+ description: 'Upload the built depots with SteamPipe. The default branch is set live in Steamworks, by the creator.',
76
+ },
77
+ args: {
78
+ platform: { type: 'string', description: 'windows, macos, or all (default: every platform `steam build` produced).' },
79
+ branch: { type: 'string', description: 'Set the build live on this BETA branch. The default branch can only be set live in Steamworks.' },
80
+ description: { type: 'string', description: 'A note for this build in Steamworks\' build list.' },
81
+ preview: { type: 'boolean', description: 'Run the build without uploading (SteamPipe preview), to check the scripts and file lists.' },
82
+ 'allow-unnotarized': { type: 'boolean', description: 'Upload a macOS app that was not notarized (a test build — Steam requires notarization).' },
83
+ json: JSON_FLAG,
84
+ },
85
+ async run({ args }) {
86
+ const output = createOutput(args.json === true);
87
+ const context = loadProjectContext();
88
+ const paths = steamPaths(context.root);
89
+ const config = resolveSteamConfig({ root: context.root, gameId: context.metadata.gameId, configPath: paths.configPath });
90
+ const appId = requireAppId(config);
91
+ const account = requireAccount(config.account);
92
+ const record = readBuildRecord(context.root);
93
+ if (record === null)
94
+ throw new CliError('Nothing built yet. Run `bitmagic steam build` first.', 3);
95
+ if (record.fingerprint !== computeFingerprint(context.root)) {
96
+ output.info('Note: the game changed since `steam build`. This uploads the build as it was; run `steam build` again to ship the change.');
97
+ }
98
+ const wanted = args.platform === undefined || args.platform === 'all'
99
+ ? ['windows', 'macos'].filter((platform) => record[platform] !== undefined)
100
+ : args.platform.split(',').map((p) => p.trim());
101
+ const depots = [];
102
+ for (const platform of wanted) {
103
+ if (platform !== 'windows' && platform !== 'macos')
104
+ throw new CliError('--platform takes windows, macos or all.');
105
+ if (record[platform] === undefined)
106
+ throw new CliError(`No ${platform} build — run \`bitmagic steam build --platform ${platform}\`.`, 3);
107
+ const depotId = platform === 'windows' ? config.windowsDepot : config.macosDepot;
108
+ if (depotId === undefined) {
109
+ throw new CliError(`No ${platform} depot id on file. Pass it with \`bitmagic steam init --${platform === 'windows' ? 'windows' : 'mac'}-depot <id>\` (Steamworks → SteamPipe → Depots).`, 3);
110
+ }
111
+ depots.push({ depotId, contentRoot: platform === 'windows' ? windowsContentRoot(paths) : macosContentRoot(paths) });
112
+ }
113
+ if (depots.length === 0)
114
+ throw new CliError('No depot to upload.', 3);
115
+ if (wanted.includes('macos') && record.macos?.notarized !== true && args['allow-unnotarized'] !== true) {
116
+ throw new CliError('The macOS build is not notarized, and Steam requires notarization for new macOS apps. Build it notarized '
117
+ + '(`bitmagic steam build --platform macos`), or pass --allow-unnotarized for a private test branch.', 3);
118
+ }
119
+ fs.mkdirSync(paths.steampipeDir, { recursive: true });
120
+ const depotScripts = depots.map((depot) => {
121
+ const file = path.join(paths.steampipeDir, `depot_build_${depot.depotId}.vdf`);
122
+ fs.writeFileSync(file, depotBuildVdf(depot));
123
+ return { depotId: depot.depotId, file };
124
+ });
125
+ const description = [`${record.version} (${record.buildNumber})`, args.description].filter(Boolean).join(' — ');
126
+ const appScript = path.join(paths.steampipeDir, `app_build_${appId}.vdf`);
127
+ fs.writeFileSync(appScript, appBuildVdf({
128
+ appId,
129
+ description,
130
+ buildOutput: path.join(paths.steampipeDir, 'output'),
131
+ depotScripts,
132
+ ...(args.branch !== undefined ? { setLive: args.branch } : {}),
133
+ ...(args.preview === true ? { preview: true } : {}),
134
+ }));
135
+ const executable = await ensureSteamcmd(output.info);
136
+ if (rosettaMissing())
137
+ throw new CliError(ROSETTA_REMEDY, 3);
138
+ output.info(`Uploading ${depots.map((d) => d.depotId).join(' + ')} to app ${appId} as ${account}…`);
139
+ const run = await runSteamcmd(executable, ['+login', account, '+run_app_build', appScript, '+quit'], output.info);
140
+ if (run.needsLogin) {
141
+ throw new CliError(`steamcmd asked for a password: it is not logged in on this machine. Ask the creator to run \`bitmagic steam login --account ${account}\` in their own terminal, then upload again.`, 3);
142
+ }
143
+ if (!run.ok || (args.preview !== true && run.buildId === undefined)) {
144
+ throw new CliError(`The SteamPipe build did not finish. Its log is in ${path.join(paths.steampipeDir, 'output')}.`);
145
+ }
146
+ if (args.preview === true) {
147
+ output.info('Preview finished; nothing was uploaded.');
148
+ output.result({ ok: true, preview: true });
149
+ return;
150
+ }
151
+ const upload = {
152
+ buildId: run.buildId ?? '',
153
+ appId,
154
+ depots: depots.map((d) => d.depotId),
155
+ description,
156
+ branch: args.branch ?? null,
157
+ uploadedAt: new Date().toISOString(),
158
+ version: record.version,
159
+ buildNumber: record.buildNumber,
160
+ };
161
+ const history = readJsonFile(uploadsPath(context.root));
162
+ writeJsonAtomic(uploadsPath(context.root), [...(Array.isArray(history) ? history : []), upload]);
163
+ output.info(`Uploaded: build ${upload.buildId}.`);
164
+ output.info(args.branch !== undefined
165
+ ? `It is live on the "${args.branch}" branch.`
166
+ : `To ship it, set build ${upload.buildId} live on the default branch in Steamworks → SteamPipe → Builds — `
167
+ + `the creator approves that (\`bitmagic steam portal open --url https://partner.steamgames.com/apps/builds/${appId}\`).`);
168
+ output.result({ ok: true, ...upload });
169
+ },
170
+ });
171
+ export { loginCommand as steamLoginCommand, uploadCommand as steamUploadCommand };
172
+ //# sourceMappingURL=steam-upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steam-upload.js","sourceRoot":"","sources":["../../src/commands/steam-upload.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAsB,MAAM,kBAAkB,CAAC;A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