@bitmagic/cli 0.1.83-dev.6 → 0.1.83

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 (61) hide show
  1. package/README.md +49 -7
  2. package/dist/bug-report/dev-view.d.ts +10 -0
  3. package/dist/bug-report/dev-view.js +35 -0
  4. package/dist/bug-report/dev-view.js.map +1 -0
  5. package/dist/bug-report/send.d.ts +54 -0
  6. package/dist/bug-report/send.js +143 -0
  7. package/dist/bug-report/send.js.map +1 -0
  8. package/dist/cli.d.ts +29 -0
  9. package/dist/cli.js +4 -0
  10. package/dist/cli.js.map +1 -1
  11. package/dist/commands/build.d.ts +4 -0
  12. package/dist/commands/build.js +20 -3
  13. package/dist/commands/build.js.map +1 -1
  14. package/dist/commands/pages.d.ts +25 -0
  15. package/dist/commands/pages.js +87 -0
  16. package/dist/commands/pages.js.map +1 -0
  17. package/dist/commands/report-bug.d.ts +42 -0
  18. package/dist/commands/report-bug.js +98 -0
  19. package/dist/commands/report-bug.js.map +1 -0
  20. package/dist/commands/upgrade.d.ts +9 -2
  21. package/dist/commands/upgrade.js +27 -6
  22. package/dist/commands/upgrade.js.map +1 -1
  23. package/dist/editor/bug-report-panel.d.ts +23 -0
  24. package/dist/editor/bug-report-panel.js +191 -0
  25. package/dist/editor/bug-report-panel.js.map +1 -0
  26. package/dist/editor/hud-replay-page.d.ts +9 -0
  27. package/dist/editor/hud-replay-page.js +11 -1
  28. package/dist/editor/hud-replay-page.js.map +1 -1
  29. package/dist/editor/server.js +54 -1
  30. package/dist/editor/server.js.map +1 -1
  31. package/dist/editor/shell-page.js +11 -0
  32. package/dist/editor/shell-page.js.map +1 -1
  33. package/dist/project/context.d.ts +7 -0
  34. package/dist/project/context.js.map +1 -1
  35. package/dist/publish/bundle.d.ts +43 -0
  36. package/dist/publish/bundle.js +133 -29
  37. package/dist/publish/bundle.js.map +1 -1
  38. package/dist/publish/source-zip.d.ts +6 -0
  39. package/dist/publish/source-zip.js +1 -1
  40. package/dist/publish/source-zip.js.map +1 -1
  41. package/dist/scaffold/engine-capabilities.d.ts +4 -0
  42. package/dist/scaffold/engine-capabilities.js.map +1 -1
  43. package/dist/scaffold/game-migration.d.ts +25 -63
  44. package/dist/scaffold/game-migration.js +30 -439
  45. package/dist/scaffold/game-migration.js.map +1 -1
  46. package/dist/scaffold/github-pages.d.ts +83 -0
  47. package/dist/scaffold/github-pages.js +200 -0
  48. package/dist/scaffold/github-pages.js.map +1 -0
  49. package/dist/scaffold/import-codemod.d.ts +4 -3
  50. package/dist/scaffold/import-codemod.js +16 -34
  51. package/dist/scaffold/import-codemod.js.map +1 -1
  52. package/dist/scaffold/project-files.d.ts +11 -0
  53. package/dist/scaffold/project-files.js +21 -8
  54. package/dist/scaffold/project-files.js.map +1 -1
  55. package/dist/scaffold/skill-files.js +34 -3
  56. package/dist/scaffold/skill-files.js.map +1 -1
  57. package/dist/vendor/hud-theme/engine/hud/fonts.js +6 -4
  58. package/package.json +6 -6
  59. package/dist/scaffold/legacy-game-baselines.d.ts +0 -14
  60. package/dist/scaffold/legacy-game-baselines.js +0 -218
  61. package/dist/scaffold/legacy-game-baselines.js.map +0 -1
package/README.md CHANGED
@@ -199,6 +199,7 @@ browser reloads itself on every change and the assets panel shows each generatio
199
199
  | `bitmagic reload [--port <port>]` | Tell a running `bitmagic dev` to reload the browser now. For agents: run it when you finish a round of edits. Exits 0 and does nothing when no dev server is running. Reaches only this project's own server — never another project's, whatever port that happens to be on. |
