@bitmagic/cli 0.1.37 → 0.1.38
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.
- package/README.md +16 -3
- package/dist/browser-gl.d.ts +23 -0
- package/dist/browser-gl.js +50 -0
- package/dist/browser-gl.js.map +1 -1
- package/dist/cli.d.ts +27 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/login.js +10 -2
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/usage.d.ts +76 -0
- package/dist/commands/usage.js +117 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/commands/verify.d.ts +13 -1
- package/dist/commands/verify.js +139 -15
- package/dist/commands/verify.js.map +1 -1
- package/dist/commands/whoami.d.ts +10 -0
- package/dist/commands/whoami.js +11 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/forge/upload-proxy.js +1 -1
- package/dist/http/client.js +3 -2
- package/dist/http/client.js.map +1 -1
- package/dist/scaffold/claude-settings.js +4 -0
- package/dist/scaffold/claude-settings.js.map +1 -1
- package/dist/scaffold/project-files.d.ts +9 -0
- package/dist/scaffold/project-files.js +67 -8
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/scaffold/project.js +2 -1
- package/dist/scaffold/project.js.map +1 -1
- package/dist/verify/browser.d.ts +37 -1
- package/dist/verify/browser.js +389 -97
- package/dist/verify/browser.js.map +1 -1
- package/dist/verify/classify.d.ts +75 -2
- package/dist/verify/classify.js +48 -2
- package/dist/verify/classify.js.map +1 -1
- package/dist/verify/iterate.d.ts +47 -0
- package/dist/verify/iterate.js +162 -0
- package/dist/verify/iterate.js.map +1 -0
- package/dist/verify/result.d.ts +16 -3
- package/dist/verify/result.js +13 -3
- package/dist/verify/result.js.map +1 -1
- package/dist/verify/settle.d.ts +60 -0
- package/dist/verify/settle.js +90 -0
- package/dist/verify/settle.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,17 @@ web Creator UI. `bitmagic init` scaffolds a project with the engine vendored in
|
|
|
5
5
|
agent edits `src/work/`, and `bitmagic verify` / `bitmagic publish` take it to bitmagic.ai — no
|
|
6
6
|
web project or per-session pod required.
|
|
7
7
|
|
|
8
|
+
## Who can use it
|
|
9
|
+
|
|
10
|
+
The CLI requires an **active Bitmagic Pro subscription** (start one from your plan page at
|
|
11
|
+
bitmagic.ai) or the Auth0 **Admin** role for internal accounts. `bitmagic login` checks this
|
|
12
|
+
immediately and prints how you were admitted, so you find out at login rather than three commands
|
|
13
|
+
later; `bitmagic whoami` shows it again at any time.
|
|
14
|
+
|
|
15
|
+
Pro also comes with a spark allowance that refills on a rolling basis — a weekly budget and a
|
|
16
|
+
5-hour one — which is what pays for `bitmagic generate`, `cover` and `forge`. When an allowance
|
|
17
|
+
runs out, generation falls back to your purchased spark balance.
|
|
18
|
+
|
|
8
19
|
## Install
|
|
9
20
|
|
|
10
21
|
```bash
|
|
@@ -35,13 +46,14 @@ browser reloads itself on every change and the assets panel shows each generatio
|
|
|
35
46
|
| Command | What it does |
|
|
36
47
|
|---|---|
|
|
37
48
|
| `bitmagic login [--env <env>]` | Device-code auth against Auth0; stores credentials per environment. |
|
|
49
|
+
| `bitmagic usage [--days N]` | Where this account's sparks went, and what Pro allowance is left. |
|
|
38
50
|
| `bitmagic logout [--env <env>]` | Remove stored credentials for an environment. |
|
|
39
51
|
| `bitmagic whoami [--env <env>]` | Show the identity the CLI is authenticated as. |
|
|
40
52
|
| `bitmagic init [dir] [--template <id>] [--name <name>] [--idea "<pitch>"] [--env <env>] [--force]` | Scaffold a new project: mints a game, downloads the vendored engine, writes `AGENTS.md`, `GAME-DESIGN.md` and templates. Starts from `empty-3d` unless told otherwise. `--idea` seeds the design doc's pitch **and** picks the template whose camera and controls fit it — "a doom-like corridor shooter" scaffolds `first-person`, "jump between floating islands" scaffolds `sidescroller`. `--template` overrides both; a suggestion that fails for any reason falls back to `empty-3d` rather than failing the scaffold. |
|
|
41
53
|
| `bitmagic check` | Typecheck (`tsc --noEmit`) against the vendored engine. Fast; does not prove the game runs. |
|
|
42
54
|
| `bitmagic dev [--port <port>] [--editor-port <port>] [--no-open]` | Build, then serve everything and keep it running: `tsc --watch`, `vite` on 3010, and a **Game / Editor** view on 3011 that reloads itself when the project changes. Opens the view in your browser; `--no-open` (or `BITMAGIC_NO_OPEN=1`) skips that. The one command to leave open. See **The dev view** below. |
|
|
43
55
|
| `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. |
|
|
44
|
-
| `bitmagic verify [--timeout <ms>]` | Build, boot the game in a headless browser, click the engine's Play button like a player would, and report what broke. 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. `--timeout`
|
|
56
|
+
| `bitmagic verify [--timeout <ms>] [--renderer webgpu\|webgl] [--fast] [--watch]` | Build, boot the game in a headless browser, click the engine's Play button like a player would, and report what broke. 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 — 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). Writes the artifacts the publish gate reads (see below). |
|
|
45
57
|
| `bitmagic build` | Bundle the game into one self-contained `.bitmagic/build/index.html`. Rarely needs to be run by hand — `publish` builds automatically when the project changed. |
|
|
46
58
|
| `bitmagic publish [--visibility public\|private] [--name <name>] [--description <desc>] [--force]` | Verify-gate, build if needed, and upload straight to GCS. **Private unless `--visibility public` is passed.** |
|
|
47
59
|
| `bitmagic upgrade [--engine <version>] [--force]` | Refresh vendored platform files and the CLI's own skills to the currently published engine. Refuses a dirty git tree unless `--force`. |
|
|
@@ -79,9 +91,10 @@ my-game/
|
|
|
79
91
|
index.html # bitmagic build's output bundle
|
|
80
92
|
manifest.json # engineVersion, fingerprint, bytes, sha256, builtAt
|
|
81
93
|
verify/
|
|
82
|
-
result.json # bitmagic verify's verdict — ok, failures, warnings, fingerprint, at
|
|
83
|
-
screenshot.png # the publish thumbnail when there is no cover art
|
|
94
|
+
result.json # bitmagic verify's verdict — ok, failures, warnings, fingerprint, at, renderer, settle, snapshot
|
|
95
|
+
screenshot.png # the publish thumbnail when there is no cover art (not written by --fast runs)
|
|
84
96
|
console.log # captured browser console output
|
|
97
|
+
console.retry.log # the software-GL retry's console, when a lost context forced one
|
|
85
98
|
```
|
|
86
99
|
|
|
87
100
|
## Cover art
|
package/dist/browser-gl.d.ts
CHANGED
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
*/
|
|
37
37
|
/** `process.platform`, named so callers can pass one in without pulling in the `NodeJS` global. */
|
|
38
38
|
export type Platform = typeof process.platform;
|
|
39
|
+
/** The renderer the game is asked to boot with (`?renderer=` — RendererPreference.ts in the
|
|
40
|
+
* engine). Distinct from what actually drives the canvas: a WebGPURenderer whose adapter never
|
|
41
|
+
* came up runs its WebGL2 fallback backend, which is exactly what verify now detects. */
|
|
42
|
+
export type RendererChoice = 'webgpu' | 'webgl';
|
|
39
43
|
/**
|
|
40
44
|
* Chrome flags for the GL backend, given the environment and platform.
|
|
41
45
|
*
|
|
@@ -48,3 +52,22 @@ export type Platform = typeof process.platform;
|
|
|
48
52
|
* for Vulkan would take that away.
|
|
49
53
|
*/
|
|
50
54
|
export declare function browserGlArgs(env: Record<string, string | undefined>, platform?: Platform): string[];
|
|
55
|
+
/**
|
|
56
|
+
* Chrome flags for booting the game on a specific renderer, given the environment and platform.
|
|
57
|
+
*
|
|
58
|
+
* For WebGL this is exactly `browserGlArgs`. For WebGPU it additionally permits the API in
|
|
59
|
+
* headless Chrome, where `navigator.gpu` otherwise exists but never yields an adapter — the game
|
|
60
|
+
* then silently runs three's WebGL2 fallback backend, which is precisely the undetected state
|
|
61
|
+
* verify exists to catch.
|
|
62
|
+
*/
|
|
63
|
+
export declare function browserRendererArgs(env: Record<string, string | undefined>, renderer: RendererChoice, platform?: Platform): string[];
|
|
64
|
+
/**
|
|
65
|
+
* Whether a failed run is worth one automatic re-run on software GL.
|
|
66
|
+
*
|
|
67
|
+
* A lost WebGL context is a property of the machine's GPU/driver/compositor stack, not of the
|
|
68
|
+
* game (see the file header) — the software path sidesteps that stack entirely. Pointless when
|
|
69
|
+
* software GL was already in effect, which is what the env checks establish.
|
|
70
|
+
*/
|
|
71
|
+
export declare function shouldRetrySoftwareGl(observations: {
|
|
72
|
+
webglContextLost: boolean;
|
|
73
|
+
}, env: Record<string, string | undefined>): boolean;
|
package/dist/browser-gl.js
CHANGED
|
@@ -65,4 +65,54 @@ export function browserGlArgs(env, platform = process.platform) {
|
|
|
65
65
|
'--enable-unsafe-swiftshader',
|
|
66
66
|
];
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Chrome flags for booting the game on a specific renderer, given the environment and platform.
|
|
70
|
+
*
|
|
71
|
+
* For WebGL this is exactly `browserGlArgs`. For WebGPU it additionally permits the API in
|
|
72
|
+
* headless Chrome, where `navigator.gpu` otherwise exists but never yields an adapter — the game
|
|
73
|
+
* then silently runs three's WebGL2 fallback backend, which is precisely the undetected state
|
|
74
|
+
* verify exists to catch.
|
|
75
|
+
*/
|
|
76
|
+
export function browserRendererArgs(env, renderer, platform = process.platform) {
|
|
77
|
+
const base = browserGlArgs(env, platform);
|
|
78
|
+
if (renderer !== 'webgpu')
|
|
79
|
+
return base;
|
|
80
|
+
return mergeEnableFeatures([...base, '--enable-unsafe-webgpu'], ['WebGPU']);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Append feature-flag values as ONE `--enable-features` argument, merged with any already present.
|
|
84
|
+
*
|
|
85
|
+
* Not cosmetic: Chrome keeps only the LAST `--enable-features` flag it sees, so naively appending
|
|
86
|
+
* `--enable-features=WebGPU` after the Linux GL args would silently drop `Vulkan` — the flag that
|
|
87
|
+
* keeps rendering off SwiftShader — and the run would slow to a crawl with nothing announcing why.
|
|
88
|
+
*/
|
|
89
|
+
function mergeEnableFeatures(args, features) {
|
|
90
|
+
const PREFIX = '--enable-features=';
|
|
91
|
+
const merged = [];
|
|
92
|
+
for (const arg of args) {
|
|
93
|
+
if (!arg.startsWith(PREFIX))
|
|
94
|
+
continue;
|
|
95
|
+
for (const value of arg.slice(PREFIX.length).split(',')) {
|
|
96
|
+
if (value !== '' && !merged.includes(value))
|
|
97
|
+
merged.push(value);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
for (const value of features) {
|
|
101
|
+
if (!merged.includes(value))
|
|
102
|
+
merged.push(value);
|
|
103
|
+
}
|
|
104
|
+
return [...args.filter((arg) => !arg.startsWith(PREFIX)), `${PREFIX}${merged.join(',')}`];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Whether a failed run is worth one automatic re-run on software GL.
|
|
108
|
+
*
|
|
109
|
+
* A lost WebGL context is a property of the machine's GPU/driver/compositor stack, not of the
|
|
110
|
+
* game (see the file header) — the software path sidesteps that stack entirely. Pointless when
|
|
111
|
+
* software GL was already in effect, which is what the env checks establish.
|
|
112
|
+
*/
|
|
113
|
+
export function shouldRetrySoftwareGl(observations, env) {
|
|
114
|
+
return (observations.webglContextLost
|
|
115
|
+
&& env.CI !== 'true'
|
|
116
|
+
&& env.BITMAGIC_BROWSER_SOFTWARE_GL !== 'true');
|
|
117
|
+
}
|
|
68
118
|
//# sourceMappingURL=browser-gl.js.map
|
package/dist/browser-gl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-gl.js","sourceRoot":"","sources":["../src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AAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,SAAS;QACtC,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACxD,IAAI,KAAK,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC5F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,YAA2C,EAC3C,GAAuC;IAEvC,OAAO,CACL,YAAY,CAAC,gBAAgB;WAC1B,GAAG,CAAC,EAAE,KAAK,MAAM;WACjB,GAAG,CAAC,4BAA4B,KAAK,MAAM,CAC/C,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -38,6 +38,20 @@ declare const rawCommands: {
|
|
|
38
38
|
readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
|
|
39
39
|
};
|
|
40
40
|
}>;
|
|
41
|
+
usage: CommandDef<{
|
|
42
|
+
readonly days: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
readonly description: "How many days to report on (default 30, max 90).";
|
|
45
|
+
};
|
|
46
|
+
readonly env: {
|
|
47
|
+
readonly type: "string";
|
|
48
|
+
readonly description: "Environment to query (dev, prod, local).";
|
|
49
|
+
};
|
|
50
|
+
readonly json: {
|
|
51
|
+
readonly type: "boolean";
|
|
52
|
+
readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
41
55
|
init: CommandDef<{
|
|
42
56
|
readonly dir: {
|
|
43
57
|
readonly type: "positional";
|
|
@@ -116,7 +130,19 @@ declare const rawCommands: {
|
|
|
116
130
|
verify: CommandDef<{
|
|
117
131
|
readonly timeout: {
|
|
118
132
|
readonly type: "string";
|
|
119
|
-
readonly description:
|
|
133
|
+
readonly description: string;
|
|
134
|
+
};
|
|
135
|
+
readonly renderer: {
|
|
136
|
+
readonly type: "string";
|
|
137
|
+
readonly description: "Renderer to boot the game with: webgpu (default, what players run) or webgl.";
|
|
138
|
+
};
|
|
139
|
+
readonly fast: {
|
|
140
|
+
readonly type: "boolean";
|
|
141
|
+
readonly description: string;
|
|
142
|
+
};
|
|
143
|
+
readonly watch: {
|
|
144
|
+
readonly type: "boolean";
|
|
145
|
+
readonly description: string;
|
|
120
146
|
};
|
|
121
147
|
readonly json: {
|
|
122
148
|
readonly type: "boolean";
|
package/dist/cli.js
CHANGED
|
@@ -4,6 +4,7 @@ import { jsonErrorResult } from './output.js';
|
|
|
4
4
|
import { loginCommand } from './commands/login.js';
|
|
5
5
|
import { logoutCommand } from './commands/logout.js';
|
|
6
6
|
import { whoamiCommand } from './commands/whoami.js';
|
|
7
|
+
import { usageCommand } from './commands/usage.js';
|
|
7
8
|
import { initCommand } from './commands/init.js';
|
|
8
9
|
import { upgradeCommand } from './commands/upgrade.js';
|
|
9
10
|
import { checkCommand } from './commands/check.js';
|
|
@@ -99,6 +100,7 @@ const rawCommands = {
|
|
|
99
100
|
login: loginCommand,
|
|
100
101
|
logout: logoutCommand,
|
|
101
102
|
whoami: whoamiCommand,
|
|
103
|
+
usage: usageCommand,
|
|
102
104
|
init: initCommand,
|
|
103
105
|
upgrade: upgradeCommand,
|
|
104
106
|
check: checkCommand,
|
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,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,6FAA6F;AAC7F,2FAA2F;AAC3F,+FAA+F;AAC/F,gGAAgG;AAChG,8FAA8F;AAC9F,4EAA4E;AAE5E,gGAAgG;AAChG,+FAA+F;AAC/F,iFAAiF;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AAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;AACvE,CAAC;AAED,4FAA4F;AAC5F,+FAA+F;AAC/F,+DAA+D;AAC/D,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,YAAY;IACnB,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,eAAe;IACzB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,cAAc;CACxB,CAAC;AAIF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAC1C,MAAM,CAAC,OAAO,CAAC,WAAW,CAA+C,CAAC,GAAG,CAC5E,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CACtD,CAC0C,CAAC;AAE9C,iGAAiG;AACjG,8FAA8F;AAC9F,uFAAuF;AACvF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC;IAChC,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,gDAAgD;KAC9D;IACD,WAAW;CACZ,CAAC,CAAC"}
|
package/dist/commands/login.js
CHANGED
|
@@ -35,11 +35,19 @@ export const loginCommand = defineCommand({
|
|
|
35
35
|
writeCredentials(environment.name, credentials);
|
|
36
36
|
writeDefaultEnvironment(environment.name);
|
|
37
37
|
// Prove the login rather than assuming it: a token Auth0 accepted is not the same as an
|
|
38
|
-
// account api-server
|
|
38
|
+
// account api-server admits to the CLI (Admin role or an active Bitmagic Pro subscription).
|
|
39
39
|
const me = await runWhoami(environment.name);
|
|
40
40
|
output.info(`Logged in to ${environment.name} as ${me.userId}.`);
|
|
41
41
|
output.info(`roles: ${me.roles.length > 0 ? me.roles.join(', ') : '(none)'}`);
|
|
42
|
-
|
|
42
|
+
if (me.access)
|
|
43
|
+
output.info(`access: ${me.access}`);
|
|
44
|
+
output.result({
|
|
45
|
+
ok: true,
|
|
46
|
+
environment: environment.name,
|
|
47
|
+
userId: me.userId,
|
|
48
|
+
roles: me.roles,
|
|
49
|
+
...(me.access ? { access: me.access } : {}),
|
|
50
|
+
});
|
|
43
51
|
},
|
|
44
52
|
});
|
|
45
53
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,KAAK,EAAE,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;CAC/E,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;IACxC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,8CAA8C,EAAE;IACpF,IAAI,EAA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**
|
|
2
|
+
* `bitmagic usage` — where this account's sparks went.
|
|
3
|
+
*
|
|
4
|
+
* The server does the aggregating (GET /api/cli/v1/sparks/usage), and the plan
|
|
5
|
+
* page on the web renders the SAME payload, so the two surfaces cannot disagree
|
|
6
|
+
* about what a category means or which window is which.
|
|
7
|
+
*
|
|
8
|
+
* Rendering is a pure function over the response, following the bake-progress
|
|
9
|
+
* convention: formatting is testable without a network, and printing is one
|
|
10
|
+
* call. Plain aligned text and no colour — an agent tool is usually what reads
|
|
11
|
+
* this, and render/inline-image.ts is documented as the only place in the
|
|
12
|
+
* package that writes escape sequences.
|
|
13
|
+
*/
|
|
14
|
+
interface UsageWindow {
|
|
15
|
+
limit: number;
|
|
16
|
+
used: number;
|
|
17
|
+
remaining: number;
|
|
18
|
+
/** Epoch ms, or null when the window is closed and reopens on next use. */
|
|
19
|
+
resetsAt: number | null;
|
|
20
|
+
}
|
|
21
|
+
interface UsageAllowance {
|
|
22
|
+
total: number;
|
|
23
|
+
long: UsageWindow;
|
|
24
|
+
short: UsageWindow;
|
|
25
|
+
}
|
|
26
|
+
export interface UsageResponse {
|
|
27
|
+
success: boolean;
|
|
28
|
+
userId: string;
|
|
29
|
+
period: {
|
|
30
|
+
days: number;
|
|
31
|
+
fromMs: number;
|
|
32
|
+
toMs: number;
|
|
33
|
+
};
|
|
34
|
+
totalSparks: number;
|
|
35
|
+
fromAllowance: number;
|
|
36
|
+
fromPurchased: number;
|
|
37
|
+
byCategory: Array<{
|
|
38
|
+
category: string;
|
|
39
|
+
label: string;
|
|
40
|
+
sparks: number;
|
|
41
|
+
}>;
|
|
42
|
+
byDay: Array<{
|
|
43
|
+
day: string;
|
|
44
|
+
sparks: number;
|
|
45
|
+
}>;
|
|
46
|
+
allowance: UsageAllowance | null;
|
|
47
|
+
}
|
|
48
|
+
/** "2h 10m" / "40m" / "4d" — coarse on purpose; this is a report, not a countdown. */
|
|
49
|
+
export declare function formatResetIn(resetsAt: number | null, now: number): string;
|
|
50
|
+
/**
|
|
51
|
+
* PURE. The whole report as text.
|
|
52
|
+
*
|
|
53
|
+
* `now` is a parameter rather than a `Date.now()` call so reset times are
|
|
54
|
+
* testable, and so every line of one report agrees on a single instant.
|
|
55
|
+
*/
|
|
56
|
+
export declare function formatUsageReport(report: UsageResponse, now?: number): string;
|
|
57
|
+
export interface UsageOptions {
|
|
58
|
+
days?: number;
|
|
59
|
+
env?: string;
|
|
60
|
+
}
|
|
61
|
+
export declare function runUsage(options?: UsageOptions): Promise<UsageResponse>;
|
|
62
|
+
export declare const usageCommand: import("citty").CommandDef<{
|
|
63
|
+
readonly days: {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
readonly description: "How many days to report on (default 30, max 90).";
|
|
66
|
+
};
|
|
67
|
+
readonly env: {
|
|
68
|
+
readonly type: "string";
|
|
69
|
+
readonly description: "Environment to query (dev, prod, local).";
|
|
70
|
+
};
|
|
71
|
+
readonly json: {
|
|
72
|
+
readonly type: "boolean";
|
|
73
|
+
readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { defineCommand } from 'citty';
|
|
2
|
+
import { resolveEnvironment, resolveAuth0ClientId } from '../config/environments.js';
|
|
3
|
+
import { readDefaultEnvironment } from '../config/credentials.js';
|
|
4
|
+
import { getAccessToken } from '../auth/session.js';
|
|
5
|
+
import { apiGet } from '../http/client.js';
|
|
6
|
+
import { createOutput } from '../output.js';
|
|
7
|
+
const BAR_WIDTH = 18;
|
|
8
|
+
function bar(value, max) {
|
|
9
|
+
if (max <= 0 || value <= 0)
|
|
10
|
+
return '';
|
|
11
|
+
// At least one block for any non-zero value, so a small category is visible
|
|
12
|
+
// rather than reading as nothing at all.
|
|
13
|
+
return '▇'.repeat(Math.max(1, Math.round((value / max) * BAR_WIDTH)));
|
|
14
|
+
}
|
|
15
|
+
function sparks(n) {
|
|
16
|
+
return n.toLocaleString('en-US');
|
|
17
|
+
}
|
|
18
|
+
/** "2h 10m" / "40m" / "4d" — coarse on purpose; this is a report, not a countdown. */
|
|
19
|
+
export function formatResetIn(resetsAt, now) {
|
|
20
|
+
if (resetsAt === null)
|
|
21
|
+
return 'resets when you next use it';
|
|
22
|
+
const minutes = Math.max(0, Math.ceil((resetsAt - now) / 60_000));
|
|
23
|
+
if (minutes < 60)
|
|
24
|
+
return `resets in ${minutes}m`;
|
|
25
|
+
const hours = Math.floor(minutes / 60);
|
|
26
|
+
if (hours < 48) {
|
|
27
|
+
const rest = minutes % 60;
|
|
28
|
+
return rest === 0 ? `resets in ${hours}h` : `resets in ${hours}h ${rest}m`;
|
|
29
|
+
}
|
|
30
|
+
return `resets in ${Math.floor(hours / 24)}d`;
|
|
31
|
+
}
|
|
32
|
+
/** '2026-08-13' -> 'Aug 13'. */
|
|
33
|
+
function shortDay(day) {
|
|
34
|
+
const d = new Date(`${day}T00:00:00Z`);
|
|
35
|
+
if (Number.isNaN(d.getTime()))
|
|
36
|
+
return day;
|
|
37
|
+
return `${d.toLocaleString('en-US', { month: 'short', timeZone: 'UTC' })} ${d.getUTCDate()}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* PURE. The whole report as text.
|
|
41
|
+
*
|
|
42
|
+
* `now` is a parameter rather than a `Date.now()` call so reset times are
|
|
43
|
+
* testable, and so every line of one report agrees on a single instant.
|
|
44
|
+
*/
|
|
45
|
+
export function formatUsageReport(report, now = Date.now()) {
|
|
46
|
+
const lines = [];
|
|
47
|
+
lines.push(`Bitmagic usage — last ${report.period.days} days`);
|
|
48
|
+
lines.push('');
|
|
49
|
+
if (report.allowance) {
|
|
50
|
+
const windows = [
|
|
51
|
+
['This 5-hour window', report.allowance.short],
|
|
52
|
+
['This week', report.allowance.long],
|
|
53
|
+
];
|
|
54
|
+
const labelWidth = Math.max(...windows.map(([label]) => label.length));
|
|
55
|
+
for (const [label, w] of windows) {
|
|
56
|
+
const amount = `${sparks(w.used)} / ${sparks(w.limit)}`;
|
|
57
|
+
lines.push(` ${label.padEnd(labelWidth)} ${amount.padStart(13)} ${formatResetIn(w.resetsAt, now)}`);
|
|
58
|
+
}
|
|
59
|
+
lines.push('');
|
|
60
|
+
}
|
|
61
|
+
if (report.totalSparks === 0) {
|
|
62
|
+
lines.push(' No sparks spent in this period.');
|
|
63
|
+
return lines.join('\n');
|
|
64
|
+
}
|
|
65
|
+
const labelWidth = Math.max(...report.byCategory.map((c) => c.label.length), 'Total'.length);
|
|
66
|
+
const topCategory = report.byCategory[0]?.sparks ?? 0;
|
|
67
|
+
for (const c of report.byCategory) {
|
|
68
|
+
lines.push(` ${c.label.padEnd(labelWidth)} ${sparks(c.sparks).padStart(8)} ${bar(c.sparks, topCategory)}`);
|
|
69
|
+
}
|
|
70
|
+
const split = report.allowance || report.fromAllowance > 0
|
|
71
|
+
? ` (${sparks(report.fromAllowance)} from your Pro allowance, ${sparks(report.fromPurchased)} from your balance)`
|
|
72
|
+
: '';
|
|
73
|
+
lines.push(` ${'Total'.padEnd(labelWidth)} ${sparks(report.totalSparks).padStart(8)}${split}`);
|
|
74
|
+
// Only the tail of the series, and only once something was actually spent —
|
|
75
|
+
// 30 mostly-empty rows is noise, not a trend.
|
|
76
|
+
const recent = report.byDay.slice(-14);
|
|
77
|
+
const busiest = Math.max(...recent.map((d) => d.sparks), 0);
|
|
78
|
+
if (busiest > 0) {
|
|
79
|
+
lines.push('');
|
|
80
|
+
for (const d of recent) {
|
|
81
|
+
lines.push(` ${shortDay(d.day).padEnd(7)} ${bar(d.sparks, busiest).padEnd(BAR_WIDTH)} ${sparks(d.sparks).padStart(7)}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return lines.join('\n');
|
|
85
|
+
}
|
|
86
|
+
const deviceFlowDeps = { fetch: globalThis.fetch, sleep: (ms) => new Promise((r) => setTimeout(r, ms)) };
|
|
87
|
+
export async function runUsage(options = {}) {
|
|
88
|
+
const environment = resolveEnvironment({
|
|
89
|
+
explicit: options.env,
|
|
90
|
+
storedDefault: readDefaultEnvironment(),
|
|
91
|
+
});
|
|
92
|
+
const clientId = resolveAuth0ClientId(environment);
|
|
93
|
+
const token = await getAccessToken(environment, clientId, deviceFlowDeps);
|
|
94
|
+
const query = options.days === undefined ? '' : `?days=${encodeURIComponent(String(options.days))}`;
|
|
95
|
+
return apiGet(environment, `/api/cli/v1/sparks/usage${query}`, token, {
|
|
96
|
+
fetch: globalThis.fetch,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
export const usageCommand = defineCommand({
|
|
100
|
+
meta: { name: 'usage', description: 'Show where this account\'s sparks went, and what Pro allowance is left.' },
|
|
101
|
+
args: {
|
|
102
|
+
days: { type: 'string', description: 'How many days to report on (default 30, max 90).' },
|
|
103
|
+
env: { type: 'string', description: 'Environment to query (dev, prod, local).' },
|
|
104
|
+
json: {
|
|
105
|
+
type: 'boolean',
|
|
106
|
+
description: 'Print the result as JSON on stdout; all progress goes to stderr.',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
async run({ args }) {
|
|
110
|
+
const output = createOutput(args.json === true);
|
|
111
|
+
const days = args.days === undefined ? undefined : Number(args.days);
|
|
112
|
+
const report = await runUsage({ days, env: args.env });
|
|
113
|
+
output.info(formatUsageReport(report));
|
|
114
|
+
output.result({ ok: true, ...report });
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=usage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/commands/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,E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GAAG,MAAM,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACvD,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACzC,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
export declare const verifyCommand: import("citty").CommandDef<{
|
|
2
2
|
readonly timeout: {
|
|
3
3
|
readonly type: "string";
|
|
4
|
-
readonly description:
|
|
4
|
+
readonly description: string;
|
|
5
|
+
};
|
|
6
|
+
readonly renderer: {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly description: "Renderer to boot the game with: webgpu (default, what players run) or webgl.";
|
|
9
|
+
};
|
|
10
|
+
readonly fast: {
|
|
11
|
+
readonly type: "boolean";
|
|
12
|
+
readonly description: string;
|
|
13
|
+
};
|
|
14
|
+
readonly watch: {
|
|
15
|
+
readonly type: "boolean";
|
|
16
|
+
readonly description: string;
|
|
5
17
|
};
|
|
6
18
|
readonly json: {
|
|
7
19
|
readonly type: "boolean";
|