@bitmagic/cli 0.1.78-dev.0 → 0.1.79-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +48 -2
  2. package/assets/skills/building-ads/SKILL.md +5 -1
  3. package/assets/skills/joining-the-game-exchange/SKILL.md +134 -0
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +2 -0
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/exchange.d.ts +48 -0
  8. package/dist/commands/exchange.js +227 -0
  9. package/dist/commands/exchange.js.map +1 -0
  10. package/dist/commands/publish.js +15 -0
  11. package/dist/commands/publish.js.map +1 -1
  12. package/dist/exchange/client.d.ts +25 -0
  13. package/dist/exchange/client.js +208 -0
  14. package/dist/exchange/client.js.map +1 -0
  15. package/dist/exchange/declaration.d.ts +29 -0
  16. package/dist/exchange/declaration.js +124 -0
  17. package/dist/exchange/declaration.js.map +1 -0
  18. package/dist/exchange/report.d.ts +23 -0
  19. package/dist/exchange/report.js +174 -0
  20. package/dist/exchange/report.js.map +1 -0
  21. package/dist/publish/client.d.ts +25 -0
  22. package/dist/publish/client.js +0 -10
  23. package/dist/publish/client.js.map +1 -1
  24. package/dist/publish/game-exchange.d.ts +43 -0
  25. package/dist/publish/game-exchange.js +139 -0
  26. package/dist/publish/game-exchange.js.map +1 -0
  27. package/dist/scaffold/blender-level-skill-files.js +1 -1
  28. package/dist/scaffold/claude-settings.js +3 -0
  29. package/dist/scaffold/claude-settings.js.map +1 -1
  30. package/dist/scaffold/exchange-skill-files.d.ts +2 -0
  31. package/dist/scaffold/exchange-skill-files.js +7 -0
  32. package/dist/scaffold/exchange-skill-files.js.map +1 -0
  33. package/dist/scaffold/project-files.js +2 -1
  34. package/dist/scaffold/project-files.js.map +1 -1
  35. package/dist/scaffold/project.js +2 -0
  36. package/dist/scaffold/project.js.map +1 -1
  37. package/dist/scaffold/skill-files.js +4 -3
  38. package/dist/scaffold/skill-files.js.map +1 -1
  39. package/package.json +4 -4
package/README.md CHANGED
@@ -220,6 +220,9 @@ browser reloads itself on every change and the assets panel shows each generatio
220
220
  | `bitmagic ads publish` | Upload the package to Bitmagic under `game-media/<gameId>/` and register it. **Nothing is advertised.** Files unchanged since the last publish are not uploaded again (`.bitmagic/ads/published.json`). Prints the page where a promotion can be bought. |
221
221
  | `bitmagic ads buy [--no-open] [--wait]` | Open that page, where the creator chooses a budget, a run length and an audience, sees an estimate and pays with Stripe; the Bitmagic team then runs the campaign, usually within a day. Refuses when there is no uploaded package or the game is not public. `--wait` waits for the payment. |
222
222
  | `bitmagic ads status` | The uploaded package and every promotion bought for this game: its state, and how many people the ads brought to the game's page and how many started playing. |
223
+ | `bitmagic exchange enable [--placements end,pause] [--not-listed] [--house-only]` | Join the **Game Exchange** (free cross-promotion between Bitmagic games, not `bitmagic ads`): declares `worldProfileData.gameExchange` in `src/work/world.json`, so the published game shows an "Up next" tile on its end screen (and pause screen with `--placements end,pause`) and is listed in other games. `--not-listed` shows tiles without being listed; `--house-only` shows only Bitmagic's picks. Refuses (`engine_too_old`) when the project's engine predates the exchange: run `bitmagic upgrade`. Also tells the server, best effort. A tracked-file edit: run `bitmagic verify`, then `bitmagic publish`. See **The Game Exchange** below. |
224
+ | `bitmagic exchange disable` | Remove the declaration from `world.json` and switch the live game off on the server: no more tiles, no longer listed. If the server cannot be reached it exits 1 (`exchange_still_live`) and says the published game keeps showing tiles until it succeeds. |
225
+ | `bitmagic exchange status` | Whether the Game Exchange is on in this environment, what the server has for this game and whether the project's declaration differs (and what closes the gap: a republish, `bitmagic upgrade` first when the engine predates the exchange, or `bitmagic exchange disable` for an enrolment the Bitmagic team set), the exchange credits (one balance shared by all of your games), what this game showed, earned and was not credited for, what being listed in other games cost and brought, the earn rate and rank, and whether its banner and video are ready. Free and read-only; works without Bitmagic Pro. |
223
226
  | `bitmagic forge --prompt "..." [--city\|--dungeon\|--platformer\|--freeform] [--name <name>] [--resume <jobId>]` | Design and bake a whole playable level into `world.json`. Costs sparks, and takes many minutes — the bake alone can take twenty. `--resume <jobId>` picks a failed run back up from the last step that finished, rather than redoing the whole thing. |