200
200
  | `bitmagic verify [--timeout <ms>] [--renderer webgpu\|webgl] [--platform desktop\|mobile\|both] [--fast] [--watch]` | Build, boot the game in a headless browser, start the game the way a player would, and report what broke. That means clicking through whatever the pre-play screen asks for — a level chooser or any other `hud.startScreen.selections` step is answered with its first option, the same default the engine takes when a flow skips it — and then pressing the Play button. A game without the button passes as long as gameplay starts by itself (auto-starting genres, custom start UIs); a run where gameplay never starts fails. The settle is adaptive: the run ends as soon as the live engine proves stable gameplay (state, rendered frames, no fresh errors, player standing), with `--timeout` as the cap. The verdict includes live engine state — actual GPU backend, fps, player position, physics body count, gameplay events (see **Gameplay events** below) — recorded in `result.json`. `--renderer` pins the pipeline (default `webgpu`, what players run; a silent WebGPU→WebGL2 fallback **fails** the run, and `--renderer webgl` is the deliberate escape hatch). A run failing on a lost WebGL context retries once on software rendering automatically. `--fast` skips the screenshot pipeline (then there is no thumbnail candidate from this run). `--watch` keeps everything warm — incremental `tsc --watch`, one vite, one browser — and re-verifies on file change in seconds; `--fast` is the watch default (`--no-fast` restores the screenshot). `--platform` picks what the run emulates — see **Verifying the mobile path** below. Only one verify drives a browser at a time on a machine: a second one, from any project, waits its turn and says whom it is waiting for (see **One verify at a time** below). Every run also reports the engine's mobile-parity check: a desktop action with no touch button is a warning, and a **failure** when `game.json` declares `primaryPlatform: "mobile"`. Writes the artifacts the publish gate reads (see below). |
201
201
  | `bitmagic build [--single-file]` | Bundle the game into a single `.bitmagic/build/index.html`. The engine, your game and its data are inlined; three.js, Rapier and the other third-party packages load from a CDN at the versions your import map pins — the same shape a game published from bitmagic.ai has. `--single-file` inlines those too, for a game that has to run with no network (offline, `file://`, a packaged shell); the file is several megabytes bigger. Rarely needs to be run by hand — `publish` builds automatically when the project changed. |
