@bitmagic/cli 0.1.31 → 0.1.33
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 +1 -1
- package/dist/browser-gl.d.ts +38 -0
- package/dist/browser-gl.js +53 -0
- package/dist/browser-gl.js.map +1 -0
- package/dist/cli.d.ts +2 -2
- package/dist/commands/init.d.ts +2 -2
- package/dist/commands/init.js +57 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/forge/browser-host.d.ts +6 -4
- package/dist/forge/browser-host.js +10 -11
- package/dist/forge/browser-host.js.map +1 -1
- package/dist/scaffold/project.d.ts +33 -0
- package/dist/scaffold/project.js +41 -6
- package/dist/scaffold/project.js.map +1 -1
- package/dist/scaffold/suggest-template.d.ts +31 -0
- package/dist/scaffold/suggest-template.js +41 -0
- package/dist/scaffold/suggest-template.js.map +1 -0
- package/dist/verify/browser.js +8 -1
- package/dist/verify/browser.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ browser reloads itself on every change and the assets panel shows each generatio
|
|
|
37
37
|
| `bitmagic login [--env <env>]` | Device-code auth against Auth0; stores credentials per environment. |
|
|
38
38
|
| `bitmagic logout [--env <env>]` | Remove stored credentials for an environment. |
|
|
39
39
|
| `bitmagic whoami [--env <env>]` | Show the identity the CLI is authenticated as. |
|
|
40
|
-
| `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. `--idea` seeds the design doc's pitch. |
|
|
40
|
+
| `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
41
|
| `bitmagic check` | Typecheck (`tsc --noEmit`) against the vendored engine. Fast; does not prove the game runs. |
|
|
42
42
|
| `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
43
|
| `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. |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which GL backend the CLI's headless Chrome renders the game with. One place, because `verify`
|
|
3
|
+
* and `forge` want exactly the same answer and got it wrong in opposite directions before.
|
|
4
|
+
*
|
|
5
|
+
* The thing to know: **headless Chrome does not use the machine's GPU unless it is told to.**
|
|
6
|
+
* On Linux the GPU process starts with no display and no ANGLE backend it trusts, so it falls
|
|
7
|
+
* back to SwiftShader — Chrome's software rasteriser — and every WebGL2 draw runs on the CPU.
|
|
8
|
+
* Nothing announces this. `WEBGL_debug_renderer_info` reports
|
|
9
|
+
* `ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero)), SwiftShader driver)` on a machine
|
|
10
|
+
* whose real GPU is idle two feet away, and a fill-heavy frame that takes 0.2ms on the GPU takes
|
|
11
|
+
* ~70ms in software. That is the whole reason a verify run of a healthy game feels slow.
|
|
12
|
+
*
|
|
13
|
+
* `--use-angle=vulkan` is what fixes it, and the choice of Vulkan over `--use-angle=gl` is
|
|
14
|
+
* deliberate: the GL backend needs an X display, so it works from a developer's terminal and
|
|
15
|
+
* silently drops back to SwiftShader from anything without `DISPLAY` (a systemd service, a
|
|
16
|
+
* detached agent run, an ssh session). The Vulkan backend needs no display at all and reaches the
|
|
17
|
+
* discrete GPU either way, so the result does not depend on how the CLI was invoked.
|
|
18
|
+
*
|
|
19
|
+
* `--enable-unsafe-swiftshader` stays on in BOTH modes. It does not force software rendering
|
|
20
|
+
* (`--use-angle=swiftshader` does that); it only permits the fallback, which Chrome otherwise
|
|
21
|
+
* deprecation-warns about and is on a path to refusing outright. Keeping it means a machine with
|
|
22
|
+
* no usable GPU still renders — slowly, but it renders — instead of failing verify with a dead
|
|
23
|
+
* WebGL context that looks like a broken game.
|
|
24
|
+
*/
|
|
25
|
+
/** `process.platform`, named so callers can pass one in without pulling in the `NodeJS` global. */
|
|
26
|
+
export type Platform = typeof process.platform;
|
|
27
|
+
/**
|
|
28
|
+
* Chrome flags for the GL backend, given the environment and platform.
|
|
29
|
+
*
|
|
30
|
+
* Software GL is used when `CI=true` (GitHub-hosted runners have no GPU, and asking ANGLE for a
|
|
31
|
+
* Vulkan device there just wastes the startup) or when `BITMAGIC_BROWSER_SOFTWARE_GL=true`, the
|
|
32
|
+
* escape hatch for a machine whose driver makes the GPU path worse than the software one.
|
|
33
|
+
*
|
|
34
|
+
* Everywhere else the real GPU is requested. The Vulkan flags are Linux-only because they are only
|
|
35
|
+
* a fix there: macOS headless already reaches the GPU through ANGLE's Metal backend, and asking it
|
|
36
|
+
* for Vulkan would take that away.
|
|
37
|
+
*/
|
|
38
|
+
export declare function browserGlArgs(env: Record<string, string | undefined>, platform?: Platform): string[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which GL backend the CLI's headless Chrome renders the game with. One place, because `verify`
|
|
3
|
+
* and `forge` want exactly the same answer and got it wrong in opposite directions before.
|
|
4
|
+
*
|
|
5
|
+
* The thing to know: **headless Chrome does not use the machine's GPU unless it is told to.**
|
|
6
|
+
* On Linux the GPU process starts with no display and no ANGLE backend it trusts, so it falls
|
|
7
|
+
* back to SwiftShader — Chrome's software rasteriser — and every WebGL2 draw runs on the CPU.
|
|
8
|
+
* Nothing announces this. `WEBGL_debug_renderer_info` reports
|
|
9
|
+
* `ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero)), SwiftShader driver)` on a machine
|
|
10
|
+
* whose real GPU is idle two feet away, and a fill-heavy frame that takes 0.2ms on the GPU takes
|
|
11
|
+
* ~70ms in software. That is the whole reason a verify run of a healthy game feels slow.
|
|
12
|
+
*
|
|
13
|
+
* `--use-angle=vulkan` is what fixes it, and the choice of Vulkan over `--use-angle=gl` is
|
|
14
|
+
* deliberate: the GL backend needs an X display, so it works from a developer's terminal and
|
|
15
|
+
* silently drops back to SwiftShader from anything without `DISPLAY` (a systemd service, a
|
|
16
|
+
* detached agent run, an ssh session). The Vulkan backend needs no display at all and reaches the
|
|
17
|
+
* discrete GPU either way, so the result does not depend on how the CLI was invoked.
|
|
18
|
+
*
|
|
19
|
+
* `--enable-unsafe-swiftshader` stays on in BOTH modes. It does not force software rendering
|
|
20
|
+
* (`--use-angle=swiftshader` does that); it only permits the fallback, which Chrome otherwise
|
|
21
|
+
* deprecation-warns about and is on a path to refusing outright. Keeping it means a machine with
|
|
22
|
+
* no usable GPU still renders — slowly, but it renders — instead of failing verify with a dead
|
|
23
|
+
* WebGL context that looks like a broken game.
|
|
24
|
+
*/
|
|
25
|
+
/** Chrome falls back to SwiftShader on its own; these force it, for machines with no GPU at all. */
|
|
26
|
+
const SOFTWARE_GL_ARGS = ['--enable-unsafe-swiftshader', '--use-gl=angle', '--use-angle=swiftshader'];
|
|
27
|
+
/**
|
|
28
|
+
* Chrome flags for the GL backend, given the environment and platform.
|
|
29
|
+
*
|
|
30
|
+
* Software GL is used when `CI=true` (GitHub-hosted runners have no GPU, and asking ANGLE for a
|
|
31
|
+
* Vulkan device there just wastes the startup) or when `BITMAGIC_BROWSER_SOFTWARE_GL=true`, the
|
|
32
|
+
* escape hatch for a machine whose driver makes the GPU path worse than the software one.
|
|
33
|
+
*
|
|
34
|
+
* Everywhere else the real GPU is requested. The Vulkan flags are Linux-only because they are only
|
|
35
|
+
* a fix there: macOS headless already reaches the GPU through ANGLE's Metal backend, and asking it
|
|
36
|
+
* for Vulkan would take that away.
|
|
37
|
+
*/
|
|
38
|
+
export function browserGlArgs(env, platform = process.platform) {
|
|
39
|
+
if (env.CI === 'true' || env.BITMAGIC_BROWSER_SOFTWARE_GL === 'true')
|
|
40
|
+
return [...SOFTWARE_GL_ARGS];
|
|
41
|
+
if (platform !== 'linux')
|
|
42
|
+
return ['--enable-unsafe-swiftshader'];
|
|
43
|
+
return [
|
|
44
|
+
'--use-angle=vulkan',
|
|
45
|
+
'--enable-features=Vulkan',
|
|
46
|
+
// The blocklist is written for interactive browsing; it disables GPU rasterisation for whole
|
|
47
|
+
// driver versions over bugs that do not touch a headless WebGL canvas.
|
|
48
|
+
'--ignore-gpu-blocklist',
|
|
49
|
+
'--enable-gpu',
|
|
50
|
+
'--enable-unsafe-swiftshader',
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=browser-gl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-gl.js","sourceRoot":"","sources":["../src/browser-gl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,oGAAoG;AACpG,MAAM,gBAAgB,GAAG,CAAC,6BAA6B,EAAE,gBAAgB,EAAE,yBAAyB,CAAC,CAAC;AAEtG;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAC3B,GAAuC,EACvC,WAAqB,OAAO,CAAC,QAAQ;IAErC,IAAI,GAAG,CAAC,EAAE,KAAK,MAAM,IAAI,GAAG,CAAC,4BAA4B,KAAK,MAAM;QAAE,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC;IACnG,IAAI,QAAQ,KAAK,OAAO;QAAE,OAAO,CAAC,6BAA6B,CAAC,CAAC;IACjE,OAAO;QACL,oBAAoB;QACpB,0BAA0B;QAC1B,6FAA6F;QAC7F,uEAAuE;QACvE,wBAAwB;QACxB,cAAc;QACd,6BAA6B;KAC9B,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ declare const rawCommands: {
|
|
|
46
46
|
};
|
|
47
47
|
readonly template: {
|
|
48
48
|
readonly type: "string";
|
|
49
|
-
readonly description: "Template id (see templates in the engine bundle).";
|
|
49
|
+
readonly description: "Template id (see templates in the engine bundle). Defaults to empty-3d, or to whatever --idea suggests.";
|
|
50
50
|
};
|
|
51
51
|
readonly name: {
|
|
52
52
|
readonly type: "string";
|
|
@@ -54,7 +54,7 @@ declare const rawCommands: {
|
|
|
54
54
|
};
|
|
55
55
|
readonly idea: {
|
|
56
56
|
readonly type: "string";
|
|
57
|
-
readonly description: "One-line pitch
|
|
57
|
+
readonly description: "One-line pitch. Seeds GAME-DESIGN.md and picks the template whose camera and controls fit it. Optional — you can write it yourself.";
|
|
58
58
|
};
|
|
59
59
|
readonly env: {
|
|
60
60
|
readonly type: "string";
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const initCommand: import("citty").CommandDef<{
|
|
|
6
6
|
};
|
|
7
7
|
readonly template: {
|
|
8
8
|
readonly type: "string";
|
|
9
|
-
readonly description: "Template id (see templates in the engine bundle).";
|
|
9
|
+
readonly description: "Template id (see templates in the engine bundle). Defaults to empty-3d, or to whatever --idea suggests.";
|
|
10
10
|
};
|
|
11
11
|
readonly name: {
|
|
12
12
|
readonly type: "string";
|
|
@@ -14,7 +14,7 @@ export declare const initCommand: import("citty").CommandDef<{
|
|
|
14
14
|
};
|
|
15
15
|
readonly idea: {
|
|
16
16
|
readonly type: "string";
|
|
17
|
-
readonly description: "One-line pitch
|
|
17
|
+
readonly description: "One-line pitch. Seeds GAME-DESIGN.md and picks the template whose camera and controls fit it. Optional — you can write it yourself.";
|
|
18
18
|
};
|
|
19
19
|
readonly env: {
|
|
20
20
|
readonly type: "string";
|
package/dist/commands/init.js
CHANGED
|
@@ -10,7 +10,8 @@ import { readDefaultEnvironment } from '../config/credentials.js';
|
|
|
10
10
|
import { getAccessToken } from '../auth/session.js';
|
|
11
11
|
import { apiPost } from '../http/client.js';
|
|
12
12
|
import { fetchEngineManifest, downloadAndVerify, extractEngine } from '../scaffold/engine-download.js';
|
|
13
|
-
import { resolveTemplate, scaffoldProject } from '../scaffold/project.js';
|
|
13
|
+
import { DEFAULT_TEMPLATE_ID, SUGGESTION_EXCLUDED_TEMPLATE_IDS, readTemplateIndex, resolveTemplate, scaffoldProject, } from '../scaffold/project.js';
|
|
14
|
+
import { suggestTemplate } from '../scaffold/suggest-template.js';
|
|
14
15
|
const deps = {
|
|
15
16
|
fetch: globalThis.fetch,
|
|
16
17
|
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
@@ -85,15 +86,64 @@ function printNextSteps(output, dir, gameId, installSucceeded, hasIdea) {
|
|
|
85
86
|
output.info(' bitmagic cover');
|
|
86
87
|
output.info(' bitmagic check');
|
|
87
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Decide which template to scaffold from.
|
|
91
|
+
*
|
|
92
|
+
* `--template` wins outright and skips the model call entirely: someone who named a template has
|
|
93
|
+
* already made the decision this function otherwise makes for them.
|
|
94
|
+
*
|
|
95
|
+
* With `--idea` and no `--template`, the pitch names a camera and control scheme far more often
|
|
96
|
+
* than not ("a doom-like corridor shooter" is first-person; "jump between floating islands" is a
|
|
97
|
+
* sidescroller), so it is worth one small model call to start from the right controls rather than
|
|
98
|
+
* making the creator's agent rewrite them. A suggestion that fails for ANY reason falls through to
|
|
99
|
+
* the default — the creator gets a working scaffold and a one-line note, never a failed `init`.
|
|
100
|
+
*/
|
|
101
|
+
async function chooseTemplate(templatesDir, args, environment, token, output) {
|
|
102
|
+
if (args.template !== undefined) {
|
|
103
|
+
return { template: resolveTemplate(templatesDir, args.template), source: 'explicit' };
|
|
104
|
+
}
|
|
105
|
+
const fallback = resolveTemplate(templatesDir);
|
|
106
|
+
if (args.idea === undefined) {
|
|
107
|
+
return { template: fallback, source: 'default' };
|
|
108
|
+
}
|
|
109
|
+
const candidates = readTemplateIndex(templatesDir).filter((t) => !SUGGESTION_EXCLUDED_TEMPLATE_IDS.includes(t.id));
|
|
110
|
+
// Nothing left to choose between — don't spend a round trip to be told so.
|
|
111
|
+
if (candidates.length === 0) {
|
|
112
|
+
return { template: fallback, source: 'default' };
|
|
113
|
+
}
|
|
114
|
+
output.info('Matching your idea to a template…');
|
|
115
|
+
const suggestion = await suggestTemplate({
|
|
116
|
+
environment,
|
|
117
|
+
token,
|
|
118
|
+
idea: args.idea,
|
|
119
|
+
templates: candidates,
|
|
120
|
+
defaultTemplateId: DEFAULT_TEMPLATE_ID,
|
|
121
|
+
deps: { fetch: globalThis.fetch },
|
|
122
|
+
});
|
|
123
|
+
if (!suggestion) {
|
|
124
|
+
output.info(`Could not match your idea to a template — starting from "${fallback.id}".`);
|
|
125
|
+
return { template: fallback, source: 'default' };
|
|
126
|
+
}
|
|
127
|
+
// Safe by construction: suggestTemplate only returns an id it found in the list it was given,
|
|
128
|
+
// which is the same index resolveTemplate reads.
|
|
129
|
+
const template = resolveTemplate(templatesDir, suggestion.templateId);
|
|
130
|
+
output.info(suggestion.reason
|
|
131
|
+
? `Using template "${template.id}" — ${suggestion.reason}.`
|
|
132
|
+
: `Using template "${template.id}".`);
|
|
133
|
+
return { template, source: 'idea' };
|
|
134
|
+
}
|
|
88
135
|
export const initCommand = defineCommand({
|
|
89
136
|
meta: { name: 'init', description: 'Scaffold a new Bitmagic game project.' },
|
|
90
137
|
args: {
|
|
91
138
|
dir: { type: 'positional', required: false, description: 'Directory to create the project in.' },
|
|
92
|
-
template: {
|
|
139
|
+
template: {
|
|
140
|
+
type: 'string',
|
|
141
|
+
description: `Template id (see templates in the engine bundle). Defaults to ${DEFAULT_TEMPLATE_ID}, or to whatever --idea suggests.`,
|
|
142
|
+
},
|
|
93
143
|
name: { type: 'string', description: 'Game name.' },
|
|
94
144
|
idea: {
|
|
95
145
|
type: 'string',
|
|
96
|
-
description: 'One-line pitch
|
|
146
|
+
description: 'One-line pitch. Seeds GAME-DESIGN.md and picks the template whose camera and controls fit it. Optional — you can write it yourself.',
|
|
97
147
|
},
|
|
98
148
|
env: { type: 'string', description: 'Environment (dev, prod, local).' },
|
|
99
149
|
force: { type: 'boolean', description: 'Scaffold into a non-empty directory.' },
|
|
@@ -124,7 +174,7 @@ export const initCommand = defineCommand({
|
|
|
124
174
|
const extracted = path.join(workDir, 'extracted');
|
|
125
175
|
const templatesDir = path.join(workDir, 'templates');
|
|
126
176
|
await extractEngine(tarballPath, extracted, templatesDir);
|
|
127
|
-
const template =
|
|
177
|
+
const { template, source: templateSource } = await chooseTemplate(templatesDir, args, environment, token, output);
|
|
128
178
|
// Minted only after the engine is in hand: a failed download must not leave an orphaned,
|
|
129
179
|
// unreachable game row behind.
|
|
130
180
|
const projectName = args.name ?? path.basename(targetDir);
|
|
@@ -150,6 +200,9 @@ export const initCommand = defineCommand({
|
|
|
150
200
|
gameId: created.gameId,
|
|
151
201
|
root: targetDir,
|
|
152
202
|
template: template.id,
|
|
203
|
+
// 'explicit' (--template), 'idea' (matched from --idea) or 'default'. An agent driving
|
|
204
|
+
// --json needs to know whether the template was chosen or merely fallen back to.
|
|
205
|
+
templateSource,
|
|
153
206
|
genre: template.genre,
|
|
154
207
|
engineVersion: manifest.version,
|
|
155
208
|
// An agent needs to know whether to run the install itself before anything else works.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAe,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,M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AAK,SAAS;aACzC,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ForgeTransport } from '@bitmagic/world-forger/pipeline/transport-types.js';
|
|
2
|
+
import { type Platform } from '../browser-gl.js';
|
|
2
3
|
import { type ForgePageTransportOptions } from './transport.js';
|
|
3
4
|
export interface ForgeBrowserHostOptions {
|
|
4
5
|
/** Port of the project's own vite dev server. */
|
|
@@ -22,11 +23,12 @@ export interface ForgeBrowserHostOptions {
|
|
|
22
23
|
*/
|
|
23
24
|
export declare function forgePageUrl(gamePort: number, gameId: string): string;
|
|
24
25
|
/**
|
|
25
|
-
* Chromium flags for a forge run. Split out so the
|
|
26
|
-
* browser: web security is always off (presigned PUTs from localhost)
|
|
27
|
-
*
|
|
26
|
+
* Chromium flags for a forge run. Split out so the rule that matters is testable without a
|
|
27
|
+
* browser: web security is always off (presigned PUTs from localhost). The GL backend is
|
|
28
|
+
* `browser-gl.ts`'s call, shared with `verify` — a bake drives the engine's renderer for twenty
|
|
29
|
+
* minutes, so software rasterisation is the difference between a coffee break and an afternoon.
|
|
28
30
|
*/
|
|
29
|
-
export declare function forgeLaunchArgs(env: Record<string, string | undefined
|
|
31
|
+
export declare function forgeLaunchArgs(env: Record<string, string | undefined>, platform?: Platform): string[];
|
|
30
32
|
/**
|
|
31
33
|
* The game data `LOAD_GAME` carries. There is no `/api/get-game-config` in this lane — the CLI
|
|
32
34
|
* project owns its game on disk.
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
* origin; the CORS preflight refuses them otherwise. Chromium only accepts that flag on a
|
|
21
21
|
* persistent context, which is why this is `launchPersistentContext` and why
|
|
22
22
|
* `src/verify/browser.ts` (which uses `newContext`) cannot be reused.
|
|
23
|
-
* 4. A
|
|
24
|
-
* bails — hence the
|
|
23
|
+
* 4. A working GL context. Without one, Three.js renders nothing and the engine's scene
|
|
24
|
+
* validation bails — hence the GL flags from `browser-gl.ts`, which ask for the machine's real
|
|
25
|
+
* GPU and keep software rendering available where there is none.
|
|
25
26
|
*
|
|
26
27
|
* The page is top-level, so `window.parent === window` and the engine's `safePostMessageToCreator`
|
|
27
28
|
* posts to the page's own listener. That is the load-bearing reason this works with no creator
|
|
@@ -31,6 +32,7 @@ import * as fs from 'fs';
|
|
|
31
32
|
import * as os from 'os';
|
|
32
33
|
import * as path from 'path';
|
|
33
34
|
import { chromium } from 'playwright-core';
|
|
35
|
+
import { browserGlArgs } from '../browser-gl.js';
|
|
34
36
|
import { CliError } from '../errors.js';
|
|
35
37
|
import { aliasSourceDir } from '../scaffold/aliases.js';
|
|
36
38
|
import { createForgePageTransport, } from './transport.js';
|
|
@@ -52,16 +54,13 @@ export function forgePageUrl(gamePort, gameId) {
|
|
|
52
54
|
return `http://localhost:${gamePort}/?source=creator&gameId=${encodeURIComponent(gameId)}`;
|
|
53
55
|
}
|
|
54
56
|
/**
|
|
55
|
-
* Chromium flags for a forge run. Split out so the
|
|
56
|
-
* browser: web security is always off (presigned PUTs from localhost)
|
|
57
|
-
*
|
|
57
|
+
* Chromium flags for a forge run. Split out so the rule that matters is testable without a
|
|
58
|
+
* browser: web security is always off (presigned PUTs from localhost). The GL backend is
|
|
59
|
+
* `browser-gl.ts`'s call, shared with `verify` — a bake drives the engine's renderer for twenty
|
|
60
|
+
* minutes, so software rasterisation is the difference between a coffee break and an afternoon.
|
|
58
61
|
*/
|
|
59
|
-
export function forgeLaunchArgs(env) {
|
|
60
|
-
|
|
61
|
-
if (env.CI === 'true' || env.BITMAGIC_BROWSER_SOFTWARE_GL === 'true') {
|
|
62
|
-
args.push('--enable-unsafe-swiftshader', '--use-gl=angle', '--use-angle=swiftshader');
|
|
63
|
-
}
|
|
64
|
-
return args;
|
|
62
|
+
export function forgeLaunchArgs(env, platform) {
|
|
63
|
+
return ['--disable-web-security', ...browserGlArgs(env, platform)];
|
|
65
64
|
}
|
|
66
65
|
/** Read one of the project's `work/` JSON files, naming it in every failure. */
|
|
67
66
|
function readWorkJson(root, name, why) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-host.js","sourceRoot":"","sources":["../../src/forge/browser-host.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-host.js","sourceRoot":"","sources":["../../src/forge/browser-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAkC,MAAM,iBAAiB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EACL,wBAAwB,GAIzB,MAAM,gBAAgB,CAAC;AAExB,kFAAkF;AAClF,MAAM,cAAc,GAAG,yBAAyB,CAAC;AAEjD,2FAA2F;AAC3F,MAAM,8BAA8B,GAAG,OAAO,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,iCAAiC,GAAG,MAAM,CAAC;AAoBjD;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,MAAc;IAC3D,OAAO,oBAAoB,QAAQ,2BAA2B,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;AAC7F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAuC,EACvC,QAAmB;IAEnB,OAAO,CAAC,wBAAwB,EAAE,GAAG,aAAa,CAAC,GAAG,EAAE,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,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9D,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC1B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -2,8 +2,34 @@ import { type ProjectMetadata } from './project-files.js';
|
|
|
2
2
|
export interface TemplateEntry {
|
|
3
3
|
id: string;
|
|
4
4
|
genre: string;
|
|
5
|
+
/** Both optional: only the suggester reads them, and an older bundle's index may omit either. */
|
|
6
|
+
name?: string;
|
|
7
|
+
description?: string;
|
|
5
8
|
recommended?: boolean;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* The CLI's default, deliberately NOT the index's `recommended` entry.
|
|
12
|
+
*
|
|
13
|
+
* `recommended` is standard-3d, a scene pre-populated with demo objects — the right first impression
|
|
14
|
+
* in the web Creator, where someone wants something to look at immediately. In the CLI lane a coding
|
|
15
|
+
* agent builds the scene from GAME-DESIGN.md, so those objects are furniture it has to delete first.
|
|
16
|
+
* Same third-person controller, empty world.
|
|
17
|
+
*
|
|
18
|
+
* `recommended` stays where it is: flipping it in templates/index.json would also move the Creator UI
|
|
19
|
+
* and the lab's `loadRecommendedTemplateId`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DEFAULT_TEMPLATE_ID = "empty-3d";
|
|
22
|
+
/**
|
|
23
|
+
* Templates `--idea` may not be matched to, though `--template` still scaffolds them.
|
|
24
|
+
*
|
|
25
|
+
* standard-3d IS the default template plus demo objects — same genre, same third-person controller.
|
|
26
|
+
* Offering both to the suggester asks it to choose on a difference that does not matter here (the
|
|
27
|
+
* creator's agent builds the scene either way) and, observed live, it picks standard-3d for ordinary
|
|
28
|
+
* third-person ideas on the strength of its name and "the default Bitmagic scene template"
|
|
29
|
+
* description. Withholding it makes the choice purely about camera and controls, which is the only
|
|
30
|
+
* thing the templates really differ on.
|
|
31
|
+
*/
|
|
32
|
+
export declare const SUGGESTION_EXCLUDED_TEMPLATE_IDS: string[];
|
|
7
33
|
/**
|
|
8
34
|
* Directories moved out of the extracted tree into the project's vendored engine/.
|
|
9
35
|
*
|
|
@@ -61,6 +87,13 @@ export declare const OPTIONAL_VENDORED_DIRS: string[];
|
|
|
61
87
|
* `upgrade` didn't exist yet.
|
|
62
88
|
*/
|
|
63
89
|
export declare const PLATFORM_GENERATED_FILES: Array<[string, () => string]>;
|
|
90
|
+
/**
|
|
91
|
+
* Every template the downloaded bundle carries, in index order.
|
|
92
|
+
*
|
|
93
|
+
* Separate from `resolveTemplate` so `init` can hand the list to the template suggester without
|
|
94
|
+
* parsing the file a second time — and so the two "this bundle is unusable" errors stay in one place.
|
|
95
|
+
*/
|
|
96
|
+
export declare function readTemplateIndex(templatesDir: string): TemplateEntry[];
|
|
64
97
|
export declare function resolveTemplate(templatesDir: string, requestedId?: string): TemplateEntry;
|
|
65
98
|
export interface ScaffoldOptions {
|
|
66
99
|
targetDir: string;
|
package/dist/scaffold/project.js
CHANGED
|
@@ -5,6 +5,29 @@ import { aliasSourceDir } from './aliases.js';
|
|
|
5
5
|
import { renderPackageJson, renderTsconfig, renderIndexHtml, renderViteConfig, renderVitePublishConfig, renderGitignore, renderBitmagicJson, renderAgentsMd, renderGameDesignMd, renderClaudeMd, renderSkillsReadme, renderGenerateSkill, renderPlanningSkill, renderEngineApiSkill, } from './project-files.js';
|
|
6
6
|
import { hashAgentsMd } from './agents-md.js';
|
|
7
7
|
import { CLAUDE_SETTINGS_FILE, renderClaudeSettings } from './claude-settings.js';
|
|
8
|
+
/**
|
|
9
|
+
* The CLI's default, deliberately NOT the index's `recommended` entry.
|
|
10
|
+
*
|
|
11
|
+
* `recommended` is standard-3d, a scene pre-populated with demo objects — the right first impression
|
|
12
|
+
* in the web Creator, where someone wants something to look at immediately. In the CLI lane a coding
|
|
13
|
+
* agent builds the scene from GAME-DESIGN.md, so those objects are furniture it has to delete first.
|
|
14
|
+
* Same third-person controller, empty world.
|
|
15
|
+
*
|
|
16
|
+
* `recommended` stays where it is: flipping it in templates/index.json would also move the Creator UI
|
|
17
|
+
* and the lab's `loadRecommendedTemplateId`.
|
|
18
|
+
*/
|
|
19
|
+
export const DEFAULT_TEMPLATE_ID = 'empty-3d';
|
|
20
|
+
/**
|
|
21
|
+
* Templates `--idea` may not be matched to, though `--template` still scaffolds them.
|
|
22
|
+
*
|
|
23
|
+
* standard-3d IS the default template plus demo objects — same genre, same third-person controller.
|
|
24
|
+
* Offering both to the suggester asks it to choose on a difference that does not matter here (the
|
|
25
|
+
* creator's agent builds the scene either way) and, observed live, it picks standard-3d for ordinary
|
|
26
|
+
* third-person ideas on the strength of its name and "the default Bitmagic scene template"
|
|
27
|
+
* description. Withholding it makes the choice purely about camera and controls, which is the only
|
|
28
|
+
* thing the templates really differ on.
|
|
29
|
+
*/
|
|
30
|
+
export const SUGGESTION_EXCLUDED_TEMPLATE_IDS = ['standard-3d'];
|
|
8
31
|
/**
|
|
9
32
|
* Directories moved out of the extracted tree into the project's vendored engine/.
|
|
10
33
|
*
|
|
@@ -80,7 +103,13 @@ export const PLATFORM_GENERATED_FILES = [
|
|
|
80
103
|
['.claude/skills/planning-a-game/SKILL.md', renderPlanningSkill],
|
|
81
104
|
['.claude/skills/finding-engine-apis/SKILL.md', renderEngineApiSkill],
|
|
82
105
|
];
|
|
83
|
-
|
|
106
|
+
/**
|
|
107
|
+
* Every template the downloaded bundle carries, in index order.
|
|
108
|
+
*
|
|
109
|
+
* Separate from `resolveTemplate` so `init` can hand the list to the template suggester without
|
|
110
|
+
* parsing the file a second time — and so the two "this bundle is unusable" errors stay in one place.
|
|
111
|
+
*/
|
|
112
|
+
export function readTemplateIndex(templatesDir) {
|
|
84
113
|
const indexPath = path.join(templatesDir, 'index.json');
|
|
85
114
|
let raw;
|
|
86
115
|
try {
|
|
@@ -91,14 +120,20 @@ export function resolveTemplate(templatesDir, requestedId) {
|
|
|
91
120
|
}
|
|
92
121
|
const parsed = JSON.parse(raw);
|
|
93
122
|
const templates = parsed?.templates ?? [];
|
|
94
|
-
|
|
95
|
-
// doubles as the fallback for the no-id case below.
|
|
96
|
-
const [first] = templates;
|
|
97
|
-
if (!first) {
|
|
123
|
+
if (templates.length === 0) {
|
|
98
124
|
throw new CliError('The engine bundle lists no templates.');
|
|
99
125
|
}
|
|
126
|
+
return templates;
|
|
127
|
+
}
|
|
128
|
+
export function resolveTemplate(templatesDir, requestedId) {
|
|
129
|
+
const templates = readTemplateIndex(templatesDir);
|
|
100
130
|
if (requestedId === undefined) {
|
|
101
|
-
|
|
131
|
+
// Two fallbacks deep on purpose: an engine bundle predating empty-3d still resolves through
|
|
132
|
+
// `recommended`, and an index where nothing is marked recommended still resolves through the
|
|
133
|
+
// first entry. Neither is a reason to refuse to scaffold.
|
|
134
|
+
return (templates.find((t) => t.id === DEFAULT_TEMPLATE_ID) ??
|
|
135
|
+
templates.find((t) => t.recommended) ??
|
|
136
|
+
templates[0]);
|
|
102
137
|
}
|
|
103
138
|
const match = templates.find((t) => t.id === requestedId);
|
|
104
139
|
if (!match) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/scaffold/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EAC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;QAC1F,6EAA6E;QAC7E,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,WAAW,EAAE,cAAc,EAAE,CAAC;QAC/B,CAAC,YAAY,EAAE,eAAe,EAAE,CAAC;QACjC,8FAA8F;QAC9F,+FAA+F;QAC/F,mCAAmC;QACnC,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,CAAC;KAC/C,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC;QACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5C,wFAAwF;QACxF,+EAA+E;QAC/E,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Environment } from '../config/environments.js';
|
|
2
|
+
import { type ApiDeps } from '../http/client.js';
|
|
3
|
+
import type { TemplateEntry } from './project.js';
|
|
4
|
+
export interface SuggestTemplateOptions {
|
|
5
|
+
environment: Environment;
|
|
6
|
+
token: string;
|
|
7
|
+
/** The creator's `--idea` pitch. */
|
|
8
|
+
idea: string;
|
|
9
|
+
/** Every template this engine bundle carries — the model may only choose from these. */
|
|
10
|
+
templates: TemplateEntry[];
|
|
11
|
+
defaultTemplateId: string;
|
|
12
|
+
deps: ApiDeps;
|
|
13
|
+
}
|
|
14
|
+
export interface TemplateSuggestion {
|
|
15
|
+
templateId: string;
|
|
16
|
+
/** One short clause for the creator; may be empty if the model omitted it. */
|
|
17
|
+
reason: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Ask api-server which template fits the creator's idea, or null if it cannot say.
|
|
21
|
+
*
|
|
22
|
+
* **This function never throws.** Template selection is a convenience on top of a default that is
|
|
23
|
+
* already a working answer, so nothing here — being offline, an expired feature flag, a model that
|
|
24
|
+
* invents an id — is allowed to fail `bitmagic init`. Every failure path returns null and the
|
|
25
|
+
* caller scaffolds the default template.
|
|
26
|
+
*
|
|
27
|
+
* The template list travels in the request because api-server has no copy of the bundle the CLI
|
|
28
|
+
* just downloaded, and because validating the reply against the ids we SENT is what makes a
|
|
29
|
+
* hallucinated id harmless rather than a scaffold from a directory that does not exist.
|
|
30
|
+
*/
|
|
31
|
+
export declare function suggestTemplate(options: SuggestTemplateOptions): Promise<TemplateSuggestion | null>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { apiPost } from '../http/client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Ask api-server which template fits the creator's idea, or null if it cannot say.
|
|
4
|
+
*
|
|
5
|
+
* **This function never throws.** Template selection is a convenience on top of a default that is
|
|
6
|
+
* already a working answer, so nothing here — being offline, an expired feature flag, a model that
|
|
7
|
+
* invents an id — is allowed to fail `bitmagic init`. Every failure path returns null and the
|
|
8
|
+
* caller scaffolds the default template.
|
|
9
|
+
*
|
|
10
|
+
* The template list travels in the request because api-server has no copy of the bundle the CLI
|
|
11
|
+
* just downloaded, and because validating the reply against the ids we SENT is what makes a
|
|
12
|
+
* hallucinated id harmless rather than a scaffold from a directory that does not exist.
|
|
13
|
+
*/
|
|
14
|
+
export async function suggestTemplate(options) {
|
|
15
|
+
const { environment, token, idea, templates, defaultTemplateId, deps } = options;
|
|
16
|
+
let response;
|
|
17
|
+
try {
|
|
18
|
+
response = await apiPost(environment, '/api/cli/v1/templates/suggest', token, {
|
|
19
|
+
idea,
|
|
20
|
+
defaultTemplateId,
|
|
21
|
+
templates: templates.map((t) => ({
|
|
22
|
+
id: t.id,
|
|
23
|
+
name: t.name ?? t.id,
|
|
24
|
+
description: t.description ?? '',
|
|
25
|
+
genre: t.genre,
|
|
26
|
+
})),
|
|
27
|
+
}, deps);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const { templateId } = response;
|
|
33
|
+
if (typeof templateId !== 'string' || !templates.some((t) => t.id === templateId)) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
templateId,
|
|
38
|
+
reason: typeof response.reason === 'string' ? response.reason.trim() : '',
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=suggest-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest-template.js","sourceRoot":"","sources":["../../src/scaffold/suggest-template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAgB,MAAM,mBAAmB,CAAC;AAyB1D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAA+B;IAE/B,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEjF,IAAI,QAAyB,CAAC;IAC9B,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,OAAO,CACtB,WAAW,EACX,+BAA+B,EAC/B,KAAK,EACL;YACE,IAAI;YACJ,iBAAiB;YACjB,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC/B,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE;gBACpB,WAAW,EAAE,CAAC,CAAC,WAAW,IAAI,EAAE;gBAChC,KAAK,EAAE,CAAC,CAAC,KAAK;aACf,CAAC,CAAC;SACJ,EACD,IAAI,CACL,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;IAChC,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,EAAE,CAAC;QAClF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,UAAU;QACV,MAAM,EAAE,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;KAC1E,CAAC;AACJ,CAAC"}
|
package/dist/verify/browser.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import { chromium } from 'playwright-core';
|
|
3
|
+
import { browserGlArgs } from '../browser-gl.js';
|
|
3
4
|
import { CliError } from '../errors.js';
|
|
4
5
|
export const DEFAULT_START_INTERACTION = {
|
|
5
6
|
playButtonSelector: '#play-button, .hud-play-button',
|
|
@@ -16,7 +17,13 @@ export async function runHeadlessCheck(options) {
|
|
|
16
17
|
try {
|
|
17
18
|
// `--mute-audio` because headless Chrome still plays sound through the machine's speakers:
|
|
18
19
|
// without it every verify run blares the game's music and effects at whoever is sitting there.
|
|
19
|
-
|
|
20
|
+
// The GL flags are not an optimisation — without them the game renders in software on a
|
|
21
|
+
// machine with a perfectly good GPU, and a run that should take seconds crawls (browser-gl.ts).
|
|
22
|
+
browser = await chromium.launch({
|
|
23
|
+
headless: true,
|
|
24
|
+
channel: 'chrome',
|
|
25
|
+
args: ['--mute-audio', ...browserGlArgs(process.env)],
|
|
26
|
+
});
|
|
20
27
|
}
|
|
21
28
|
catch {
|
|
22
29
|
// Not a game failure. Saying so plainly matters: an agent told "verification failed" would
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/verify/browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE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C3B,CAAC;QAAC,MAAM,CAAC;YACP,wFAAwF;YACxF,8EAA8E;QAChF,CAAC;QACD,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC;QACnE,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;YACjG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAED,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,aAAa,CAAC,IAAU;IACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;QACxB,6FAA6F;QAC7F,sCAAsC;QACtC,oCAAoC;QACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,CAAC,CAAC,IAAI,YAAY,WAAW,CAAC;YAAE,OAAO,KAAK,CAAC;QACjD,oCAAoC;QACpC,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitmagic/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"description": "Build Bitmagic games from your own agent tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"citty": "^0.2.2",
|
|
20
20
|
"playwright-core": "^1.59.1",
|
|
21
21
|
"tar": "^7.4.3",
|
|
22
|
-
"@bitmagic/
|
|
23
|
-
"@bitmagic/
|
|
22
|
+
"@bitmagic/world-forger": "0.1.3",
|
|
23
|
+
"@bitmagic/asset-core": "0.1.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@eslint/js": "^9.38.0",
|