224
227
  | `bitmagic forge --edit "..." [--level <id or name>]` | Change a detail of a level this project forged — a door style, the light fixtures, a prop — without re-forging it. The stored design is patched and only what the change touches is re-made; the level is replaced in place. See [Editing a forged level](#editing-a-forged-level). |
225
228
  | `bitmagic tools <list\|path\|install> [bundle]` | The script bundles the CLI ships for skills that drive Blender, Python or Node (`blender-level`, `unity-import`, `metahuman`): what they are, where this install keeps them, and `install` to copy one into the project's `tools/`. Local, no network, no sparks. |
@@ -665,8 +668,9 @@ Needs `ffmpeg` and Google Chrome on this machine; each command says so if one is
665
668
 
666
669
  `bitmagic ads` builds everything an ad campaign for the game needs, uploads it, and — only when the
667
670
  creator wants to pay for one — opens the page where they buy a promotion that the Bitmagic team runs
668
- on Google Ads, sending players to the game's page. Ask your agent to "build ads"; the shipped
669
- `building-ads` skill walks it through:
671
+ on Google Ads, sending players to the game's page. (Free cross-promotion inside other Bitmagic
672
+ games is `bitmagic exchange`; see **The Game Exchange** below.) Ask your agent to "build ads"; the
673
+ shipped `building-ads` skill walks it through:
670
674
 