202
+ | `bitmagic pages init [--force]` / `bitmagic build --pages` | Deploy the game to GitHub Pages as a static page. `pages init` writes `.github/workflows/bitmagic-pages.yml`, which runs `bitmagic build --pages` on every push to the default branch and deploys `.bitmagic/pages/`. See [GitHub Pages](#github-pages). |
202
203
  | `bitmagic publish [--visibility public\|coming-soon\|private] [--name <name>] [--description <desc>] [--force] [--single-file] [--version-url] [--no-qr]` | Verify-gate, build if needed, and upload straight to GCS. `--single-file` publishes the offline bundle described under `bitmagic build`; switching the flag between runs always rebuilds, since it changes nothing on disk for the reuse check to notice. **Keeps the game's current visibility**; a new game is private until published with `--visibility public`. Prints the link worth sharing: `bitmagic.ai/play/<ID>/` — the game's page, with its name, cover and comments — for a public or coming-soon game, and `bitmagic.ai/games/<ID>/` for a private one. Both always serve the newest publish, so a link handed out today keeps working after tomorrow's publish; `--version-url` also prints the URL of this one build (`.../indexN.html`), for pinning a bug report to it. Shows the shared URL as a QR code so you can scan it onto a phone — drawn in the terminal, or written to `.bitmagic/publish-qr.png` when it cannot be. `--no-qr` skips both. |
203
204
  | `bitmagic self-update [--tag latest\|dev]` | Update the **CLI itself** to the newest build of its line, installing into the place this CLI actually lives rather than wherever the `npm` on your `PATH` would put it — which under nvm is routinely somewhere else. Reads the project's line from `bitmagic.json` when there is one, so it also fixes a wrong-line install; `--tag` overrides. Verifies the version on disk moved, and refuses (naming the path) for an `npx` run, a source checkout, or an install shape it cannot recognise. Not to be confused with `upgrade`, which is about the project's engine. |
204
205
  | `bitmagic upgrade [--engine <version>] [--force] [--no-codemod] [--migrate-game]` | Refresh vendored platform files and the CLI's own skills to the currently published engine, and rewrite `src/` imports of engine modules that moved to their new paths (`--no-codemod` skips that). `--migrate-game` also turns an old `src/work/Game.ts` into a `VoxelGameBase` subclass when it can prove the result equivalent. Refuses a dirty git tree unless `--force`. Also records the project's `environment` in `bitmagic.json` if it has none yet — the engine it just vendored came from that api-server — and says so when it does. |
@@ -231,6 +232,7 @@ browser reloads itself on every change and the assets panel shows each generatio
231
232
  | `bitmagic levels <list\|add\|rename\|set-start\|remove> ...` | Manage the levels `forge` creates: which one boots, their names, registering a bake you already have, deleting one. Local, no network, no sparks. See **Managing levels** below. |
232
233
  | `bitmagic ios <build\|submit\|storekit> ...` | Ship the game as a native iOS app (Mac with Xcode). `build` packages every asset into the app, proves it boots offline on WebGPU and WebGL, and builds a Simulator app (`--run` launches it) or, with `--ipa --team <TEAMID>`, a signed store build; `submit` uploads that to App Store Connect / TestFlight. The game can sell App Store consumables through `engine.getInAppStore()` (the engine credits each purchase to its wallet exactly once); `storekit <id...>` writes `ios/StoreKit.storekit`, the local catalogue a run from Xcode buys from with no Apple account — run from `.bitmagic/ios/App/App.xcodeproj`, not `--run`. Everything under `.bitmagic/ios/` is regenerated each build; native code of your own goes in `ios/Sources/*.swift` and is compiled in every time. The Apple Developer account, agreements, banking and the products in App Store Connect are yours to set up. |
233
234
  | `bitmagic steam <init\|art\|screenshots\|trailer\|check\|build\|play\|login\|upload\|portal> ...` | Put the game on Steam. `init`, `art`, `screenshots`, `trailer` and `check` make the store page kit — every capsule, library image and icon at Steam's exact size from AI key art and a keyed logo, 1920x1080 gameplay screenshots, a 1080p trailer ending on the logo, and the store copy, held to Valve's rules. `build` makes the Windows depot and a signed, notarized universal macOS app (a Mac is needed for it), each proven to reach gameplay with no network; `play` opens it. `login` (the creator, once, in a terminal) and `upload` ship it with SteamPipe. `portal` drives the Steamworks website in a Chrome window the creator logs in to. See **Steam** below. |
235
+ | `bitmagic report-bug --message "..." [--screenshot <png>] [--no-source] [--env <env>]` | Report a bug in Bitmagic itself — the engine, the CLI or the dev view — to the Bitmagic team. Attaches a ZIP of the project source (the same archive `publish` leaves, so no `engine/`, binary assets or credential-shaped files; `--no-source` leaves it out), the errors the last `bitmagic verify` saw, and the CLI, engine and template versions. Needs a login, not Bitmagic Pro. Never prompts. The dev view's **⋯ → Report bug…** sends the same report with a screenshot. |
234
236
 
235
237
  Every command exits non-zero on failure with a single-line message (no stack trace) and, where a
236
238
  distinction is useful to an automated caller, a specific exit code — see **Exit codes** below.
@@ -842,6 +844,12 @@ clip, and drops the result into the project's assets, ready to play on a charact
842
844
  off for you — the note when it finishes says how much came off each end, and opening the clip shows
843
845
  you exactly where.
844
846
 
847
+ **Report bug…** in the same menu tells the Bitmagic team something in Bitmagic itself is broken —
848
+ the engine, the CLI or this view, not your game's own code. Describe what happened; the dialog
849
+ attaches a screenshot of the game, the runtime errors the game has thrown since the page opened,
850
+ and the project source (each can be switched off). It is the same report as `bitmagic report-bug`,
851
+ and lands where the Creator's **Report Bug** button does.
852
+
845
853
  ### The top bar
846
854
 
847
855
  The bar starts by saying **whose** view this is, because with two games open — and often two
@@ -865,7 +873,7 @@ never re-hosted, because that URL — the one every later generation inherits
865
873
 
866
874
  What you reach for all session sits in the bar: the **Game / Editor** tabs, **Auto-reload**, the
867
875
  status light, **Assets** (which shows whether the panel is open), **Screenshot** and **Reload**.
868
- Everything that opens a dialog and is wanted once a week — Published, and the two recorders — lives
876
+ Everything that opens a dialog and is wanted once a week — Published, the two recorders and Report bug — lives
869
877
  behind **⋯**, so the bar stops growing a button every time the CLI grows a feature.
870
878
 
871
879
  3010 still serves the game on its own, for a second window or a bookmark.
@@ -1695,6 +1703,30 @@ from, so `bitmagic verify` must have produced at least one screenshot — `scree
1695
1703
  stick — and note that writing them into `game.json` yourself would change the fingerprint and
1696
1704
  invalidate the verify you just checked.
1697
1705
 
1706
+ ### GitHub Pages
1707
+
1708
+ ```sh
1709
+ bitmagic pages init # writes .github/workflows/bitmagic-pages.yml — commit it
1710
+ bitmagic build --pages # what the workflow runs: .bitmagic/pages/index.html
1711
+ ```
1712
+
1713
+ Then, once, on GitHub: **Settings → Pages → Build and deployment → Source: GitHub Actions**. Every
1714
+ push to the default branch builds and deploys the game; the Actions tab can also run it by hand.
1715
+ The workflow pins the CLI version that wrote it, installs with your lockfile's package manager, and
1716
+ checks out Git LFS files. Run `bitmagic pages init` again after a CLI update to move the pin
1717
+ (`--force` replaces a workflow you edited).
1718
+
1719
+ The page is **static**: no Bitmagic sign-in, cloud saves, leaderboards, multiplayer or runtime AI,
1720
+ so a `github.io` page never calls Bitmagic's servers. The engine's own files (characters,
1721
+ animations) still load from the Bitmagic CDN; `"pagesHosting"` in `bitmagic.json` chooses that:
1722
+ `"bitmagic-cdn"` (the default), `"github-pages"` (the open engine's own asset site — useful only once
1723
+ that site exists), or the root URL of your own copy. It needs an engine that has the static page;
1724
+ an older one is refused with a pointer to `bitmagic upgrade`.
1725
+
1726
+ GitHub Pages allows 1 GB per site and has a soft bandwidth limit of 100 GB a month, and it is not
1727
+ meant to run a commercial business: a game run mainly as one fits `bitmagic publish` or another host
1728
+ better.
1729
+
1698
1730
  ### Poki export
1699
1731
 
1700
1732
  ```sh
@@ -1962,15 +1994,25 @@ levels), and `upgrade` repoints those nine known URLs at their VXL3 versions and
1962
1994
  player loader itself has a `src/work/Game.ts` that builds them and hands them over with
