@bitmagic/cli 0.1.52-dev.0 → 0.1.52-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -1
- package/dist/assets/add.d.ts +66 -0
- package/dist/assets/add.js +274 -0
- package/dist/assets/add.js.map +1 -0
- package/dist/assets/entry.d.ts +44 -0
- package/dist/assets/entry.js +71 -0
- package/dist/assets/entry.js.map +1 -0
- package/dist/assets/file-kind.d.ts +53 -0
- package/dist/assets/file-kind.js +180 -0
- package/dist/assets/file-kind.js.map +1 -0
- package/dist/assets/list.d.ts +27 -0
- package/dist/assets/list.js +50 -0
- package/dist/assets/list.js.map +1 -0
- package/dist/assets/remove.d.ts +50 -0
- package/dist/assets/remove.js +91 -0
- package/dist/assets/remove.js.map +1 -0
- package/dist/assets/vxl-summary.d.ts +23 -0
- package/dist/assets/vxl-summary.js +103 -0
- package/dist/assets/vxl-summary.js.map +1 -0
- package/dist/browser-gl.d.ts +46 -8
- package/dist/browser-gl.js +54 -26
- package/dist/browser-gl.js.map +1 -1
- package/dist/cli.d.ts +19 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/assets.d.ts +62 -0
- package/dist/commands/assets.js +359 -0
- package/dist/commands/assets.js.map +1 -0
- package/dist/commands/forge.d.ts +5 -0
- package/dist/commands/forge.js +10 -1
- package/dist/commands/forge.js.map +1 -1
- package/dist/commands/init.js +19 -12
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/judge.d.ts +41 -0
- package/dist/commands/judge.js +217 -0
- package/dist/commands/judge.js.map +1 -0
- package/dist/commands/reset-account.js +2 -8
- package/dist/commands/reset-account.js.map +1 -1
- package/dist/commands/verify.js +3 -3
- package/dist/commands/verify.js.map +1 -1
- package/dist/editor/previews.d.ts +6 -0
- package/dist/editor/previews.js +16 -0
- package/dist/editor/previews.js.map +1 -1
- package/dist/editor/server.js +2 -2
- package/dist/editor/server.js.map +1 -1
- package/dist/forge/apply-modifications.d.ts +9 -1
- package/dist/forge/apply-modifications.js +3 -14
- package/dist/forge/apply-modifications.js.map +1 -1
- package/dist/forge/voxelize-session.d.ts +24 -0
- package/dist/forge/voxelize-session.js +137 -0
- package/dist/forge/voxelize-session.js.map +1 -0
- package/dist/generate/prop.js +9 -63
- package/dist/generate/prop.js.map +1 -1
- package/dist/generate/vehicle.js +5 -85
- package/dist/generate/vehicle.js.map +1 -1
- package/dist/http/signed-upload.d.ts +55 -0
- package/dist/http/signed-upload.js +168 -0
- package/dist/http/signed-upload.js.map +1 -0
- package/dist/judge/facts.d.ts +18 -0
- package/dist/judge/facts.js +180 -0
- package/dist/judge/facts.js.map +1 -0
- package/dist/judge/record.d.ts +16 -0
- package/dist/judge/record.js +55 -0
- package/dist/judge/record.js.map +1 -0
- package/dist/judge/stream.d.ts +36 -0
- package/dist/judge/stream.js +122 -0
- package/dist/judge/stream.js.map +1 -0
- package/dist/project/jobs.d.ts +1 -1
- package/dist/project/jobs.js.map +1 -1
- package/dist/publish/client.js +13 -34
- package/dist/publish/client.js.map +1 -1
- package/dist/scaffold/project-files.d.ts +8 -0
- package/dist/scaffold/project-files.js +104 -21
- 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 +11 -6
- package/dist/verify/browser.js +31 -15
- package/dist/verify/browser.js.map +1 -1
- package/dist/verify/iterate.js +3 -3
- package/dist/verify/iterate.js.map +1 -1
- package/package.json +4 -4
package/dist/browser-gl.js
CHANGED
|
@@ -37,18 +37,25 @@
|
|
|
37
37
|
/** Chrome falls back to SwiftShader on its own; these force it, for machines with no GPU at all. */
|
|
38
38
|
const SOFTWARE_GL_ARGS = ['--enable-unsafe-swiftshader', '--use-gl=angle', '--use-angle=swiftshader'];
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Whether software GL is in force rather than the machine's real GPU.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
42
|
+
* True on CI (GitHub-hosted runners have no GPU, and asking ANGLE for a Vulkan device there just
|
|
43
|
+
* wastes the startup), and under `BITMAGIC_BROWSER_SOFTWARE_GL=true` — the escape hatch for a
|
|
44
|
+
* machine whose driver makes the GPU path worse than the software one.
|
|
45
|
+
*/
|
|
46
|
+
function usesSoftwareGl(env) {
|
|
47
|
+
return env.CI === 'true' || env.BITMAGIC_BROWSER_SOFTWARE_GL === 'true';
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Chrome flags for the GL backend, given the environment and platform.
|
|
45
51
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* for Vulkan would take that
|
|
52
|
+
* Software GL is forced wherever `usesSoftwareGl` holds. Everywhere else the real GPU is
|
|
53
|
+
* requested. The Vulkan flags are Linux-only because they are only a fix there: macOS headless
|
|
54
|
+
* already reaches the GPU through ANGLE's Metal backend, and asking it for Vulkan would take that
|
|
55
|
+
* away.
|
|
49
56
|
*/
|
|
50
57
|
export function browserGlArgs(env, platform = process.platform) {
|
|
51
|
-
if (env
|
|
58
|
+
if (usesSoftwareGl(env))
|
|
52
59
|
return [...SOFTWARE_GL_ARGS];
|
|
53
60
|
if (platform !== 'linux')
|
|
54
61
|
return ['--enable-unsafe-swiftshader'];
|
|
@@ -88,31 +95,52 @@ export function browserRendererArgs(env, renderer, platform = process.platform)
|
|
|
88
95
|
*/
|
|
89
96
|
function mergeEnableFeatures(args, features) {
|
|
90
97
|
const PREFIX = '--enable-features=';
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
const present = args
|
|
99
|
+
.filter((arg) => arg.startsWith(PREFIX))
|
|
100
|
+
.flatMap((arg) => arg.slice(PREFIX.length).split(','));
|
|
101
|
+
const merged = new Set([...present, ...features].filter((value) => value !== ''));
|
|
102
|
+
return [...args.filter((arg) => !arg.startsWith(PREFIX)), `${PREFIX}${[...merged].join(',')}`];
|
|
103
|
+
}
|
|
104
|
+
/** An off-screen position keeps the headed window out of sight without occluding-throttle risk. */
|
|
105
|
+
const HEADED_OFFSCREEN_ARGS = [
|
|
106
|
+
'--window-position=-2400,-2400',
|
|
107
|
+
'--disable-backgrounding-occluded-windows',
|
|
108
|
+
];
|
|
109
|
+
function hasDisplay(env) {
|
|
110
|
+
return Boolean(env.DISPLAY || env.WAYLAND_DISPLAY);
|
|
111
|
+
}
|
|
112
|
+
export function browserLaunchPlan(env, renderer, platform = process.platform) {
|
|
113
|
+
const args = browserRendererArgs(env, renderer, platform);
|
|
114
|
+
const headedWebgpu = renderer === 'webgpu'
|
|
115
|
+
&& platform === 'linux'
|
|
116
|
+
&& !usesSoftwareGl(env)
|
|
117
|
+
&& hasDisplay(env);
|
|
118
|
+
if (!headedWebgpu)
|
|
119
|
+
return { headless: true, args };
|
|
120
|
+
return {
|
|
121
|
+
headless: false,
|
|
122
|
+
args: [...args.filter((arg) => arg !== '--disable-gpu-compositing'), ...HEADED_OFFSCREEN_ARGS],
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The plan for the automatic software-GL re-run: `browserLaunchPlan` as if
|
|
127
|
+
* `BITMAGIC_BROWSER_SOFTWARE_GL=true` had been set.
|
|
128
|
+
*
|
|
129
|
+
* Both verify paths (one-shot and `--watch`) relaunch through this after `shouldRetrySoftwareGl`
|
|
130
|
+
* says the machine's GPU stack is the likely culprit, so neither has to know which env var forces
|
|
131
|
+
* the fallback.
|
|
132
|
+
*/
|
|
133
|
+
export function softwareGlLaunchPlan(env, renderer, platform = process.platform) {
|
|
134
|
+
return browserLaunchPlan({ ...env, BITMAGIC_BROWSER_SOFTWARE_GL: 'true' }, renderer, platform);
|
|
105
135
|
}
|
|
106
136
|
/**
|
|
107
137
|
* Whether a failed run is worth one automatic re-run on software GL.
|
|
108
138
|
*
|
|
109
139
|
* A lost WebGL context is a property of the machine's GPU/driver/compositor stack, not of the
|
|
110
140
|
* game (see the file header) — the software path sidesteps that stack entirely. Pointless when
|
|
111
|
-
* software GL was already in effect, which is what
|
|
141
|
+
* software GL was already in effect, which is what `usesSoftwareGl` establishes.
|
|
112
142
|
*/
|
|
113
143
|
export function shouldRetrySoftwareGl(observations, env) {
|
|
114
|
-
return
|
|
115
|
-
&& env.CI !== 'true'
|
|
116
|
-
&& env.BITMAGIC_BROWSER_SOFTWARE_GL !== 'true');
|
|
144
|
+
return observations.webglContextLost && !usesSoftwareGl(env);
|
|
117
145
|
}
|
|
118
146
|
//# sourceMappingURL=browser-gl.js.map
|
package/dist/browser-gl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-gl.js","sourceRoot":"","sources":["../src/browser-gl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAUH,oGAAoG;AACpG,MAAM,gBAAgB,GAAG,CAAC,6BAA6B,EAAE,gBAAgB,EAAE,yBAAyB,CAAC,CAAC;AAEtG
|
|
1
|
+
{"version":3,"file":"browser-gl.js","sourceRoot":"","sources":["../src/browser-gl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAUH,oGAAoG;AACpG,MAAM,gBAAgB,GAAG,CAAC,6BAA6B,EAAE,gBAAgB,EAAE,yBAAyB,CAAC,CAAC;AAEtG;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,GAAuC;IAC7D,OAAO,GAAG,CAAC,EAAE,KAAK,MAAM,IAAI,GAAG,CAAC,4BAA4B,KAAK,MAAM,CAAC;AAC1E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAC3B,GAAuC,EACvC,WAAqB,OAAO,CAAC,QAAQ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jG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,YAA2C,EAC3C,GAAuC;IAEvC,OAAO,YAAY,CAAC,gBAAgB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AAC/D,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -229,6 +229,7 @@ declare const rawCommands: {
|
|
|
229
229
|
};
|
|
230
230
|
}>;
|
|
231
231
|
generate: CommandDef<ArgsDef>;
|
|
232
|
+
assets: CommandDef<ArgsDef>;
|
|
232
233
|
cover: CommandDef<{
|
|
233
234
|
readonly prompt: {
|
|
234
235
|
readonly type: "string";
|
|
@@ -251,6 +252,20 @@ declare const rawCommands: {
|
|
|
251
252
|
readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
|
|
252
253
|
};
|
|
253
254
|
}>;
|
|
255
|
+
judge: CommandDef<{
|
|
256
|
+
readonly genre: {
|
|
257
|
+
readonly type: "string";
|
|
258
|
+
readonly description: "Genre hint for the rubric: platformer, racing, shooter, combat, driving, tower-defense.";
|
|
259
|
+
};
|
|
260
|
+
readonly 'min-score': {
|
|
261
|
+
readonly type: "string";
|
|
262
|
+
readonly description: "Fail (exit 4) when the overall score is below this 1-10 bar. Without it the judge informs and exits 0.";
|
|
263
|
+
};
|
|
264
|
+
readonly json: {
|
|
265
|
+
readonly type: "boolean";
|
|
266
|
+
readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
|
|
267
|
+
};
|
|
268
|
+
}>;
|
|
254
269
|
forge: CommandDef<{
|
|
255
270
|
readonly prompt: {
|
|
256
271
|
readonly type: "string";
|
|
@@ -280,6 +295,10 @@ declare const rawCommands: {
|
|
|
280
295
|
readonly type: "boolean";
|
|
281
296
|
readonly description: "Build a custom place (arena, fortress, camp).";
|
|
282
297
|
};
|
|
298
|
+
readonly 'make-start': {
|
|
299
|
+
readonly type: "boolean";
|
|
300
|
+
readonly description: "Boot the game into this level. Without it, only a game's FIRST forge becomes the start level, so a later forge lands in the level list unseen.";
|
|
301
|
+
};
|
|
283
302
|
readonly json: {
|
|
284
303
|
readonly type: "boolean";
|
|
285
304
|
readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
|
package/dist/cli.js
CHANGED
|
@@ -18,7 +18,9 @@ import { reloadCommand } from './commands/reload.js';
|
|
|
18
18
|
import { verifyCommand } from './commands/verify.js';
|
|
19
19
|
import { buildCommand } from './commands/build.js';
|
|
20
20
|
import { generateCommand } from './commands/generate.js';
|
|
21
|
+
import { assetsCommand } from './commands/assets.js';
|
|
21
22
|
import { coverCommand } from './commands/cover.js';
|
|
23
|
+
import { judgeCommand } from './commands/judge.js';
|
|
22
24
|
import { forgeCommand } from './commands/forge.js';
|
|
23
25
|
import { publishCommand } from './commands/publish.js';
|
|
24
26
|
// citty's runMain() catches every error thrown from a command's `run()` internally and calls
|
|
@@ -184,7 +186,9 @@ const rawCommands = {
|
|
|
184
186
|
verify: verifyCommand,
|
|
185
187
|
build: buildCommand,
|
|
186
188
|
generate: generateCommand,
|
|
189
|
+
assets: assetsCommand,
|
|
187
190
|
cover: coverCommand,
|
|
191
|
+
judge: judgeCommand,
|
|
188
192
|
forge: forgeCommand,
|
|
189
193
|
publish: publishCommand,
|
|
190
194
|
};
|
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,EAA0B,MAAM,gCAAgC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAsB,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE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,YAAY;IACnB,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;IACnB,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,EAAE,IAAI,CAAC,CAAC,CAC5D,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"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type AddAssetResult, type VoxelizeGlb } from '../assets/add.js';
|
|
2
|
+
import { type AssetRow } from '../assets/list.js';
|
|
3
|
+
/** The Creator's voxelize-dialog defaults (assetsVoxelizeDialog.ts), so a plain `add` bakes the same way. */
|
|
4
|
+
export declare const DEFAULT_MIN_VOXEL_SIZE = 0.1;
|
|
5
|
+
export declare const DEFAULT_MAX_VOXEL_SIZE = 0.5;
|
|
6
|
+
export interface AssetsRunDeps {
|
|
7
|
+
fetch: typeof globalThis.fetch;
|
|
8
|
+
sleep: (ms: number) => Promise<void>;
|
|
9
|
+
now?: () => number;
|
|
10
|
+
/** Test-only override; production omits it and loadProjectContext walks up from process.cwd(). */
|
|
11
|
+
startDir?: string;
|
|
12
|
+
/** Test-only override; production omits it and getAccessToken/readDefaultEnvironment read ~/.bitmagic. */
|
|
13
|
+
baseDir?: string;
|
|
14
|
+
/** Test-only override for the headless bake, so the GLB path runs without Chrome. */
|
|
15
|
+
voxelize?: VoxelizeGlb;
|
|
16
|
+
log: (message: string) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Whether to fill the model's interior with voxels.
|
|
20
|
+
*
|
|
21
|
+
* `--hollow` and `--solid` are explicit; otherwise this mirrors `generate prop`'s size rule
|
|
22
|
+
* (`shouldFillInterior`), which the web lane has always applied: prop-scale objects fill solid so
|
|
23
|
+
* nothing reads as a shell when the camera clips inside, while building-scale ones stay hollow
|
|
24
|
+
* because a solid-filled building is millions of wasted voxels. `assets add` has no `fitBox`, so
|
|
25
|
+
* the only size it knows is `--height` — enough to catch the case that actually hurts.
|
|
26
|
+
*/
|
|
27
|
+
export declare const SOLID_FILL_MAX_HEIGHT_M = 6;
|
|
28
|
+
export interface AddOptions {
|
|
29
|
+
file: string;
|
|
30
|
+
name?: string;
|
|
31
|
+
assetId?: string;
|
|
32
|
+
keepGlb: boolean;
|
|
33
|
+
force: boolean;
|
|
34
|
+
voxelSize?: string;
|
|
35
|
+
maxVoxelSize?: string;
|
|
36
|
+
height?: string;
|
|
37
|
+
hollow: boolean;
|
|
38
|
+
solid: boolean;
|
|
39
|
+
json: boolean;
|
|
40
|
+
deps?: AssetsRunDeps;
|
|
41
|
+
}
|
|
42
|
+
export declare function runAssetsAdd(options: AddOptions): Promise<AddAssetResult>;
|
|
43
|
+
export declare function runAssetsList(options: {
|
|
44
|
+
json: boolean;
|
|
45
|
+
deps?: AssetsRunDeps;
|
|
46
|
+
}): Promise<AssetRow[]>;
|
|
47
|
+
export interface RemoveOptions {
|
|
48
|
+
assetId: string;
|
|
49
|
+
force: boolean;
|
|
50
|
+
json: boolean;
|
|
51
|
+
deps?: AssetsRunDeps;
|
|
52
|
+
}
|
|
53
|
+
export interface RemoveResult {
|
|
54
|
+
assetId: string;
|
|
55
|
+
name: string;
|
|
56
|
+
/** Placed instances removed alongside the asset (only ever non-zero under --force). */
|
|
57
|
+
instancesRemoved: number;
|
|
58
|
+
/** References that remain, by path — under --force only. */
|
|
59
|
+
remainingReferences: string[];
|
|
60
|
+
}
|
|
61
|
+
export declare function runAssetsRemove(options: RemoveOptions): Promise<RemoveResult>;
|
|
62
|
+
export declare const assetsCommand: import("citty").CommandDef<import("citty").ArgsDef>;
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `bitmagic assets add | list | remove` — the game's asset registry, from the command line.
|
|
3
|
+
*
|
|
4
|
+
* `add` is the pro lane's answer to the Creator's Assets-tab upload: a creator's own `.glb`, `.vxl`,
|
|
5
|
+
* image, audio or JSON file goes into storage and into `src/work/world.json`. `list` and `remove`
|
|
6
|
+
* are local — they read and edit that file and talk to nobody.
|
|
7
|
+
*
|
|
8
|
+
* Same conventions as `bitmagic generate`: kebab-case flags, `--json` for the result document,
|
|
9
|
+
* prose through `log`, every pre-write failure ending "world.json is unchanged.", and the exit
|
|
10
|
+
* code / failure category of a CliError carried across untouched.
|
|
11
|
+
*/
|
|
12
|
+
import { defineCommand } from 'citty';
|
|
13
|
+
import * as path from 'path';
|
|
14
|
+
import { CliError } from '../errors.js';
|
|
15
|
+
import { createOutput } from '../output.js';
|
|
16
|
+
import { loadProjectContext } from '../project/context.js';
|
|
17
|
+
import { withJobRecord } from '../project/jobs.js';
|
|
18
|
+
import { readWorldJson } from '../project/world-json.js';
|
|
19
|
+
import { resolveEnvironmentForCommand, resolveAuth0ClientId } from '../config/environments.js';
|
|
20
|
+
import { getAccessToken } from '../auth/session.js';
|
|
21
|
+
import { addAssetFile } from '../assets/add.js';
|
|
22
|
+
import { ACCEPTED_EXTENSIONS, classifyAssetFile, uploadFilename, validateAssetName } from '../assets/file-kind.js';
|
|
23
|
+
import { formatAssetTable, summarizeAssets } from '../assets/list.js';
|
|
24
|
+
import { planAssetRemoval } from '../assets/remove.js';
|
|
25
|
+
import { applyModificationsToWorld } from '../forge/apply-modifications.js';
|
|
26
|
+
import { projectWorldJsonPath } from '../forge/run-pipeline.js';
|
|
27
|
+
import { removePreview } from '../editor/previews.js';
|
|
28
|
+
/** The Creator's voxelize-dialog defaults (assetsVoxelizeDialog.ts), so a plain `add` bakes the same way. */
|
|
29
|
+
export const DEFAULT_MIN_VOXEL_SIZE = 0.1;
|
|
30
|
+
export const DEFAULT_MAX_VOXEL_SIZE = 0.5;
|
|
31
|
+
function defaultDeps(json) {
|
|
32
|
+
const output = createOutput(json);
|
|
33
|
+
return {
|
|
34
|
+
fetch: globalThis.fetch,
|
|
35
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
36
|
+
log: output.info,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Whether to fill the model's interior with voxels.
|
|
41
|
+
*
|
|
42
|
+
* `--hollow` and `--solid` are explicit; otherwise this mirrors `generate prop`'s size rule
|
|
43
|
+
* (`shouldFillInterior`), which the web lane has always applied: prop-scale objects fill solid so
|
|
44
|
+
* nothing reads as a shell when the camera clips inside, while building-scale ones stay hollow
|
|
45
|
+
* because a solid-filled building is millions of wasted voxels. `assets add` has no `fitBox`, so
|
|
46
|
+
* the only size it knows is `--height` — enough to catch the case that actually hurts.
|
|
47
|
+
*/
|
|
48
|
+
export const SOLID_FILL_MAX_HEIGHT_M = 6;
|
|
49
|
+
function resolveFillInterior(options, targetHeight) {
|
|
50
|
+
if (options.solid)
|
|
51
|
+
return true;
|
|
52
|
+
if (options.hollow)
|
|
53
|
+
return false;
|
|
54
|
+
return targetHeight === undefined || targetHeight <= SOLID_FILL_MAX_HEIGHT_M;
|
|
55
|
+
}
|
|
56
|
+
/** Same contract as generate.ts's: only the message changes, exit code and category survive. */
|
|
57
|
+
function decoratedError(error, decorate) {
|
|
58
|
+
return error instanceof CliError
|
|
59
|
+
? new CliError(decorate(error.message), error.exitCode, error.code)
|
|
60
|
+
: error;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the project and read its world.json, with every failure carrying the lane's guarantee.
|
|
64
|
+
*
|
|
65
|
+
* Shared by all three subcommands: `list` and `remove` used to skip the decoration entirely, so a
|
|
66
|
+
* malformed world.json or a missing project answered them in different words than `add` — and
|
|
67
|
+
* `remove`'s schema-gate refusal, the one a caller most needs the guarantee on, carried none.
|
|
68
|
+
*/
|
|
69
|
+
function readProject(runDeps) {
|
|
70
|
+
try {
|
|
71
|
+
const context = loadProjectContext(runDeps.startDir);
|
|
72
|
+
return { context, world: readWorldJson(projectWorldJsonPath(context.root)) };
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
throw decoratedError(error, unchanged);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/** Appends the unchanged-world guarantee unless the message already makes it. */
|
|
79
|
+
function unchanged(message) {
|
|
80
|
+
return message.includes('world.json is unchanged') ? message : `${message} world.json is unchanged.`;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A decimal number and nothing else. `Number()` alone accepts `0x10` (16), `0b11`, `1e300`, `' 5 '`
|
|
84
|
+
* and `''` (0), so `--height 0x10` used to silently scale a model to 16 metres. Every rejection
|
|
85
|
+
* carries the unchanged-world guarantee, since these run before anything is read or uploaded.
|
|
86
|
+
*/
|
|
87
|
+
const DECIMAL = /^-?\d+(\.\d+)?$/;
|
|
88
|
+
function parseNumberFlag(flagName, raw, options = {}) {
|
|
89
|
+
if (raw === undefined)
|
|
90
|
+
return undefined;
|
|
91
|
+
const trimmed = raw.trim();
|
|
92
|
+
if (!DECIMAL.test(trimmed)) {
|
|
93
|
+
throw new CliError(`--${flagName} must be a decimal number, got ${JSON.stringify(raw)}. world.json is unchanged.`);
|
|
94
|
+
}
|
|
95
|
+
const value = Number(trimmed);
|
|
96
|
+
if (!Number.isFinite(value)) {
|
|
97
|
+
throw new CliError(`--${flagName} must be a number, got ${JSON.stringify(raw)}. world.json is unchanged.`);
|
|
98
|
+
}
|
|
99
|
+
if (options.min !== undefined && value < options.min) {
|
|
100
|
+
throw new CliError(`--${flagName} must be at least ${options.min}, got ${value}. world.json is unchanged.`);
|
|
101
|
+
}
|
|
102
|
+
if (options.max !== undefined && value > options.max) {
|
|
103
|
+
throw new CliError(`--${flagName} must be at most ${options.max}, got ${value}. world.json is unchanged.`);
|
|
104
|
+
}
|
|
105
|
+
return value;
|
|
106
|
+
}
|
|
107
|
+
export async function runAssetsAdd(options) {
|
|
108
|
+
const output = createOutput(options.json);
|
|
109
|
+
const runDeps = options.deps ?? defaultDeps(options.json);
|
|
110
|
+
// Flags first: a typo costs nothing and names itself.
|
|
111
|
+
const minVoxelSize = parseNumberFlag('voxel-size', options.voxelSize, { min: 0.01, max: 1 }) ?? DEFAULT_MIN_VOXEL_SIZE;
|
|
112
|
+
const maxVoxelSize = parseNumberFlag('max-voxel-size', options.maxVoxelSize, { min: 0.01, max: 4 }) ?? DEFAULT_MAX_VOXEL_SIZE;
|
|
113
|
+
if (maxVoxelSize < minVoxelSize) {
|
|
114
|
+
throw new CliError(`--max-voxel-size (${maxVoxelSize}) must be at least --voxel-size (${minVoxelSize}). world.json is unchanged.`);
|
|
115
|
+
}
|
|
116
|
+
const targetHeight = parseNumberFlag('height', options.height, { min: 0.01, max: 1000 });
|
|
117
|
+
if (options.hollow && options.solid) {
|
|
118
|
+
throw new CliError('Pass either --hollow or --solid, not both. world.json is unchanged.');
|
|
119
|
+
}
|
|
120
|
+
if (options.assetId !== undefined && options.assetId.trim() === '') {
|
|
121
|
+
throw new CliError('--asset-id was given with an empty value. Pass a real asset id (see `bitmagic assets list`), '
|
|
122
|
+
+ 'or omit the flag to mint a new one. world.json is unchanged.');
|
|
123
|
+
}
|
|
124
|
+
let context;
|
|
125
|
+
try {
|
|
126
|
+
context = loadProjectContext(runDeps.startDir);
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
throw decoratedError(error, unchanged);
|
|
130
|
+
}
|
|
131
|
+
const environment = resolveEnvironmentForCommand({ cwd: context.root, baseDir: runDeps.baseDir });
|
|
132
|
+
let token;
|
|
133
|
+
try {
|
|
134
|
+
token = await getAccessToken(environment, resolveAuth0ClientId(environment), { fetch: runDeps.fetch, sleep: runDeps.sleep, now: runDeps.now }, runDeps.baseDir);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
throw decoratedError(error, unchanged);
|
|
138
|
+
}
|
|
139
|
+
// Refuse a format or name this lane cannot take BEFORE a job record exists: a `.gltf` typed by
|
|
140
|
+
// mistake should not leave a failed "upload" in `.bitmagic/jobs/` or nudge about `bitmagic dev`.
|
|
141
|
+
const filePath = path.resolve(options.file);
|
|
142
|
+
classifyAssetFile(filePath, { keepGlb: options.keepGlb });
|
|
143
|
+
uploadFilename(filePath);
|
|
144
|
+
if (options.name !== undefined)
|
|
145
|
+
validateAssetName(options.name);
|
|
146
|
+
const result = await withJobRecord({
|
|
147
|
+
root: context.root,
|
|
148
|
+
kind: 'upload',
|
|
149
|
+
label: path.basename(filePath),
|
|
150
|
+
...(options.assetId !== undefined ? { assetId: options.assetId } : {}),
|
|
151
|
+
log: runDeps.log,
|
|
152
|
+
}, async (log) => {
|
|
153
|
+
try {
|
|
154
|
+
return await addAssetFile({
|
|
155
|
+
context,
|
|
156
|
+
environment,
|
|
157
|
+
token,
|
|
158
|
+
filePath,
|
|
159
|
+
...(options.name !== undefined ? { name: options.name } : {}),
|
|
160
|
+
...(options.assetId !== undefined ? { assetId: options.assetId } : {}),
|
|
161
|
+
keepGlb: options.keepGlb,
|
|
162
|
+
force: options.force,
|
|
163
|
+
voxel: {
|
|
164
|
+
minVoxelSize,
|
|
165
|
+
maxVoxelSize,
|
|
166
|
+
...(targetHeight !== undefined ? { targetHeight } : {}),
|
|
167
|
+
fillInterior: resolveFillInterior(options, targetHeight),
|
|
168
|
+
},
|
|
169
|
+
fetchImpl: runDeps.fetch,
|
|
170
|
+
...(runDeps.voxelize !== undefined ? { voxelize: runDeps.voxelize } : {}),
|
|
171
|
+
log,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
throw decoratedError(error, unchanged);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
// A replacement reuses an id, and previews are keyed by id and never otherwise invalidated — so
|
|
179
|
+
// without this the dev view keeps drawing the OLD asset's thumbnail for the new one, forever.
|
|
180
|
+
// The same reason `assets remove` drops it.
|
|
181
|
+
if (result.replaced)
|
|
182
|
+
removePreview(context.root, result.assetId);
|
|
183
|
+
for (const note of result.notes)
|
|
184
|
+
runDeps.log(`note: ${note}`);
|
|
185
|
+
runDeps.log(`${result.replaced ? 'Replaced' : 'Added'} "${result.name}" (${result.type}, id ${result.assetId}) in world.json.`);
|
|
186
|
+
output.result({ ok: true, kind: 'asset', ...result });
|
|
187
|
+
runDeps.log('A running `bitmagic dev` reloads the browser by itself to show it.');
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
// ============================================================================
|
|
191
|
+
// list
|
|
192
|
+
// ============================================================================
|
|
193
|
+
export async function runAssetsList(options) {
|
|
194
|
+
const output = createOutput(options.json);
|
|
195
|
+
const runDeps = options.deps ?? defaultDeps(options.json);
|
|
196
|
+
// Read-only, but it still carries the guarantee: an agent greps for this sentence to know it
|
|
197
|
+
// does not have to go and diff world.json itself.
|
|
198
|
+
const { world } = readProject(runDeps);
|
|
199
|
+
const rows = summarizeAssets(world);
|
|
200
|
+
const assets = Array.isArray(world.assets) ? world.assets : [];
|
|
201
|
+
if (options.json) {
|
|
202
|
+
// The raw records, not the table's summary of them: an agent reading this wants every field
|
|
203
|
+
// the engine will see (boundingBox, vehicleFitment, production, ...), plus the two counts —
|
|
204
|
+
// `placed` and the full `references` the remove command refuses on.
|
|
205
|
+
output.result({
|
|
206
|
+
ok: true,
|
|
207
|
+
count: rows.length,
|
|
208
|
+
assets,
|
|
209
|
+
placed: Object.fromEntries(rows.map((row) => [row.id, row.placed])),
|
|
210
|
+
references: Object.fromEntries(rows.map((row) => [row.id, row.references])),
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
runDeps.log(formatAssetTable(rows));
|
|
215
|
+
}
|
|
216
|
+
return rows;
|
|
217
|
+
}
|
|
218
|
+
export async function runAssetsRemove(options) {
|
|
219
|
+
const output = createOutput(options.json);
|
|
220
|
+
const runDeps = options.deps ?? defaultDeps(options.json);
|
|
221
|
+
const { context, world } = readProject(runDeps);
|
|
222
|
+
const worldPath = projectWorldJsonPath(context.root);
|
|
223
|
+
const plan = planAssetRemoval(world, options.assetId, options.force);
|
|
224
|
+
try {
|
|
225
|
+
applyModificationsToWorld(worldPath, plan.modifications, { subject: 'Removing the asset' });
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
throw decoratedError(error, unchanged);
|
|
229
|
+
}
|
|
230
|
+
removePreview(context.root, options.assetId);
|
|
231
|
+
const name = typeof plan.asset.name === 'string' ? plan.asset.name : options.assetId;
|
|
232
|
+
const remaining = plan.otherReferences.map((ref) => ref.path);
|
|
233
|
+
runDeps.log(`Removed "${name}" (${options.assetId}) from world.json`
|
|
234
|
+
+ (plan.placedInstances > 0
|
|
235
|
+
? ` along with ${plan.placedInstances} placed instance${plan.placedInstances === 1 ? '' : 's'}`
|
|
236
|
+
: '')
|
|
237
|
+
+ '. The uploaded file stays in storage.');
|
|
238
|
+
for (const ref of remaining)
|
|
239
|
+
runDeps.log(`warning: ${ref} still names this asset — fix it or the game will not find it.`);
|
|
240
|
+
const result = {
|
|
241
|
+
assetId: options.assetId, name, instancesRemoved: plan.placedInstances, remainingReferences: remaining,
|
|
242
|
+
};
|
|
243
|
+
output.result({ ok: true, kind: 'asset-removed', ...result });
|
|
244
|
+
runDeps.log('A running `bitmagic dev` reloads the browser by itself.');
|
|
245
|
+
return result;
|
|
246
|
+
}
|
|
247
|
+
// ============================================================================
|
|
248
|
+
// Subcommands
|
|
249
|
+
// ============================================================================
|
|
250
|
+
const JSON_FLAG = {
|
|
251
|
+
type: 'boolean',
|
|
252
|
+
description: 'Print the result as JSON on stdout; all progress goes to stderr.',
|
|
253
|
+
};
|
|
254
|
+
const addCommand = defineCommand({
|
|
255
|
+
meta: {
|
|
256
|
+
name: 'add',
|
|
257
|
+
description: `Upload one of your own files (${ACCEPTED_EXTENSIONS.map((e) => `.${e}`).join(' ')}) into the game's assets.`,
|
|
258
|
+
},
|
|
259
|
+
args: {
|
|
260
|
+
file: { type: 'positional', required: true, description: 'The file to add.' },
|
|
261
|
+
name: {
|
|
262
|
+
type: 'string',
|
|
263
|
+
description: 'Asset name; defaults to the filename without its extension.',
|
|
264
|
+
},
|
|
265
|
+
'asset-id': {
|
|
266
|
+
type: 'string',
|
|
267
|
+
description: 'Store under this asset_… id instead of minting one; re-running with the same id replaces the asset.',
|
|
268
|
+
},
|
|
269
|
+
'keep-glb': {
|
|
270
|
+
type: 'boolean',
|
|
271
|
+
description: 'Register a .glb as a polygon mesh instead of voxelizing it.',
|
|
272
|
+
},
|
|
273
|
+
'voxel-size': {
|
|
274
|
+
type: 'string',
|
|
275
|
+
description: `Finest voxel size in metres when voxelizing a .glb (default ${DEFAULT_MIN_VOXEL_SIZE}).`,
|
|
276
|
+
},
|
|
277
|
+
'max-voxel-size': {
|
|
278
|
+
type: 'string',
|
|
279
|
+
description: `Coarsest voxel size for flat areas (default ${DEFAULT_MAX_VOXEL_SIZE}; equal to --voxel-size for a uniform grid).`,
|
|
280
|
+
},
|
|
281
|
+
height: {
|
|
282
|
+
type: 'string',
|
|
283
|
+
description: 'Scale a .glb to this height in metres. Omit to keep its own size (2 m for --keep-glb).',
|
|
284
|
+
},
|
|
285
|
+
hollow: {
|
|
286
|
+
type: 'boolean',
|
|
287
|
+
description: 'Bake a .glb as a closed shell rather than filling its interior.',
|
|
288
|
+
},
|
|
289
|
+
solid: {
|
|
290
|
+
type: 'boolean',
|
|
291
|
+
description: `Fill a .glb's interior even when --height is over ${SOLID_FILL_MAX_HEIGHT_M} m (the default fills only below that).`,
|
|
292
|
+
},
|
|
293
|
+
force: {
|
|
294
|
+
type: 'boolean',
|
|
295
|
+
description: 'With --asset-id, replace a still-referenced asset even when the type changes.',
|
|
296
|
+
},
|
|
297
|
+
json: JSON_FLAG,
|
|
298
|
+
},
|
|
299
|
+
async run({ args }) {
|
|
300
|
+
await runAssetsAdd({
|
|
301
|
+
file: args.file,
|
|
302
|
+
// `!== undefined`, NOT truthiness. citty hands back `''` both for a flag given with no value
|
|
303
|
+
// and for one whose shell variable was empty (`--asset-id "$ID"` with ID unset), and a
|
|
304
|
+
// truthiness guard dropped the key entirely — so `--asset-id ''` silently minted a NEW id and
|
|
305
|
+
// ADDED a duplicate instead of replacing, and `--voxel-size ''` silently used the default.
|
|
306
|
+
// Passing `''` through lets the validators below reject it by name.
|
|
307
|
+
...(args.name !== undefined ? { name: args.name } : {}),
|
|
308
|
+
...(args['asset-id'] !== undefined ? { assetId: args['asset-id'] } : {}),
|
|
309
|
+
keepGlb: args['keep-glb'] === true,
|
|
310
|
+
force: args.force === true,
|
|
311
|
+
...(args['voxel-size'] !== undefined ? { voxelSize: args['voxel-size'] } : {}),
|
|
312
|
+
...(args['max-voxel-size'] !== undefined ? { maxVoxelSize: args['max-voxel-size'] } : {}),
|
|
313
|
+
...(args.height !== undefined ? { height: args.height } : {}),
|
|
314
|
+
hollow: args.hollow === true,
|
|
315
|
+
solid: args.solid === true,
|
|
316
|
+
json: args.json === true,
|
|
317
|
+
});
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
const listCommand = defineCommand({
|
|
321
|
+
meta: { name: 'list', description: 'List the assets in world.json: id, name, type, size, placed count.' },
|
|
322
|
+
args: { json: JSON_FLAG },
|
|
323
|
+
async run({ args }) {
|
|
324
|
+
await runAssetsList({ json: args.json === true });
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
const removeCommand = defineCommand({
|
|
328
|
+
meta: {
|
|
329
|
+
name: 'remove',
|
|
330
|
+
description: 'Remove an asset from world.json. The uploaded file stays in storage.',
|
|
331
|
+
},
|
|
332
|
+
args: {
|
|
333
|
+
'asset-id': { type: 'positional', required: true, description: 'The asset id (see `bitmagic assets list`).' },
|
|
334
|
+
force: {
|
|
335
|
+
type: 'boolean',
|
|
336
|
+
description: 'Remove even if the asset is still referenced; its placed instances are removed with it.',
|
|
337
|
+
},
|
|
338
|
+
json: JSON_FLAG,
|
|
339
|
+
},
|
|
340
|
+
async run({ args }) {
|
|
341
|
+
await runAssetsRemove({
|
|
342
|
+
assetId: args['asset-id'],
|
|
343
|
+
force: args.force === true,
|
|
344
|
+
json: args.json === true,
|
|
345
|
+
});
|
|
346
|
+
},
|
|
347
|
+
});
|
|
348
|
+
export const assetsCommand = defineCommand({
|
|
349
|
+
meta: {
|
|
350
|
+
name: 'assets',
|
|
351
|
+
description: 'Add your own files to the game\'s assets, list them, or remove one.',
|
|
352
|
+
},
|
|
353
|
+
subCommands: {
|
|
354
|
+
add: addCommand,
|
|
355
|
+
list: listCommand,
|
|
356
|
+
remove: removeCommand,
|
|
357
|
+
},
|
|
358
|
+
});
|
|
359
|
+
//# sourceMappingURL=assets.js.map
|