671
675
  ```bash
672
676
  bitmagic ads render # videos and stills from the newest trailer, into .bitmagic/ads/
@@ -682,6 +686,48 @@ invalidates a passing verify. The game must be public before a promotion can be
682
686
  links to its page. Budgets, run lengths, audiences and the estimates are shown on the page, and
683
687
  the visitor estimate is an estimate, not a guarantee.
684
688
 
689
+ ## The Game Exchange
690
+
691
+ `bitmagic exchange` is free cross-promotion between published Bitmagic games — the opposite money
692
+ direction from `bitmagic ads`, which builds a campaign you pay for. A game that joins **shows** an
693
+ "Up next" tile (another Bitmagic game's cover, or a short muted clip of its trailer) beside
694
+ "Play Again" on its end screen, and is **listed**: other games show a tile for it. Showing tiles
695
+ earns **exchange credits**; being shown spends them, and a click that brings a player in spends a
696
+ little more. Some tiles are games Bitmagic picks, which cost nobody anything and still earn.
697
+ Exchange credits are one balance per creator, are not sparks, cannot be bought or cashed out, and
698
+ appear only in `bitmagic exchange status`. Ask your agent to "join the game exchange"; the shipped
699
+ `joining-the-game-exchange` skill walks it through:
700
+
701
+ ```bash
702
+ bitmagic exchange enable # declares it in src/work/world.json
703
+ bitmagic verify # the declaration is a tracked-file edit
704
+ bitmagic publish # enrols the game; says so in one line
705
+ bitmagic exchange status # enrolment, exchange credits, shown and earned, listed and spent
706
+ bitmagic exchange disable # removes the declaration and switches the live game off
707
+ ```
708
+
709
+ The declaration in `world.json` is the source of truth and every publish syncs it: a declared
710
+ exchange enrols the game, a project that declares nothing switches an earlier enrolment off (one a
711
+ publish or `bitmagic exchange` made; one the Bitmagic team set is left alone, and
712
+ `bitmagic exchange disable` switches it off), and a declaration publish cannot read is named and
713
+ left alone. Nothing is uploaded — the tile for your
714
+ game is made from its cover and its page's trailer.
715
+
716
+ The tile is real only in the **published** game. `bitmagic dev` shows one labelled **Preview** that
717
+ makes no request; `bitmagic verify`, the publish smoke check, `bitmagic judge` and trailer
718
+ recordings show none, so it never lands in a thumbnail; Poki and iOS exports show none and make no
719
+ request. A game with its own end screen mounts the tile itself with `engine.gameExchange.mount()`
720
+ (`engine/agent-docs/game-exchange.md`). A project whose engine predates the exchange is refused by
721
+ `enable`, and a publish from one warns and leaves the enrolment alone: `bitmagic upgrade` first.
722
+
723
+ `status` and `disable` work without Bitmagic Pro, so a game can always be taken out; turning
724
+ anything on needs it. With `--json` the three commands answer
725
+ `{ "ok": true, "kind": "exchange-enable" | "exchange-disable" | "exchange-status", … }`; the status
726
+ document also carries `local` (what the project declares) and `engineSupportsExchange` (false means
727
+ publishing cannot apply a declaration that shows tiles until `bitmagic upgrade`). A failure
728
+ is told apart by what it says (the engine is too old, the live game is still showing tiles, the Game
729
+ Exchange is not available in this environment yet), not by a dedicated exit code.
730
+
685
731
  ## The dev view
686
732
 
687
733
  `bitmagic dev` is meant to be started once and left running, beside your agent:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: building-ads
3
- description: Build an ad package for this game with bitmagic ads — videos in 16:9, 9:16 and 1:1, three stills, and the headlines and descriptions — upload it to Bitmagic, and, only if the creator wants to pay, open the page where they buy a promotion that the Bitmagic team runs on Google Ads. Use when asked to build ads, make an ad, advertise or promote the game, run a campaign, or get players.
3
+ description: Build an ad package for this game with bitmagic ads — videos in 16:9, 9:16 and 1:1, three stills, and the headlines and descriptions — upload it to Bitmagic, and, only if the creator wants to pay, open the page where they buy a promotion that the Bitmagic team runs on Google Ads. Use when asked to build ads, make an ad, run a campaign, or pay to advertise or promote the game. Not for free cross-promotion between Bitmagic games (an "Up next" tile, exchange credits) — that is the joining-the-game-exchange skill.
4
4
  ---
5
5
 
6
6
  # Building ads
@@ -10,6 +10,10 @@ Bitmagic. Building and uploading costs nothing and advertises nothing. Running t
10
10
  separate choice the creator makes and pays for on a web page; the Bitmagic team then runs the
11
11
  campaign on Google Ads and sends the players to the game's page.
12
12
 
13
+ This is the paid lane. Showing the game inside other Bitmagic games for free, in exchange for
14
+ showing theirs, is the Game Exchange: `bitmagic exchange`, the `joining-the-game-exchange/` skill
15
+ beside this one. When "promote my game" could mean either, ask which.
16
+
13
17
  ## The flow
14
18
 
15
19
  0. **Check that promotion is open:** `bitmagic ads status`. If it answers that game promotion is
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: joining-the-game-exchange
3
+ description: Join the Game Exchange with bitmagic exchange — free cross-promotion between published Bitmagic games, where this game shows an "Up next" tile for other Bitmagic games and earns exchange credits that get it shown in theirs. Use when asked for cross-promotion, an "Up next", "try another game" or "more games" tile, to show other Bitmagic games, to put other games on posters or TV screens in the game's world, to join or leave the exchange, to earn or check exchange credits, or to get players without paying. Not for paid advertising — buying a promotion on Google Ads is the building-ads skill.
4
+ ---
5
+
6
+ # Joining the Game Exchange
7
+
8
+ The Game Exchange is cross-promotion between published Bitmagic games. A game that joins **shows**
9
+ an "Up next" tile (a banner or a short muted video of another Bitmagic game) beside
10
+ "Play Again" on its end screen, and is **listed**, which means other games show a tile for it.
11
+
12
+ - Showing tiles earns **exchange credits**. Being shown in another game spends them, and a click
13
+ that brings a player to the game spends a little more. Better-ranked games earn at a higher rate.
14
+ - The balance is one per creator, shared by all of their games. A starter grant arrives after the
15
+ creator's games have shown their first tiles.
16
+ - Exchange credits are not sparks and not money: they cannot be bought, cashed out or spent on
17
+ generation, and `bitmagic usage` does not show them. `bitmagic exchange status` does.
18
+ - Nothing is uploaded. The tile other games show for this game is made from its cover and, when the
19
+ game page has a trailer, a short clip of it. Captions are the game's name and description.
20
+ - Some tiles are games Bitmagic picks. They cost nobody anything and still earn.
21
+
22
+ This is not paid advertising. `bitmagic ads` (the `building-ads/` skill beside this one) builds
23
+ ads the creator pays to run on Google Ads. When the creator says "advertise my game" and it is not
24
+ clear which they mean, ask: free cross-promotion inside other Bitmagic games, or a paid campaign.
25
+
26
+ ## The flow
27
+
28
+ 1. **Ask first.** Joining changes what players see on the game's end screen and lists the game in
29
+ other games. Enable it only when the creator asked for it or said yes.
30
+ 2. **Enable it:**
31
+
32
+ ```
33
+ bitmagic exchange enable # a tile on the end screen, and listed
34
+ bitmagic exchange enable --placements end,pause # also on the pause screen
35
+ bitmagic exchange enable --not-listed # show tiles, but do not appear in other games
36
+ bitmagic exchange enable --house-only # show only the games Bitmagic picks
37
+ ```
38
+
39
+ It writes `worldProfileData.gameExchange` into `src/work/world.json`. If it answers that the
40
+ engine is too old, run `bitmagic upgrade` (ask first: it replaces `engine/`), then enable again.
41
+ 3. **Verify, then publish.** Enabling edits a tracked file, so the last verify is stale:
42
+
43
+ ```
44
+ bitmagic verify
45
+ bitmagic publish
46
+ ```
47
+
48
+ The publish enrols the game and says so in one line. The game shows tiles only while it is
49
+ **public**; a private game stays enrolled and shows nothing.
50
+ 4. **Check it:** `bitmagic exchange status` (below).
51
+
52
+ ## Where the tile appears
53
+
54
+ | Placement | What it does |
55
+ |---|---|
56
+ | `end` (default) | Beside "Play Again" on the engine's end screen (win, lose, game over). The tile is there when the screen opens or not at all; it never pops in afterwards. |
57
+ | `pause` | The same tile on the engine's pause screen. Opt in with `--placements end,pause`. |
58
+ | custom | Anywhere the game's own code mounts it. Needs no flag. |
59
+
60
+ A game that draws **its own** end screen (anything registered with `setUIComponent('end', ...)`, or
61
+ a hand-built overlay) does not get the tile from the declaration alone. Mount it into a container
62
+ of that screen with `engine.gameExchange.mount(container)`. Read `engine/agent-docs/game-exchange.md`
63
+ first: it has the exact API, when `mount` returns null, and how to dispose the handle. Leave room
64
+ for the tile and keep "Play Again" the first, most prominent button.
65
+
66
+ An **ongoing game** that rarely reaches an end screen (a tycoon, a sandbox) can also hang other
67
+ games in its world: `engine.gameExchange.getAds()` gives it pictures and short muted clips for
68
+ posters and TV screens, which count nothing on the wall. When the player clicks one, the game
69
+ calls `ad.open()` and the engine shows the tile in a popup; that popup is what is counted. It needs
70
+ no flag, only the game joined. The section "Posters and screens in the game world" of
71
+ `engine/agent-docs/game-exchange.md` has the API, the textures and a full example; read it first.
72
+
73
+ ## Where it shows nothing
74
+
75
+ This is by design. Do not try to work around any of it.
76
+
77
+ - **`bitmagic dev` and the Creator** show a tile labelled **Preview** with placeholder art. It makes
78
+ no request, earns nothing and links nowhere. Use it to check the layout of the end screen.
79
+ - **`bitmagic verify`**, the publish smoke check, `bitmagic judge` and `bitmagic trailer record`
80
+ show no tile at all, so it never lands in a screenshot, a thumbnail or a trailer. A verify that
81
+ shows no tile is not a failure.
82
+ - **Poki and iOS exports** (`bitmagic publish --target poki`, `bitmagic ios`) show no tile and make
83
+ no request. Those stores own their own promotion; the declaration can stay in the project.
84
+ - A real tile appears only in the **published** game, when the Game Exchange is switched on in that
85
+ environment and there is a game to show. No tile is a normal outcome, not an error.
86
+
87
+ ## Status
88
+
89
+ `bitmagic exchange status` (add `--json` to parse it) reports:
90
+
91
+ - whether the network is on in this environment, what the server has for this game, what the
92
+ project declares, and whether the two differ ("republish to apply");
93
+ - the exchange credits balance, and what was earned, spent and granted;
94
+ - this game showing tiles: asked for, filled, shown, credited and not credited with the reason
95
+ (daily limits per player and per game stop repeat views from earning), clicks, and the earn rate
96
+ with the game's rank;
97
+ - this game listed in other games: times shown, clicks, how many players arrived, started playing
98
+ and stayed, and what it cost;
99
+ - the tile itself: whether a banner and a video are ready (no cover means no banner: `bitmagic
100
+ cover`; no trailer means no video: the `making-a-trailer/` skill);
101
+ - anything stopping it: not public, not reviewed, blocked, balance too low to stay listed.
102
+
103
+ Report these numbers as they are. Do not promise players: the exchange shows the game in
104
+ proportion to the exchange credits its creator's games earn.
105
+
106
+ ## Leaving
107
+
108
+ ```
109
+ bitmagic exchange disable
110
+ ```
111
+
112
+ It removes the declaration from `world.json` and switches the live game off on the server at once:
113
+ no more tiles, no longer listed. The exchange credits stay with the creator. If it says the live
114
+ game could not be switched off, the published game **keeps showing tiles**: say so, and run it
115
+ again (or verify and publish, which switches it off too). Like `enable`, it edits a tracked file,
116
+ so run `bitmagic verify` before the next publish.
117
+
118
+ ## What not to do
119
+
120
+ - **Never fake impressions or clicks.** No reloading the end screen in a loop, no scripted browsers,
121
+ no opening the published game to "warm up" the numbers, no clicking tiles to test them. Views are
122
+ counted and capped per player on the server; inflated traffic earns nothing and gets the game
123
+ blocked and the creator's exchange credits frozen.
124
+ - **Never build the tile by hand.** No custom "more games" card, no copied banner, no link to
125
+ another game's page. Only the engine's tile is counted, labelled as a promotion and reviewed.
126
+ - **Never call the exchange's API from game code**, and never read or forward its tokens. The
127
+ engine owns every request; game code only chooses where the tile mounts and, through
128
+ `engine.gameExchange`, which poster or screen shows which ad.
129
+ - Do not restyle the tile so it reads as part of the game, hide its "Promoted" label, cover it, or
130
+ move it over "Play Again". Do not show it during gameplay or on the start screen; the one
131
+ exception is the popup the player opens by clicking a poster or screen.
132
+ - Do not enable it, disable it or change `--not-listed` / `--house-only` without the creator's yes.
133
+ - Do not edit `worldProfileData.gameExchange` to a shape the command would not write: publish
134
+ refuses a declaration it cannot read and leaves the enrolment as it was.
package/dist/cli.d.ts CHANGED
@@ -414,6 +414,7 @@ declare const rawCommands: {
414
414
  }>;
415
415
  trailer: CommandDef<ArgsDef>;
416
416
  ads: CommandDef<ArgsDef>;
417
+ exchange: CommandDef<ArgsDef>;
417
418
  reference: CommandDef<ArgsDef>;
418
419
  judge: CommandDef<{
419
420
  readonly genre: {
package/dist/cli.js CHANGED
@@ -30,6 +30,7 @@ import { themeCommand } from './commands/theme.js';
30
30
  import { coverCommand } from './commands/cover.js';
31
31
  import { trailerCommand } from './commands/trailer.js';
32
32
  import { adsCommand } from './commands/ads.js';
33
+ import { exchangeCommand } from './commands/exchange.js';
33
34
  import { referenceCommand } from './commands/reference.js';
34
35
  import { judgeCommand } from './commands/judge.js';
35
36
  import { forgeCommand } from './commands/forge.js';
@@ -226,6 +227,7 @@ const rawCommands = {
226
227
  cover: coverCommand,
227
228
  trailer: trailerCommand,
228
229
  ads: adsCommand,
230
+ exchange: exchangeCommand,
229
231
  reference: referenceCommand,
230
232
  judge: judgeCommand,
231
233
  forge: forgeCommand,
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,EA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M,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"}
@@ -0,0 +1,48 @@
1
+ import type { ExchangeEnrollment, GameExchangeDeclaration } from '@bitmagic/asset-core/game-exchange';
2
+ import { formatExchangeReport } from '../exchange/report.js';
3
+ export { formatExchangeReport };
4
+ export interface ExchangeRunDeps {
5
+ fetch: typeof globalThis.fetch;
6
+ sleep: (ms: number) => Promise<void>;
7
+ /** Test-only override; production omits it and loadProjectContext walks up from process.cwd(). */
8
+ startDir?: string;
9
+ /** Test-only override; production omits it and the credential helpers read ~/.bitmagic. */
10
+ baseDir?: string;
11
+ /** Test-only override. Production omits it: prose goes through the Output seam. */
12
+ log?: (message: string) => void;
13
+ }
14
+ export interface ExchangeEnableArgs {
15
+ placements?: string;
16
+ 'not-listed'?: boolean;
17
+ 'house-only'?: boolean;
18
+ json?: boolean;
19
+ }
20
+ export interface ExchangeEnableResult {
21
+ ok: true;
22
+ kind: 'exchange-enable';
23
+ declaration: GameExchangeDeclaration;
24
+ /** Whether world.json was rewritten, which is also whether verify went stale. */
25
+ changed: boolean;
26
+ /** Whether the server already knows; false is only a note, the next publish enrols the game. */
27
+ enrolled: boolean;
28
+ enrollment?: ExchangeEnrollment;
29
+ note?: string;
30
+ }
31
+ export declare function runExchangeEnable(args: ExchangeEnableArgs, deps?: ExchangeRunDeps): Promise<ExchangeEnableResult>;
32
+ export interface ExchangeDisableResult {
33
+ ok: true;
34
+ kind: 'exchange-disable';
35
+ /** The work-copy files the declaration was removed from; empty when there was none. */
36
+ removedFrom: string[];
37
+ /** False only where the Game Exchange is not running at all, so there was nothing to switch off. */
38
+ serverUpdated: boolean;
39
+ enrollment?: ExchangeEnrollment;
40
+ note?: string;
41
+ }
42
+ export declare function runExchangeDisable(args: {
43
+ json?: boolean;
44
+ }, deps?: ExchangeRunDeps): Promise<ExchangeDisableResult>;
45
+ export declare function runExchangeStatus(args: {
46
+ json?: boolean;
47
+ }, deps?: ExchangeRunDeps): Promise<void>;
48
+ export declare const exchangeCommand: import("citty").CommandDef<import("citty").ArgsDef>;
@@ -0,0 +1,227 @@
1
+ /**
2
+ * `bitmagic exchange` — the Game Exchange: free cross-promotion between published Bitmagic games
3
+ * (docs/game-exchange.md). Not `bitmagic ads`, which is promotion the creator pays for.
4
+ *
5
+ * enable declare it in world.json, so the game shows an "Up next" tile and is listed
6
+ * in other games; takes effect on the next publish
7
+ * disable remove the declaration and switch the live game off on the server
8
+ * status the enrolment, the exchange credits, what was shown and earned, what it cost
9
+ *
10
+ * The project file is the source of truth, exactly like `categories` or `primaryPlatform`: publish
11
+ * syncs it. `enable` and `disable` also tell the server straight away, for two different reasons.
12
+ * `enable` does it as a courtesy (the game can be listed before its next publish) and a failure
13
+ * there is only a note. `disable` does it because the published bundle is frozen: until the server
14
+ * is told, the live game keeps showing tiles, and a failure there is an error that says so.
15
+ */
16
+ import { defineCommand } from 'citty';
17
+ import { asCliError, CliError } from '../errors.js';
18
+ import { createOutput } from '../output.js';
19
+ import { loadProjectContext } from '../project/context.js';
20
+ import { resolveEnvironmentForCommand, resolveAuth0ClientId } from '../config/environments.js';
21
+ import { getAccessToken } from '../auth/session.js';
22
+ import { fetchExchangeStatus, updateExchangeSettings } from '../exchange/client.js';
23
+ import { parsePlacementsFlag, removeGameExchangeDeclaration, writeGameExchangeDeclaration } from '../exchange/declaration.js';
24
+ import { formatExchangeReport } from '../exchange/report.js';
25
+ import { readGameExchangeDeclaration, vendoredEngineSupportsExchange } from '../publish/game-exchange.js';
26
+ export { formatExchangeReport };
27
+ const JSON_FLAG = {
28
+ type: 'boolean',
29
+ description: 'Print the result as JSON on stdout; all progress goes to stderr.',
30
+ };
31
+ function defaultDeps() {
32
+ return {
33
+ fetch: globalThis.fetch,
34
+ sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
35
+ };
36
+ }
37
+ async function session(root, deps) {
38
+ const environment = resolveEnvironmentForCommand({ cwd: root, baseDir: deps.baseDir });
39
+ const token = await getAccessToken(environment, resolveAuth0ClientId(environment), { fetch: deps.fetch, sleep: deps.sleep }, deps.baseDir);
40
+ return { environment, token };
41
+ }
42
+ /** Why a server call failed, as one clause, and the category it is filed under. */
43
+ function failure(error) {
44
+ const cli = asCliError(error);
45
+ if (cli !== null)
46
+ return { message: cli.message, code: cli.code };
47
+ return { message: error instanceof Error ? error.message : String(error), code: undefined };
48
+ }
49
+ const VERIFY_IS_STALE = 'world.json changed, so the last `bitmagic verify` is stale.';
50
+ export async function runExchangeEnable(args, deps = defaultDeps()) {
51
+ const { root, metadata } = loadProjectContext(deps.startDir);
52
+ const output = createOutput(args.json === true);
53
+ const log = deps.log ?? output.info;
54
+ if (!vendoredEngineSupportsExchange(root)) {
55
+ throw new CliError('This project\'s engine predates the Game Exchange, so the game could not show a tile. '
56
+ + 'Run `bitmagic upgrade`, then `bitmagic exchange enable` again. Nothing has been changed.', 1, 'engine_too_old');
57
+ }
58
+ const placements = parsePlacementsFlag(args.placements);
59
+ const { declaration, changed } = writeGameExchangeDeclaration(root, {
60
+ ...(placements !== undefined ? { placements } : {}),
61
+ listed: args['not-listed'] !== true,
62
+ houseOnly: args['house-only'] === true,
63
+ });
64
+ const where = declaration.placements.map((placement) => `${placement} screen`).join(' and ');
65
+ log(changed
66
+ ? `Declared the Game Exchange in src/work/world.json: an "Up next" tile on the ${where}.`
67
+ : `src/work/world.json already declares this: an "Up next" tile on the ${where}.`);
68
+ log(declaration.listed
69
+ ? 'This game is also listed in other games, which spends the exchange credits its tiles earn.'
70
+ : 'This game is not listed in other games (--not-listed): it earns exchange credits and spends none.');
71
+ if (declaration.houseOnly)
72
+ log('It shows only Bitmagic\'s picks (--house-only).');
73
+ // Best effort, and only a note when it fails: the declaration is what counts, and the next
74
+ // publish enrols the game whatever happened here (logged out, offline, not on Pro, feature off).
75
+ let enrollment;
76
+ let note;
77
+ try {
78
+ const { environment, token } = await session(root, deps);
79
+ enrollment = await updateExchangeSettings(environment, token, {
80
+ gameId: metadata.gameId,
81
+ enabled: true,
82
+ listed: declaration.listed,
83
+ houseOnly: declaration.houseOnly,
84
+ placements: declaration.placements,
85
+ formats: declaration.formats,
86
+ }, { fetch: deps.fetch });
87
+ log('Enrolled on the server. The live game shows a tile once it is published with this declaration.');
88
+ }
89
+ catch (error) {
90
+ note = `Not enrolled on the server yet (${failure(error).message}) Publishing enrols it.`;
91
+ log(`note: ${note}`);
92
+ }
93
+ log(changed
94
+ ? `${VERIFY_IS_STALE} Next: \`bitmagic verify\`, then \`bitmagic publish\`.`
95
+ : 'Next: `bitmagic verify` if the project changed since the last one, then `bitmagic publish`.');
96
+ const result = {
97
+ ok: true,
98
+ kind: 'exchange-enable',
99
+ declaration,
100
+ changed,
101
+ enrolled: enrollment !== undefined,
102
+ ...(enrollment !== undefined ? { enrollment } : {}),
103
+ ...(note !== undefined ? { note } : {}),
104
+ };
105
+ output.result(result);
106
+ return result;
107
+ }
108
+ export async function runExchangeDisable(args, deps = defaultDeps()) {
109
+ const { root, metadata } = loadProjectContext(deps.startDir);
110
+ const output = createOutput(args.json === true);
111
+ const log = deps.log ?? output.info;
112
+ // The declaration goes first: whatever happens to the server call below, the next publish then
113
+ // sends "declares nothing", which switches the enrolment off by itself. A world.json that cannot
114
+ // be read or rewritten (a raw file-system error included) does not stop the server call: the live
115
+ // game is the part that cannot wait.
116
+ let removedFrom = [];
117
+ let unreadable = null;
118
+ try {
119
+ removedFrom = removeGameExchangeDeclaration(root);
120
+ }
121
+ catch (error) {
122
+ unreadable = asCliError(error) ?? new CliError(error instanceof Error ? error.message : String(error));
123
+ }
124
+ if (unreadable === null) {
125
+ log(removedFrom.length > 0
126
+ ? `Removed the Game Exchange declaration from ${removedFrom.map((file) => `src/work/${file}`).join(' and ')}.`
127
+ : 'The project declares no Game Exchange; nothing to remove.');
128
+ }
129
+ let enrollment;
130
+ let note;
131
+ try {
132
+ const { environment, token } = await session(root, deps);
133
+ enrollment = await updateExchangeSettings(environment, token, { gameId: metadata.gameId, enabled: false, listed: false }, { fetch: deps.fetch });
134
+ log('Switched off on the server: the live game shows no more tiles and is no longer listed in other games.');
135
+ }
136
+ catch (error) {
137
+ const { message, code } = failure(error);
138
+ if (code !== 'exchange_unavailable') {
139
+ // The published bundle still carries the old declaration and the server still honours it.
140
+ throw new CliError(`The live game could not be switched off: ${message}\n`
141
+ + 'It KEEPS SHOWING TILES (and stays listed) until this succeeds. Run `bitmagic exchange disable` again'
142
+ + `${unreadable === null ? ', or `bitmagic verify` and `bitmagic publish`: publishing without the declaration switches it off too' : ''}.`
143
+ + `${unreadable === null ? '' : `\nThe declaration could not be removed either: ${unreadable.message}`}`, 1, 'exchange_still_live');
144
+ }
145
+ // No exchange is running there, so no tile is being served to switch off.
146
+ note = `${message} No tiles are served there, so there was nothing to switch off.`;
147
+ log(note);
148
+ }
149
+ if (unreadable !== null) {
150
+ throw new CliError(`${unreadable.message}\nThe declaration may still be in the project, and a publish that reads it enrols the game again. `
151
+ + 'Fix the file and run `bitmagic exchange disable` again.', 1, 'exchange_declaration_unreadable');
152
+ }
153
+ if (removedFrom.length > 0) {
154
+ log(`${VERIFY_IS_STALE} Run \`bitmagic verify\` before the next \`bitmagic publish\`.`);
155
+ }
156
+ const result = {
157
+ ok: true,
158
+ kind: 'exchange-disable',
159
+ removedFrom,
160
+ serverUpdated: enrollment !== undefined,
161
+ ...(enrollment !== undefined ? { enrollment } : {}),
162
+ ...(note !== undefined ? { note } : {}),
163
+ };
164
+ output.result(result);
165
+ return result;
166
+ }
167
+ export async function runExchangeStatus(args, deps = defaultDeps()) {
168
+ const { root, metadata } = loadProjectContext(deps.startDir);
169
+ const output = createOutput(args.json === true);
170
+ const log = deps.log ?? output.info;
171
+ const { environment, token } = await session(root, deps);
172
+ const status = await fetchExchangeStatus(environment, token, metadata.gameId, { fetch: deps.fetch });
173
+ const local = readGameExchangeDeclaration(root);
174
+ const engineSupportsExchange = vendoredEngineSupportsExchange(root);
175
+ log(formatExchangeReport(status, local, engineSupportsExchange));
176
+ if (local.kind === 'declared' && local.value.enabled && !engineSupportsExchange) {
177
+ log('\nThis project\'s engine predates the Game Exchange: run `bitmagic upgrade` before publishing, or the game cannot show a tile.');
178
+ }
179
+ output.result({ ok: true, kind: 'exchange-status', gameId: metadata.gameId, environment: environment.name, ...status, local, engineSupportsExchange });
180
+ }
181
+ const enableCommand = defineCommand({
182
+ meta: {
183
+ name: 'enable',
184
+ description: 'Declare the Game Exchange in world.json: the game shows an "Up next" tile and is listed in other games. Applies on the next publish.',
185
+ },
186
+ args: {
187
+ placements: { type: 'string', description: 'Where the tile appears: end, pause, or end,pause. Default: end (the end screen).' },
188
+ 'not-listed': { type: 'boolean', description: 'Show tiles, but do not list this game in other games.' },
189
+ 'house-only': { type: 'boolean', description: 'Show only the games Bitmagic picks, never another creator\'s.' },
190
+ json: JSON_FLAG,
191
+ },
192
+ async run({ args }) {
193
+ await runExchangeEnable(args);
194
+ },
195
+ });
196
+ const disableCommand = defineCommand({
197
+ meta: {
198
+ name: 'disable',
199
+ description: 'Remove the declaration from world.json and switch the live game off: no more tiles, no longer listed.',
200
+ },
201
+ args: { json: JSON_FLAG },
202
+ async run({ args }) {
203
+ await runExchangeDisable(args);
204
+ },
205
+ });
206
+ const statusCommand = defineCommand({
207
+ meta: {
208
+ name: 'status',
209
+ description: 'The game\'s Game Exchange enrolment, its exchange credits, what it showed and earned, and what being listed cost.',
210
+ },
211
+ args: { json: JSON_FLAG },
212
+ async run({ args }) {
213
+ await runExchangeStatus(args);
214
+ },
215
+ });
216
+ export const exchangeCommand = defineCommand({
217
+ meta: {
218
+ name: 'exchange',
219
+ description: 'The Game Exchange: show an "Up next" tile for other Bitmagic games and be listed in theirs. Free; not `bitmagic ads`.',
220
+ },
221
+ subCommands: {
222
+ enable: enableCommand,
223
+ disable: disableCommand,
224
+ status: statusCommand,
225
+ },
226
+ });
227
+ //# sourceMappingURL=exchange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/commands/exchange.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC9H,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAE1G,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAEhC,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,kEAAkE;CACvE,CAAC;AAaX,SAAS,WAAW;IAClB,OAAO;QACL,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CA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