1963
1995
  `engine.setSpawner()` and friends: it keeps working (the engine adopts what it is handed, with a
1964
1996
  deprecation warning), and this flag rewrites it to today's
1965
- `class VoxelGame extends VoxelGameBase`. Every member identical to a released baseline is dropped;
1966
- your own fields, methods and helpers are kept; statements you added to `constructor`, `load`,
1967
- `update` or `dispose` move into the hook that runs at the same point (`onWorldLoaded`,
1968
- `onCameraReady`, `onPlayerReady`, `updateCamera`, `disposeGameplay`); and `VoxelGameBase.ts` is
1969
- added beside it. When it cannot prove that — a default statement edited or removed, code added
1970
- where no hook runs — it leaves the file unchanged and says why. The result must type-check with the
1997
+ `class VoxelGame extends VoxelGameBase`. A project started from a template is compared with that
1998
+ template's old `Game.ts` and rebuilt on its current one. Every member identical to a released
1999
+ version is dropped; your own fields, methods and helpers are kept, and so is a method of yours
2000
+ `VoxelGameBase` also has (as an override); statements you added to `constructor`, `load`, `update`
2001
+ or `dispose` move into the hook that runs at the same point (`onWorldLoaded`, `onCameraReady`,
2002
+ `onPlayerReady` — async when your code awaits —, `loadPlayer`, an override of a method called just
2003
+ there, `updatePlayer`, `updateWorld`, `updateCamera`, `disposeGameplay`); and `VoxelGameBase.ts` is
2004
+ added beside it. Two rules are looser than "the same point": code added mid-`update()` moves on to
2005
+ the next hook point of the same frame, and anything added to `dispose()` goes to
2006
+ `disposeGameplay()`. When it cannot prove the rest — a default statement edited or removed — it
2007
+ leaves the file unchanged and says why. The result must type-check with the
1971
2008
  project's own compiler or both files are put back, so run it with dependencies installed and a
1972
2009
  project that type-checks.
1973
2010
 
2011
+ An upgrade that finds the old `Game.ts` says so even without the flag, and whenever the file is left
2012
+ old it points at `engine/agent-docs/migrating-game-to-voxelgamebase.md`: the same rewrite as steps
2013
+ the project's agent can follow by hand, including where the automatic one gave up (`--json` carries
2014
+ `legacyGameFile` and `gameMigrationGuide`).
2015
+
1974
2016
  `.claude/settings.json` is merged rather than rewritten — it is where your permissions and your own
1975
2017
  hooks live. An upgrade adds the `bitmagic reload` Stop hook if it is missing and changes nothing
1976
2018
  else; if it cannot parse the file it leaves it entirely alone and says so.
@@ -0,0 +1,10 @@
1
+ /** A 4K PNG is a few MB, and base64 adds a third; the description and errors are a few KB. */
2
+ export declare const DEV_VIEW_BUG_REPORT_BODY_LIMIT_BYTES: number;
3
+ export interface DevViewBugReportRequest {
4
+ description: string;
5
+ includeSource: boolean;
6
+ screenshotPng?: Uint8Array;
7
+ runtimeErrors: string[];
8
+ }
9
+ /** The parsed request, or the reason it is refused, worded for the dialog. */
10
+ export declare function parseDevViewBugReport(body: unknown): DevViewBugReportRequest | string;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The body the dev view's "Report bug…" dialog posts to the sidecar's `POST /api/bug-report`
3
+ * (`editor/bug-report-panel.ts`), parsed before anything is zipped or uploaded.
4
+ */
5
+ import { MAX_DESCRIPTION_CHARS, MAX_RUNTIME_ERRORS, isPng } from './send.js';
6
+ /** A 4K PNG is a few MB, and base64 adds a third; the description and errors are a few KB. */
7
+ export const DEV_VIEW_BUG_REPORT_BODY_LIMIT_BYTES = 24 * 1024 * 1024;
8
+ /** The parsed request, or the reason it is refused, worded for the dialog. */
9
+ export function parseDevViewBugReport(body) {
10
+ if (typeof body !== 'object' || body === null || Array.isArray(body))
11
+ return 'Expected a JSON object.';
12
+ const raw = body;
13
+ const description = typeof raw.description === 'string' ? raw.description.trim() : '';
14
+ if (description === '')
15
+ return 'Describe the bug first.';
16
+ if (description.length > MAX_DESCRIPTION_CHARS)
17
+ return `Keep the description under ${MAX_DESCRIPTION_CHARS} characters.`;
18
+ let screenshotPng;
19
+ if (typeof raw.screenshotPngBase64 === 'string' && raw.screenshotPngBase64 !== '') {
20
+ const bytes = Buffer.from(raw.screenshotPngBase64, 'base64');
21
+ if (!isPng(bytes))
22
+ return 'The screenshot is not a PNG.';
23
+ screenshotPng = new Uint8Array(bytes);
24
+ }
25
+ const runtimeErrors = Array.isArray(raw.runtimeErrors)
26
+ ? raw.runtimeErrors.filter((e) => typeof e === 'string' && e.trim() !== '').slice(-MAX_RUNTIME_ERRORS)
27
+ : [];
28
+ return {
29
+ description,
30
+ includeSource: raw.includeSource !== false,
31
+ ...(screenshotPng ? { screenshotPng } : {}),
32
+ runtimeErrors,
33
+ };
34
+ }
35
+ //# sourceMappingURL=dev-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-view.js","sourceRoot":"","sources":["../../src/bug-report/dev-view.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAE7E,8FAA8F;AAC9F,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AASrE,8EAA8E;AAC9E,MAAM,UAAU,qBAAqB,CAAC,IAAa;IACjD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,yBAAyB,CAAC;IACvG,MAAM,GAAG,GAAG,IAA+B,CAAC;IAE5C,MAAM,WAAW,GAAG,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,IAAI,WAAW,KAAK,EAAE;QAAE,OAAO,yBAAyB,CAAC;IACzD,IAAI,WAAW,CAAC,MAAM,GAAG,qBAAqB;QAAE,OAAO,8BAA8B,qBAAqB,cAAc,CAAC;IAEzH,IAAI,aAAqC,CAAC;IAC1C,IAAI,OAAO,GAAG,CAAC,mBAAmB,KAAK,QAAQ,IAAI,GAAG,CAAC,mBAAmB,KAAK,EAAE,EAAE,CAAC;QAClF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;YAAE,OAAO,8BAA8B,CAAC;QACzD,aAAa,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QACpD,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC;QACnH,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;QACL,WAAW;QACX,aAAa,EAAE,GAAG,CAAC,aAAa,KAAK,KAAK;QAC1C,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3C,aAAa;KACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { Environment } from '../config/environments.js';
2
+ import { type ApiDeps } from '../http/client.js';
3
+ import type { ProjectMetadata } from '../project/context.js';
4
+ export declare const BUG_REPORT_BEGIN_PATH = "/api/cli/v1/bug-reports/begin";
5
+ export declare const BUG_REPORT_SUBMIT_PATH = "/api/cli/v1/bug-reports";
6
+ /** api-server's limits, mirrored so the CLI refuses before uploading anything. */
7
+ export declare const MAX_DESCRIPTION_CHARS = 2000;
8
+ export declare const MAX_RUNTIME_ERRORS = 20;
9
+ export type BugReportSurface = 'cli' | 'dev-view';
10
+ /**
11
+ * Whether `bytes` start with PNG's eight-byte signature. The upload is signed as image/png, and
12
+ * Slack shows nothing for an image block whose bytes are something else.
13
+ */
14
+ export declare function isPng(bytes: Uint8Array): boolean;
15
+ export interface BugReportContext {
16
+ gameName: string;
17
+ template: string;
18
+ engineVersion: string;
19
+ cliVersion: string;
20
+ platform: string;
21
+ environment: string;
22
+ lastPublishUrl?: string;
23
+ }
24
+ /** Where the report's archive goes — beside publish's, never on top of it. */
25
+ export declare function bugReportArchivePath(root: string): string;
26
+ export declare function collectBugReportContext(root: string, metadata: ProjectMetadata, environment: Environment): BugReportContext;
27
+ /**
28
+ * The errors the last `bitmagic verify` saw in the browser console, newest last. The CLI has no
29
+ * live game to ask, so this is the closest thing it has to "what went wrong at runtime".
30
+ */
31
+ export declare function readVerifyConsoleErrors(root: string): string[];
32
+ export interface SendBugReportInput {
33
+ root: string;
34
+ metadata: ProjectMetadata;
35
+ environment: Environment;
36
+ token: string;
37
+ description: string;
38
+ surface: BugReportSurface;
39
+ includeSource: boolean;
40
+ screenshotPng?: Uint8Array;
41
+ runtimeErrors?: string[];
42
+ }
43
+ export interface SendBugReportResult {
44
+ reportId: string;
45
+ sourceUploaded: boolean;
46
+ screenshotUploaded: boolean;
47
+ /** Credential-shaped files the archive left out, so the creator knows they were there. */
48
+ secretsOmitted: string[];
49
+ /** What went wrong without stopping the report — a failed upload, an undelivered Slack post. */
50
+ warnings: string[];
51
+ }
52
+ /** Throws a `CliError` the caller can show as-is; nothing is uploaded before this passes. */
53
+ export declare function validateBugReportDescription(description: string): string;
54
+ export declare function sendBugReport(input: SendBugReportInput, deps: ApiDeps, log?: (message: string) => void): Promise<SendBugReportResult>;
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Filing a GDK bug report: the one path behind both `bitmagic report-bug` and the dev view's
3
+ * "Report bug…" dialog, so the two cannot drift on what a report carries.
4
+ *
5
+ * What a report sends, in this order:
6
+ *
7
+ * 1. `POST /api/cli/v1/bug-reports/begin` — signed upload URLs for whichever files there are.
8
+ * 2. The source ZIP and the screenshot, PUT straight to storage. The ZIP is the publish lane's
9
+ * source archive (`buildSourceArchive`), so it already leaves out the vendored engine,
10
+ * credential-shaped files and binary assets; it is written to its own path so the archive the
11
+ * last publish left behind stays put.
12
+ * 3. `POST /api/cli/v1/bug-reports` — the description and a little context, which api-server posts
13
+ * to the same Slack channel the Creator's "Report Bug" button uses.
14
+ *
15
+ * An upload that fails does not cost the report: the description is the part that matters, and
16
+ * api-server links only the files that actually arrived.
17
+ */
18
+ import * as fs from 'fs';
19
+ import * as path from 'path';
20
+ import { apiPost } from '../http/client.js';
21
+ import { putSignedUrl } from '../http/signed-upload.js';
22
+ import { buildSourceIndex } from '../publish/fingerprint.js';
23
+ import { buildSourceArchive } from '../publish/source-zip.js';
24
+ import { readPublishRecord } from '../publish/record.js';
25
+ import { readGameName } from '../project/game-name.js';
26
+ import { currentCliVersion } from '../update/cli-version.js';
27
+ import { CliError } from '../errors.js';
28
+ export const BUG_REPORT_BEGIN_PATH = '/api/cli/v1/bug-reports/begin';
29
+ export const BUG_REPORT_SUBMIT_PATH = '/api/cli/v1/bug-reports';
30
+ /** api-server's limits, mirrored so the CLI refuses before uploading anything. */
31
+ export const MAX_DESCRIPTION_CHARS = 2000;
32
+ export const MAX_RUNTIME_ERRORS = 20;
33
+ const PNG_SIGNATURE = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];
34
+ /**
35
+ * Whether `bytes` start with PNG's eight-byte signature. The upload is signed as image/png, and
36
+ * Slack shows nothing for an image block whose bytes are something else.
37
+ */
38
+ export function isPng(bytes) {
39
+ return PNG_SIGNATURE.every((byte, i) => bytes[i] === byte);
40
+ }
41
+ /** Where the report's archive goes — beside publish's, never on top of it. */
42
+ export function bugReportArchivePath(root) {
43
+ return path.join(root, '.bitmagic', 'bug-report', 'source.zip');
44
+ }
45
+ export function collectBugReportContext(root, metadata, environment) {
46
+ const publish = readPublishRecord(root);
47
+ return {
48
+ gameName: readGameName(root),
49
+ template: metadata.template,
50
+ engineVersion: metadata.engineVersion,
51
+ cliVersion: currentCliVersion(),
52
+ platform: `${process.platform} ${process.arch}, Node ${process.versions.node}`,
53
+ environment: environment.name,
54
+ ...(publish ? { lastPublishUrl: publish.latestUrl ?? publish.url } : {}),
55
+ };
56
+ }
57
+ /**
58
+ * The errors the last `bitmagic verify` saw in the browser console, newest last. The CLI has no
59
+ * live game to ask, so this is the closest thing it has to "what went wrong at runtime".
60
+ */
61
+ export function readVerifyConsoleErrors(root) {
62
+ let text;
63
+ try {
64
+ text = fs.readFileSync(path.join(root, '.bitmagic', 'verify', 'console.log'), 'utf-8');
65
+ }
66
+ catch {
67
+ return [];
68
+ }
69
+ return text
70
+ .split('\n')
71
+ .filter((line) => line.startsWith('error:') || line.startsWith('pageerror:'))
72
+ .slice(-MAX_RUNTIME_ERRORS);
73
+ }
74
+ /** Throws a `CliError` the caller can show as-is; nothing is uploaded before this passes. */
75
+ export function validateBugReportDescription(description) {
76
+ const trimmed = description.trim();
77
+ if (trimmed === '') {
78
+ throw new CliError('Describe the bug: what you did, what you expected, and what happened instead.', 1, 'invalid_arguments');
79
+ }
80
+ if (trimmed.length > MAX_DESCRIPTION_CHARS) {
81
+ throw new CliError(`The description is ${trimmed.length} characters; the limit is ${MAX_DESCRIPTION_CHARS}.`, 1, 'invalid_arguments');
82
+ }
83
+ return trimmed;
84
+ }
85
+ export async function sendBugReport(input, deps, log = () => { }) {
86
+ const description = validateBugReportDescription(input.description);
87
+ const warnings = [];
88
+ let archive = null;
89
+ if (input.includeSource) {
90
+ try {
91
+ archive = await buildSourceArchive({
92
+ root: input.root,
93
+ index: buildSourceIndex(input.root),
94
+ gameId: input.metadata.gameId,
95
+ engineVersion: input.metadata.engineVersion,
96
+ filePath: bugReportArchivePath(input.root),
97
+ });
98
+ log(`Source ZIP: ${(archive.bytes / 1024).toFixed(0)} KB (engine/, binary assets and credential-shaped files left out).`);
99
+ }
100
+ catch (error) {
101
+ warnings.push(`Could not build the source ZIP: ${error instanceof Error ? error.message : String(error)}`);
102
+ }
103
+ }
104
+ const screenshot = input.screenshotPng && input.screenshotPng.byteLength > 0 ? input.screenshotPng : null;
105
+ const begun = await apiPost(input.environment, BUG_REPORT_BEGIN_PATH, input.token, { hasSource: archive !== null, hasScreenshot: screenshot !== null }, deps);
106
+ const upload = async (what, signed, bytes, maxBytes) => {
107
+ if (!signed || bytes === null)
108
+ return false;
109
+ if (bytes.byteLength > maxBytes) {
110
+ warnings.push(`The ${what} is ${(bytes.byteLength / 1024 / 1024).toFixed(1)} MB, over the ${(maxBytes / 1024 / 1024).toFixed(0)} MB limit — sent without it.`);
111
+ return false;
112
+ }
113
+ try {
114
+ await putSignedUrl(signed.url, bytes, signed.headers, deps);
115
+ return true;
116
+ }
117
+ catch (error) {
118
+ warnings.push(`The ${what} did not upload (${error instanceof Error ? error.message : String(error)}) — sent without it.`);
119
+ return false;
120
+ }
121
+ };
122
+ const sourceUploaded = await upload('source ZIP', begun.sourceUpload, archive ? new Uint8Array(fs.readFileSync(archive.filePath)) : null, begun.maxSourceBytes);
123
+ const screenshotUploaded = await upload('screenshot', begun.screenshotUpload, screenshot, begun.maxScreenshotBytes);
124
+ const gameId = input.metadata.gameId;
125
+ const submitted = await apiPost(input.environment, BUG_REPORT_SUBMIT_PATH, input.token, {
126
+ reportId: begun.reportId,
127
+ ...(gameId ? { gameId } : {}),
128
+ description,
129
+ surface: input.surface,
130
+ context: collectBugReportContext(input.root, input.metadata, input.environment),
131
+ runtimeErrors: (input.runtimeErrors ?? []).slice(-MAX_RUNTIME_ERRORS),
132
+ }, deps);
133
+ if (submitted.warning)
134
+ warnings.push(submitted.warning);
135
+ return {
136
+ reportId: submitted.reportId,
137
+ sourceUploaded,
138
+ screenshotUploaded,
139
+ secretsOmitted: archive?.secretsOmitted ?? [],
140
+ warnings,
141
+ };
142
+ }
143
+ //# sourceMappingURL=send.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/bug-report/send.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AA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+381,10 @@ declare const rawCommands: {
381
381
  readonly type: "boolean";
382
382
  readonly description: string;
383
383
  };
384
+ readonly pages: {
385
+ readonly type: "boolean";
386
+ readonly description: string;
387
+ };
384
388
  }>;
385
389
  generate: CommandDef<ArgsDef>;
386
390
  character: CommandDef<ArgsDef>;
@@ -567,9 +571,34 @@ declare const rawCommands: {
567
571
  readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
568
572
  };
569
573
  }>;
574
+ pages: CommandDef<ArgsDef>;
570
575
  ios: CommandDef<ArgsDef>;
571
576
  steam: CommandDef<ArgsDef>;
572
577
  tools: CommandDef<ArgsDef>;
578
+ 'report-bug': CommandDef<{
579
+ readonly message: {
580
+ readonly type: "string";
581
+ readonly description: "What you did, what you expected, and what happened instead (up to 2000 characters). Required.";
582
+ };
583
+ readonly screenshot: {
584
+ readonly type: "string";
585
+ readonly description: "A PNG screenshot to attach.";
586
+ };
587
+ readonly source: {
588
+ readonly type: "boolean";
589
+ readonly default: true;
590
+ readonly description: "Attach a ZIP of the project source (without engine/, binary assets or credential-shaped files).";
591
+ readonly negativeDescription: "Send the report without the project source.";
592
+ };
593
+ readonly env: {
594
+ readonly type: "string";
595
+ readonly description: "Environment to report to (dev, prod, local).";
596
+ };
597
+ readonly json: {
598
+ readonly type: "boolean";
599
+ readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
600
+ };
601
+ }>;
573
602
  };
574
603
  type CommandName = keyof typeof rawCommands;
575
604
  export declare const subCommands: Record<CommandName, CommandDef<ArgsDef>>;
package/dist/cli.js CHANGED
@@ -28,6 +28,7 @@ import { assetsCommand } from './commands/assets.js';
28
28
  import { levelsCommand } from './commands/levels.js';
29
29
  import { themeCommand } from './commands/theme.js';
30
30
  import { coverCommand } from './commands/cover.js';
31
+ import { reportBugCommand } from './commands/report-bug.js';
31
32
  import { trailerCommand } from './commands/trailer.js';
32
33
  import { adsCommand } from './commands/ads.js';
33
34
  import { exchangeCommand } from './commands/exchange.js';
@@ -35,6 +36,7 @@ import { referenceCommand } from './commands/reference.js';
35
36
  import { judgeCommand } from './commands/judge.js';
36
37
  import { forgeCommand } from './commands/forge.js';
37
38
  import { publishCommand } from './commands/publish.js';
39
+ import { pagesCommand } from './commands/pages.js';
38
40
  import { iosCommand } from './commands/ios.js';
39
41
  import { steamCommand } from './commands/steam.js';
40
42
  import { toolsCommand } from './commands/tools.js';
@@ -233,9 +235,11 @@ const rawCommands = {
233
235
  judge: judgeCommand,
234
236
  forge: forgeCommand,
235
237
  publish: publishCommand,
238
+ pages: pagesCommand,
236
239
  ios: iosCommand,
237
240
  steam: steamCommand,
238
241
  tools: toolsCommand,
242
+ 'report-bug': reportBugCommand,
239
243
  };
240
244
  export const subCommands = Object.fromEntries(Object.entries(rawCommands).map(([name, command]) => [name, withCleanErrors(command, name)]));
241
245
  // This module only builds `main` and exports it (along with `subCommands` and `withCleanErrors`)
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAA0B,MAAM,gCAAgC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAsB,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,E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AI,CAAC;QAE9B,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAW,CAAC;QACxC,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9B,OAAO,CACL,oBAAoB,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI;gBAC3E,cAAc,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;gBACjD,qBAAqB,MAAM,IAAI,IAAI,2CAA2C;gBAC9E,4DAA4D,CAC7D,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,KAAK,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;AACH,CAAC"}
@@ -11,4 +11,8 @@ export declare const buildCommand: import("citty").CommandDef<{
11
11
  readonly type: "boolean";
12
12
  readonly description: string;
13
13
  };
14
+ readonly pages: {
15
+ readonly type: "boolean";
16
+ readonly description: string;
17
+ };
14
18
  }>;
@@ -1,12 +1,12 @@
1
1
  import { defineCommand } from 'citty';
2
2
  import { loadProjectContext } from '../project/context.js';
3
- import { buildBundlePaths, runBuild } from '../publish/bundle.js';
3
+ import { buildBundlePaths, runBuild, runPagesBuild } from '../publish/bundle.js';
4
4
  import { createOutput } from '../output.js';
5
5
  import { ORIGINAL_PROMPT_FLAG } from '../telemetry/creator-prompt.js';
6
6
  export const buildCommand = defineCommand({
7
7
  meta: {
8
8
  name: 'build',
9
- description: 'Bundle the game for publishing into .bitmagic/build/index.html.',
9
+ description: 'Bundle the game for publishing into .bitmagic/build/index.html (with --pages, .bitmagic/pages/).',
10
10
  },
11
11
  args: {
12
12
  'original-prompt': ORIGINAL_PROMPT_FLAG,
@@ -19,12 +19,29 @@ export const buildCommand = defineCommand({
19
19
  description: 'Inline three.js, Rapier and the other CDN packages into the bundle, so it runs with no '
20
20
  + 'network. Bigger; for offline or packaged distribution, not everyday publishing.',
21
21
  },
22
+ pages: {
23
+ type: 'boolean',
24
+ description: 'Build the static GitHub Pages page into .bitmagic/pages/index.html instead: no Bitmagic '
25
+ + 'services, the engine\'s files from the Bitmagic CDN (`pagesHosting` in bitmagic.json). '
26
+ + 'What the workflow `bitmagic pages init` writes runs.',
27
+ },
22
28
  },
23
29
  async run({ args }) {
24
30
  const output = createOutput(args.json === true);
25
31
  const context = loadProjectContext();
26
- output.info('Building…');
27
32
  const singleFile = args['single-file'] === true;
33
+ if (args.pages === true) {
34
+ output.info('Building the GitHub Pages page…');
35
+ const page = runPagesBuild(context.root, {
36
+ singleFile,
37
+ stderr: args.json === true,
38
+ pagesHosting: context.metadata.pagesHosting,
39
+ });
40
+ output.info(`Page ready: .bitmagic/pages/index.html (${page.bytes} bytes)`);
41
+ output.result({ ok: true, pagesPath: page.htmlPath, ...page });
42
+ return;
43
+ }
44
+ output.info('Building…');
28
45
  const manifest = runBuild(context.root, context.metadata.engineVersion, { singleFile });
29
46
  const { htmlPath, manifestPath } = buildBundlePaths(context.root);
30
47
  output.info(`Bundle ready: .bitmagic/build/index.html (${manifest.bytes} bytes)`);
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,oBAAoB,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,CAAC,KAAK,SAAS,CAAC,CAAC;YAC5E,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;YAC/D,OAAO;QACT,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QACxF,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClE,MAAM,CAAC,IAAI,CAAC,6CAA6C,QAAQ,CAAC,KAAK,SAAS,CAAC,CAAC;QAClF,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ export interface PagesInitResult {
2
+ workflowPath: string;
3
+ /** `written` for a new or changed file, `unchanged` when the file already matched. */
4
+ status: 'written' | 'unchanged';
5
+ cliVersion: string;
6
+ packageManager: string;
7
+ /** The branch whose pushes deploy. */
8
+ branch: string;
9
+ notes: string[];
10
+ }
11
+ /**
12
+ * Writes `.github/workflows/bitmagic-pages.yml` into the project at `root`.
13
+ *
14
+ * Refuses, before writing anything, an engine with no static page (the workflow would fail on its
15
+ * first push) and an unreadable `pagesHosting` (it would fail the same way). A workflow file that
16
+ * differs from what this CLI renders is the creator's, or an older CLI's: it is replaced only with
17
+ * `force`, since the creator may have edited it.
18
+ */
19
+ export declare function initPagesWorkflow(root: string, options: {
20
+ cliVersion: string;
21
+ branch?: string;
22
+ force?: boolean;
23
+ pagesHosting?: unknown;
24
+ }): PagesInitResult;
25
+ export declare const pagesCommand: import("citty").CommandDef<import("citty").ArgsDef>;