@bitmagic/cli 0.1.52-dev.8 → 0.1.52
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 +45 -9
- package/dist/assets/add.js +2 -1
- package/dist/assets/add.js.map +1 -1
- package/dist/assets/voxelize-glb.d.ts +17 -1
- package/dist/assets/voxelize-glb.js +43 -19
- package/dist/assets/voxelize-glb.js.map +1 -1
- package/dist/bin.js +25 -0
- package/dist/bin.js.map +1 -1
- package/dist/cli.d.ts +10 -0
- package/dist/cli.js +17 -7
- package/dist/cli.js.map +1 -1
- package/dist/commands/generate.d.ts +27 -0
- package/dist/commands/generate.js +132 -46
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/judge.d.ts +5 -0
- package/dist/commands/judge.js +28 -7
- package/dist/commands/judge.js.map +1 -1
- package/dist/commands/levels.d.ts +10 -17
- package/dist/commands/levels.js +48 -48
- package/dist/commands/levels.js.map +1 -1
- package/dist/commands/publish.d.ts +6 -1
- package/dist/commands/publish.js +29 -15
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/verify.d.ts +4 -0
- package/dist/commands/verify.js +94 -51
- package/dist/commands/verify.js.map +1 -1
- package/dist/editor/journal.d.ts +4 -1
- package/dist/editor/journal.js +13 -7
- package/dist/editor/journal.js.map +1 -1
- package/dist/editor/server.js +3 -1
- package/dist/editor/server.js.map +1 -1
- package/dist/generate/model.d.ts +13 -2
- package/dist/generate/model.js +70 -21
- package/dist/generate/model.js.map +1 -1
- package/dist/generate/prop.d.ts +60 -4
- package/dist/generate/prop.js +169 -46
- package/dist/generate/prop.js.map +1 -1
- package/dist/generate/stream.d.ts +7 -0
- package/dist/generate/stream.js +2 -1
- package/dist/generate/stream.js.map +1 -1
- package/dist/judge/record.d.ts +3 -0
- package/dist/judge/record.js +3 -0
- package/dist/judge/record.js.map +1 -1
- package/dist/levels/registry.d.ts +5 -2
- package/dist/levels/registry.js +32 -27
- package/dist/levels/registry.js.map +1 -1
- package/dist/messages/check.d.ts +30 -0
- package/dist/messages/check.js +119 -0
- package/dist/messages/check.js.map +1 -0
- package/dist/messages/notice.d.ts +58 -0
- package/dist/messages/notice.js +54 -0
- package/dist/messages/notice.js.map +1 -0
- package/dist/messages/refresh.d.ts +19 -0
- package/dist/messages/refresh.js +42 -0
- package/dist/messages/refresh.js.map +1 -0
- package/dist/project/jobs.d.ts +1 -1
- package/dist/project/jobs.js +16 -20
- package/dist/project/jobs.js.map +1 -1
- package/dist/project/platform-declaration.d.ts +51 -0
- package/dist/project/platform-declaration.js +81 -0
- package/dist/project/platform-declaration.js.map +1 -0
- package/dist/publish/platform.d.ts +4 -8
- package/dist/publish/platform.js +19 -53
- package/dist/publish/platform.js.map +1 -1
- package/dist/scaffold/project-files.js +54 -21
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/verify/artifacts.d.ts +19 -0
- package/dist/verify/artifacts.js +34 -0
- package/dist/verify/artifacts.js.map +1 -0
- package/dist/verify/browser.d.ts +10 -0
- package/dist/verify/browser.js +79 -9
- package/dist/verify/browser.js.map +1 -1
- package/dist/verify/classify.d.ts +37 -1
- package/dist/verify/classify.js +66 -2
- package/dist/verify/classify.js.map +1 -1
- package/dist/verify/device.d.ts +43 -0
- package/dist/verify/device.js +59 -0
- package/dist/verify/device.js.map +1 -0
- package/dist/verify/iterate.d.ts +21 -2
- package/dist/verify/iterate.js +43 -36
- package/dist/verify/iterate.js.map +1 -1
- package/dist/verify/mobile-parity.d.ts +42 -0
- package/dist/verify/mobile-parity.js +84 -0
- package/dist/verify/mobile-parity.js.map +1 -0
- package/dist/verify/platform.d.ts +47 -0
- package/dist/verify/platform.js +89 -0
- package/dist/verify/platform.js.map +1 -0
- package/dist/verify/result.d.ts +90 -6
- package/dist/verify/result.js +89 -10
- package/dist/verify/result.js.map +1 -1
- package/dist/verify/url.d.ts +9 -1
- package/dist/verify/url.js +10 -2
- package/dist/verify/url.js.map +1 -1
- package/package.json +4 -4
package/dist/generate/model.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { CliError } from '../errors.js';
|
|
2
2
|
import { mintAssetId, validateAssetName } from '../assets/file-kind.js';
|
|
3
|
-
import { assertEngineHonouredId, voxelizeGlbIntoAsset, } from '../assets/voxelize-glb.js';
|
|
3
|
+
import { assertEngineHonouredId, bakeSourceUrl, voxelizeGlbIntoAsset, } from '../assets/voxelize-glb.js';
|
|
4
4
|
import { applyModificationsToWorld } from '../forge/apply-modifications.js';
|
|
5
5
|
import { projectWorldJsonPath } from '../forge/run-pipeline.js';
|
|
6
6
|
import { requestGeneration } from './stream.js';
|
|
7
|
+
import { engineSupportsVxlMaster, messageOf } from './prop.js';
|
|
7
8
|
import { isJsonObject, readWorldJson } from '../project/world-json.js';
|
|
8
9
|
/**
|
|
9
|
-
* The wire
|
|
10
|
-
* header for why this command does not define one of its own.
|
|
10
|
+
* The wire types. `prop` is the api-server generator that turns a prompt into a mesh; see the file
|
|
11
|
+
* header for why this command does not define one of its own. `prop-voxel` is its dev-only sibling
|
|
12
|
+
* that skips the mesh.
|
|
11
13
|
*/
|
|
12
14
|
const MESH_GENERATOR_TYPE = 'prop';
|
|
15
|
+
const VOXEL_GENERATOR_TYPE = 'prop-voxel';
|
|
13
16
|
/**
|
|
14
17
|
* A usable asset name from the creator's sentence. Names are what game code places by, so this
|
|
15
18
|
* favours something short and typeable over something faithful: the prompt itself is kept on the
|
|
@@ -33,30 +36,34 @@ export async function generateAndInstallModel(options) {
|
|
|
33
36
|
log(`note: another asset is already named "${name}". Assets looked up by name resolve to the `
|
|
34
37
|
+ 'FIRST match — pass --name to give this one its own.');
|
|
35
38
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
throw new CliError('The generator reported success but returned no mesh. world.json is unchanged.');
|
|
43
|
-
}
|
|
44
|
-
glbUrl = outcome.glbUrl;
|
|
45
|
-
log(`Mesh generated: ${glbUrl}`);
|
|
39
|
+
const fetchImpl = options.fetchImpl ?? globalThis.fetch;
|
|
40
|
+
let source;
|
|
41
|
+
if (options.glbUrl !== undefined) {
|
|
42
|
+
// An explicit retry is always the mesh path: the caller has a mesh and asked for it.
|
|
43
|
+
log(`Reusing the mesh at ${options.glbUrl} — skipping generation.`);
|
|
44
|
+
source = { kind: 'glb', glbUrl: options.glbUrl };
|
|
46
45
|
}
|
|
47
46
|
else {
|
|
48
|
-
|
|
47
|
+
source = await generateSource({
|
|
48
|
+
context, environment, token, prompt, fetchImpl, log,
|
|
49
|
+
directVoxels: options.directVoxels === true,
|
|
50
|
+
});
|
|
49
51
|
}
|
|
50
|
-
// From here the
|
|
52
|
+
// From here the source is PAID FOR, so every failure names the command that resumes without
|
|
51
53
|
// paying again — the same contract `generate prop` and `generate vehicle` make.
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
+
const keptUrl = bakeSourceUrl(source);
|
|
55
|
+
const retryHint = source.kind === 'glb'
|
|
56
|
+
? 'The generated mesh is kept — retry the browser step for free with:\n'
|
|
57
|
+
+ ` bitmagic generate model --glb-url ${keptUrl} --asset-id ${assetId} --name "${name}"`
|
|
58
|
+
// No --master-url flag exists, so this does not name one. Re-running regenerates, which costs
|
|
59
|
+
// again; saying that plainly beats implying a free retry that is not there.
|
|
60
|
+
: `The generated voxel master is kept at ${keptUrl}. Re-running generates again.`;
|
|
54
61
|
const voxelize = options.voxelize ?? voxelizeGlbIntoAsset;
|
|
55
62
|
const engineAsset = await voxelize({
|
|
56
|
-
context, environment, token, name,
|
|
63
|
+
context, environment, token, name, source, assetId, voxel: options.voxel, retryHint,
|
|
57
64
|
requestPrefix: 'model', log,
|
|
58
65
|
});
|
|
59
|
-
assertEngineHonouredId(engineAsset, assetId, name, `the
|
|
66
|
+
assertEngineHonouredId(engineAsset, assetId, name, `the source is kept at ${keptUrl}`);
|
|
60
67
|
// The Asset Forger embeds no scene description, so the engine's record comes back with none and
|
|
61
68
|
// its `production.prompt` is empty. Carrying the prompt across is what makes a later HQ
|
|
62
69
|
// regeneration ask for the same object rather than a generic one.
|
|
@@ -69,7 +76,7 @@ export async function generateAndInstallModel(options) {
|
|
|
69
76
|
method: 'generated',
|
|
70
77
|
at: now().toISOString(),
|
|
71
78
|
prompt,
|
|
72
|
-
sourceUrl:
|
|
79
|
+
sourceUrl: keptUrl,
|
|
73
80
|
},
|
|
74
81
|
};
|
|
75
82
|
const modification = {
|
|
@@ -84,7 +91,49 @@ export async function generateAndInstallModel(options) {
|
|
|
84
91
|
assetName: name,
|
|
85
92
|
...(typeof asset.url === 'string' ? { assetUrl: asset.url } : {}),
|
|
86
93
|
...(typeof asset.voxelCount === 'number' ? { voxelCount: asset.voxelCount } : {}),
|
|
87
|
-
|
|
94
|
+
// Whichever it actually was — see GenerateModelResult.
|
|
95
|
+
...(source.kind === 'glb' ? { glbUrl: source.glbUrl } : { masterUrl: source.masterUrl }),
|
|
88
96
|
};
|
|
89
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Step 1: buy a source to bake.
|
|
100
|
+
*
|
|
101
|
+
* Prefers the voxel master in dev, falling back to the mesh on any failure — the same fork and the
|
|
102
|
+
* same two-way split as `generate prop`. A GENERATION failure falls through (and may already have
|
|
103
|
+
* been billed, since the Forger charges on acceptance); anything after that is the caller's
|
|
104
|
+
* problem to report, not a reason to buy a second source.
|
|
105
|
+
*/
|
|
106
|
+
async function generateSource(options) {
|
|
107
|
+
const { context, environment, token, prompt, fetchImpl, log } = options;
|
|
108
|
+
const body = { gameId: context.metadata.gameId, prompt };
|
|
109
|
+
if (options.directVoxels && environment.name === 'dev' && engineSupportsVxlMaster(context.root)) {
|
|
110
|
+
let outcome = null;
|
|
111
|
+
try {
|
|
112
|
+
outcome = await requestGeneration(environment, token, VOXEL_GENERATOR_TYPE, body, { fetch: fetchImpl, onProgress: log });
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
// A non-2xx THROWS rather than returning an unsuccessful outcome, so this catch IS the
|
|
116
|
+
// fallback for the likeliest failure: an api-server that does not know the type yet.
|
|
117
|
+
log(`Direct voxel generation is unavailable (${messageOf(error)}).`);
|
|
118
|
+
}
|
|
119
|
+
const masterUrl = outcome?.success ? outcome.masterUrl : undefined;
|
|
120
|
+
if (masterUrl) {
|
|
121
|
+
log(`Voxels generated: ${masterUrl}`);
|
|
122
|
+
return { kind: 'master', masterUrl };
|
|
123
|
+
}
|
|
124
|
+
if (outcome) {
|
|
125
|
+
log(`Direct voxel generation did not produce a master (${outcome.message}). `
|
|
126
|
+
+ 'If the generator had already accepted the job, that attempt was still billed.');
|
|
127
|
+
}
|
|
128
|
+
log('Falling back to the mesh path.');
|
|
129
|
+
}
|
|
130
|
+
const outcome = await requestGeneration(environment, token, MESH_GENERATOR_TYPE, body, { fetch: fetchImpl, onProgress: log });
|
|
131
|
+
if (!outcome.success)
|
|
132
|
+
throw new CliError(`${outcome.message} world.json is unchanged.`);
|
|
133
|
+
if (!outcome.glbUrl) {
|
|
134
|
+
throw new CliError('The generator reported success but returned no mesh. world.json is unchanged.');
|
|
135
|
+
}
|
|
136
|
+
log(`Mesh generated: ${outcome.glbUrl}`);
|
|
137
|
+
return { kind: 'glb', glbUrl: outcome.glbUrl };
|
|
138
|
+
}
|
|
90
139
|
//# sourceMappingURL=model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/generate/model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/generate/model.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EACL,sBAAsB,EAAE,aAAa,EAAE,oBAAoB,GAE5D,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO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prop.d.ts
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import type { Environment } from '../config/environments.js';
|
|
2
|
+
import { withVoxelizeSession } from '../forge/voxelize-session.js';
|
|
2
3
|
import type { ProjectContext } from '../project/context.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the bake was handed: a mesh to voxelize, or a voxel master to compile.
|
|
6
|
+
*
|
|
7
|
+
* A union rather than two optional URLs because exactly one is always true, and the error messages
|
|
8
|
+
* differ in the only part that matters — what was kept and how to retry with it.
|
|
9
|
+
*/
|
|
10
|
+
export type PropSource = {
|
|
11
|
+
kind: 'glb';
|
|
12
|
+
glbUrl: string;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'master';
|
|
15
|
+
masterUrl: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Whether this project's engine can bake a voxel master.
|
|
19
|
+
*
|
|
20
|
+
* A capability probe, not a version comparison. `withVoxelizeSession` runs the project's OWN
|
|
21
|
+
* vendored engine, and `CREATE_ASSET_FROM_VXL_MASTER` only exists in engines from 2026-08-02 —
|
|
22
|
+
* but the failure mode of guessing wrong is what makes this worth checking rather than trying:
|
|
23
|
+
* an engine with no handler for a message does not answer, so the request stalls for the full
|
|
24
|
+
* VOXELIZE_TIMEOUT_MS (10 minutes) and then again on the retry, after which the paid generation
|
|
25
|
+
* is thrown away. Reading a version string is the indirect way to ask; the file is the answer.
|
|
26
|
+
*
|
|
27
|
+
* `engine` resolves to `engine/engine` — see scaffold/aliases.ts.
|
|
28
|
+
*/
|
|
29
|
+
export declare function engineSupportsVxlMaster(projectRoot: string): boolean;
|
|
3
30
|
interface FitBox {
|
|
4
31
|
x: number;
|
|
5
32
|
z: number;
|
|
@@ -11,8 +38,14 @@ export interface PropVoxelizeOptions {
|
|
|
11
38
|
token: string;
|
|
12
39
|
assetId: string;
|
|
13
40
|
prompt: string;
|
|
14
|
-
|
|
41
|
+
source: PropSource;
|
|
15
42
|
log: (message: string) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Injected by tests so the bake runs without Chrome, matching the `voxelize` seam
|
|
45
|
+
* `generateAndInstallModel` already has. Without it none of the routing, capability or fallback
|
|
46
|
+
* logic below can be covered at all — every path ends in a real browser.
|
|
47
|
+
*/
|
|
48
|
+
session?: typeof withVoxelizeSession;
|
|
16
49
|
}
|
|
17
50
|
export interface GenerateAndInstallOptions {
|
|
18
51
|
context: ProjectContext;
|
|
@@ -24,7 +57,30 @@ export interface GenerateAndInstallOptions {
|
|
|
24
57
|
glbUrl?: string;
|
|
25
58
|
fetchImpl?: typeof globalThis.fetch;
|
|
26
59
|
log: (message: string) => void;
|
|
60
|
+
/** See PropVoxelizeOptions.session. */
|
|
61
|
+
session?: typeof withVoxelizeSession;
|
|
62
|
+
/**
|
|
63
|
+
* Ask for voxels directly instead of a mesh (`--direct-voxels`). Honoured only in `dev`, and
|
|
64
|
+
* only when the vendored engine can bake a master; the command falls back to the mesh path
|
|
65
|
+
* rather than failing when either is untrue.
|
|
66
|
+
*/
|
|
67
|
+
directVoxels?: boolean;
|
|
27
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* What the asset was made from, reported so callers do not have to guess.
|
|
71
|
+
*
|
|
72
|
+
* Two fields rather than one, because both end up in machine-readable output — the `--json`
|
|
73
|
+
* document and the editor's journal — and a voxel master reported under `glbUrl` would tell an
|
|
74
|
+
* agent there is a mesh to retry with when there is not, on the one path whose whole point is
|
|
75
|
+
* that no mesh exists.
|
|
76
|
+
*/
|
|
77
|
+
export type PropSourceResult = {
|
|
78
|
+
glbUrl: string;
|
|
79
|
+
masterUrl?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
masterUrl: string;
|
|
82
|
+
glbUrl?: undefined;
|
|
83
|
+
};
|
|
28
84
|
export interface PropVoxelizeResult {
|
|
29
85
|
assetId: string;
|
|
30
86
|
assetName: string;
|
|
@@ -32,6 +88,8 @@ export interface PropVoxelizeResult {
|
|
|
32
88
|
/** How many placed instances now point at the upgraded asset. */
|
|
33
89
|
instanceCount: number;
|
|
34
90
|
}
|
|
91
|
+
/** A thrown CliError's message, without letting a non-Error stringify to "[object Object]". */
|
|
92
|
+
export declare function messageOf(error: unknown): string;
|
|
35
93
|
/**
|
|
36
94
|
* The asset this command upgrades, with the `fitBox` the bake has to be constrained to.
|
|
37
95
|
*
|
|
@@ -58,9 +116,7 @@ export declare function shouldFillInterior(fitBox: FitBox): boolean;
|
|
|
58
116
|
* Everything the caller must resolve first (project, environment, token) is a parameter, so this
|
|
59
117
|
* stays free of CLI output plumbing and of how the token was obtained.
|
|
60
118
|
*/
|
|
61
|
-
export declare function generateAndInstallProp(options: GenerateAndInstallOptions): Promise<PropVoxelizeResult &
|
|
62
|
-
glbUrl: string;
|
|
63
|
-
}>;
|
|
119
|
+
export declare function generateAndInstallProp(options: GenerateAndInstallOptions): Promise<PropVoxelizeResult & PropSourceResult>;
|
|
64
120
|
/**
|
|
65
121
|
* Steps 2 and 3. Split from the command so the browser work is callable directly on a retry that
|
|
66
122
|
* already has a GLB, and so the command file stays about flags and output.
|
package/dist/generate/prop.js
CHANGED
|
@@ -8,19 +8,34 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Three steps, mirroring `game-play-agent/src/mastra/utils/hq-asset-jobs.ts` — the proven chain:
|
|
10
10
|
*
|
|
11
|
-
* 1. Ask api-server for
|
|
12
|
-
* live there and never reach this machine, which is the whole reason the editor
|
|
13
|
-
* the agent rather than doing it inline.
|
|
14
|
-
* 2.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
11
|
+
* 1. Ask api-server for the source (`POST /api/cli/v1/assets/<type>/stream`). Asset Forger
|
|
12
|
+
* credentials live there and never reach this machine, which is the whole reason the editor
|
|
13
|
+
* hands this to the agent rather than doing it inline.
|
|
14
|
+
* 2. Bake it in a browser, constrained to the asset's recorded `fitBox`. Only the engine can do
|
|
15
|
+
* this, so the CLI drives its own headless Chrome — `forge/voxelize-session.ts`, shared with
|
|
16
|
+
* `generate vehicle` and `assets add`.
|
|
17
17
|
* 3. Upsert the result into `assets[]` under the SAME id, which is what upgrades every already
|
|
18
18
|
* placed instance instead of adding a second asset beside them.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* Step 1 has two sources, and which one is used depends on the environment:
|
|
21
|
+
*
|
|
22
|
+
* - `prop` returns a GLB. The engine then voxelizes it and throws the mesh away — which is all
|
|
23
|
+
* a 50-100 MB textured model was ever for here.
|
|
24
|
+
* - `prop-voxel` returns an HFVX voxel master directly from TRELLIS.2's own voxel field, no mesh
|
|
25
|
+
* at any point. Measured on staging: 219 KB and ~8.5s warm, against minutes and megabytes.
|
|
26
|
+
*
|
|
27
|
+
* `prop-voxel` is OPT-IN: it needs `--direct-voxels`, the `dev` environment, and a project whose
|
|
28
|
+
* vendored engine has the handler for it. All three, or this is exactly the command it has always
|
|
29
|
+
* been. Default-on was tried first and pulled back: the mesh path is what every existing asset in
|
|
30
|
+
* every project was made with, so until the voxel path's output has been compared against it on
|
|
31
|
+
* real prompts, making it the default would change what `generate prop` produces for everyone on
|
|
32
|
+
* dev before anyone had judged whether the change is an improvement.
|
|
33
|
+
*
|
|
34
|
+
* The generated source survives a failure in steps 2-3: it is reported in the error so a retry can
|
|
35
|
+
* be pointed at it rather than paying for the generation twice.
|
|
22
36
|
*/
|
|
23
37
|
import * as fs from 'fs';
|
|
38
|
+
import * as path from 'path';
|
|
24
39
|
import { CliError } from '../errors.js';
|
|
25
40
|
import { applyModificationsToWorld } from '../forge/apply-modifications.js';
|
|
26
41
|
import { projectWorldJsonPath } from '../forge/run-pipeline.js';
|
|
@@ -33,6 +48,28 @@ import { requestGeneration } from './stream.js';
|
|
|
33
48
|
*/
|
|
34
49
|
const MIN_VOXEL_SIZE = 0.1;
|
|
35
50
|
const MAX_VOXEL_SIZE = 0.5;
|
|
51
|
+
/** The api-server generator types this command can ask for. */
|
|
52
|
+
const MESH_GENERATOR_TYPE = 'prop';
|
|
53
|
+
const VOXEL_GENERATOR_TYPE = 'prop-voxel';
|
|
54
|
+
/**
|
|
55
|
+
* Whether this project's engine can bake a voxel master.
|
|
56
|
+
*
|
|
57
|
+
* A capability probe, not a version comparison. `withVoxelizeSession` runs the project's OWN
|
|
58
|
+
* vendored engine, and `CREATE_ASSET_FROM_VXL_MASTER` only exists in engines from 2026-08-02 —
|
|
59
|
+
* but the failure mode of guessing wrong is what makes this worth checking rather than trying:
|
|
60
|
+
* an engine with no handler for a message does not answer, so the request stalls for the full
|
|
61
|
+
* VOXELIZE_TIMEOUT_MS (10 minutes) and then again on the retry, after which the paid generation
|
|
62
|
+
* is thrown away. Reading a version string is the indirect way to ask; the file is the answer.
|
|
63
|
+
*
|
|
64
|
+
* `engine` resolves to `engine/engine` — see scaffold/aliases.ts.
|
|
65
|
+
*/
|
|
66
|
+
export function engineSupportsVxlMaster(projectRoot) {
|
|
67
|
+
return fs.existsSync(path.join(projectRoot, 'engine', 'engine', 'template', 'VxlMasterAssetHandler.ts'));
|
|
68
|
+
}
|
|
69
|
+
/** A thrown CliError's message, without letting a non-Error stringify to "[object Object]". */
|
|
70
|
+
export function messageOf(error) {
|
|
71
|
+
return error instanceof Error ? error.message : String(error);
|
|
72
|
+
}
|
|
36
73
|
function isRecord(value) {
|
|
37
74
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
38
75
|
}
|
|
@@ -94,66 +131,152 @@ export function shouldFillInterior(fitBox) {
|
|
|
94
131
|
*/
|
|
95
132
|
export async function generateAndInstallProp(options) {
|
|
96
133
|
const { context, environment, token, assetId, prompt, log } = options;
|
|
134
|
+
const fetchImpl = options.fetchImpl ?? globalThis.fetch;
|
|
97
135
|
// Before anything is spent: a mistyped id or an asset with no fitBox costs nothing.
|
|
98
136
|
findPropAsset(readWorld(projectWorldJsonPath(context.root)), assetId);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
137
|
+
// A retry with `--glb-url` skips generation entirely and is always the mesh path — the caller
|
|
138
|
+
// has a mesh in hand and asked for it to be used.
|
|
139
|
+
if (options.glbUrl !== undefined) {
|
|
140
|
+
log(`Reusing the mesh at ${options.glbUrl} — skipping generation.`);
|
|
141
|
+
const reused = await voxelizeAndInstall({
|
|
142
|
+
context, environment, token, assetId, prompt,
|
|
143
|
+
source: { kind: 'glb', glbUrl: options.glbUrl },
|
|
144
|
+
log, ...(options.session ? { session: options.session } : {}),
|
|
145
|
+
});
|
|
146
|
+
return { ...reused, glbUrl: options.glbUrl };
|
|
147
|
+
}
|
|
148
|
+
if (options.directVoxels === true && environment.name === 'dev' && engineSupportsVxlMaster(context.root)) {
|
|
149
|
+
const viaVoxels = await tryVoxelMasterPath({ ...options, fetchImpl });
|
|
150
|
+
if (viaVoxels)
|
|
151
|
+
return viaVoxels;
|
|
152
|
+
// Only a GENERATION failure falls through — a bake failure throws out of tryVoxelMasterPath,
|
|
153
|
+
// because re-generating would pay twice for a source we already have.
|
|
154
|
+
log('Falling back to the mesh path.');
|
|
109
155
|
}
|
|
110
|
-
|
|
111
|
-
|
|
156
|
+
const outcome = await requestGeneration(environment, token, MESH_GENERATOR_TYPE, { gameId: context.metadata.gameId, prompt }, { fetch: fetchImpl, onProgress: log });
|
|
157
|
+
if (!outcome.success)
|
|
158
|
+
throw new CliError(`${outcome.message} world.json is unchanged.`);
|
|
159
|
+
if (!outcome.glbUrl) {
|
|
160
|
+
throw new CliError('The generator reported success but returned no mesh. world.json is unchanged.');
|
|
112
161
|
}
|
|
162
|
+
const glbUrl = outcome.glbUrl;
|
|
163
|
+
log(`Mesh generated: ${glbUrl}`);
|
|
113
164
|
const result = await voxelizeAndInstall({
|
|
114
|
-
context, environment, token, assetId, prompt,
|
|
165
|
+
context, environment, token, assetId, prompt,
|
|
166
|
+
source: { kind: 'glb', glbUrl },
|
|
167
|
+
log, ...(options.session ? { session: options.session } : {}),
|
|
115
168
|
});
|
|
116
169
|
return { ...result, glbUrl };
|
|
117
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* The dev-only path: a voxel master instead of a mesh.
|
|
173
|
+
*
|
|
174
|
+
* Returns null when GENERATION failed, so the caller can fall back to the mesh path. Bake failures
|
|
175
|
+
* throw instead: the master exists and was paid for, so the useful answer is "here is what is
|
|
176
|
+
* kept", not another generation. That is the same split the mesh path has always made with
|
|
177
|
+
* `--glb-url`.
|
|
178
|
+
*/
|
|
179
|
+
async function tryVoxelMasterPath(options) {
|
|
180
|
+
const { context, environment, token, assetId, prompt, log, fetchImpl } = options;
|
|
181
|
+
let outcome;
|
|
182
|
+
try {
|
|
183
|
+
outcome = await requestGeneration(environment, token, VOXEL_GENERATOR_TYPE, { gameId: context.metadata.gameId, prompt }, { fetch: fetchImpl, onProgress: log });
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
// A non-2xx THROWS rather than returning an unsuccessful outcome, so catching is not belt and
|
|
187
|
+
// braces — it is the whole fallback for the most likely failure of all. An api-server that
|
|
188
|
+
// does not know `prop-voxel` answers 400, which is exactly what a dev deployment looks like
|
|
189
|
+
// before this feature reaches it. Without this the command would die there instead of doing
|
|
190
|
+
// what it has always done.
|
|
191
|
+
log(`Direct voxel generation is unavailable (${messageOf(error)}).`);
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
const masterUrl = outcome.success ? outcome.masterUrl : undefined;
|
|
195
|
+
if (!masterUrl) {
|
|
196
|
+
// Said out loud, including the cost: the generator bills the moment the Forger accepts the
|
|
197
|
+
// job, so a failure here may already have spent sparks and the mesh attempt will spend more.
|
|
198
|
+
// A silent fallback is how a doubled bill becomes a mystery.
|
|
199
|
+
log(`Direct voxel generation did not produce a master (${outcome.message}). `
|
|
200
|
+
+ 'If the generator had already accepted the job, that attempt was still billed.');
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
log(`Voxels generated: ${masterUrl}`);
|
|
204
|
+
const result = await voxelizeAndInstall({
|
|
205
|
+
context, environment, token, assetId, prompt,
|
|
206
|
+
source: { kind: 'master', masterUrl },
|
|
207
|
+
log, ...(options.session ? { session: options.session } : {}),
|
|
208
|
+
});
|
|
209
|
+
return { ...result, masterUrl };
|
|
210
|
+
}
|
|
118
211
|
/**
|
|
119
212
|
* Steps 2 and 3. Split from the command so the browser work is callable directly on a retry that
|
|
120
213
|
* already has a GLB, and so the command file stays about flags and output.
|
|
121
214
|
*/
|
|
122
215
|
export async function voxelizeAndInstall(options) {
|
|
123
|
-
const { context, environment, token, assetId, prompt,
|
|
216
|
+
const { context, environment, token, assetId, prompt, source, log } = options;
|
|
217
|
+
const runSession = options.session ?? withVoxelizeSession;
|
|
124
218
|
const worldPath = projectWorldJsonPath(context.root);
|
|
125
219
|
const world = readWorld(worldPath);
|
|
126
220
|
const { asset, fitBox } = findPropAsset(world, assetId);
|
|
127
221
|
const assetName = typeof asset.name === 'string' ? asset.name : assetId;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
222
|
+
// What was generated, what it cost, and how to reuse it — the three things every failure below
|
|
223
|
+
// has to say, and the only part of those messages that differs between the two sources.
|
|
224
|
+
const kept = source.kind === 'glb'
|
|
225
|
+
? {
|
|
226
|
+
subject: 'the mesh',
|
|
227
|
+
what: `The generated mesh is kept at ${source.glbUrl}`,
|
|
228
|
+
retry: ' — retry with `--glb-url` to skip the paid generation step.',
|
|
229
|
+
}
|
|
230
|
+
: {
|
|
231
|
+
subject: 'the voxels',
|
|
232
|
+
// No --master-url retry flag exists yet; saying so beats implying one.
|
|
233
|
+
what: `The generated voxel master is kept at ${source.masterUrl}`,
|
|
234
|
+
retry: '. Re-run to generate again, or bake it by hand from that URL.',
|
|
235
|
+
};
|
|
236
|
+
return runSession({
|
|
237
|
+
context, environment, token, log, subject: kept.subject, retryHint: `${kept.what}${kept.retry}`,
|
|
132
238
|
}, async ({ host, port }) => {
|
|
133
|
-
log(`
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
239
|
+
log(`Baking "${assetName}" to its recorded fitBox…`);
|
|
240
|
+
// Both messages are answered on the GLB reply channel: the engine does that deliberately so
|
|
241
|
+
// the Creator's persist-and-reload watcher fires for either. `hq-asset-jobs.ts` picks between
|
|
242
|
+
// exactly these two shapes — this is that fork, not a third one.
|
|
243
|
+
const request = source.kind === 'glb'
|
|
244
|
+
? {
|
|
245
|
+
type: 'CREATE_ASSET_FROM_GLB_URL',
|
|
246
|
+
requestId: `prop-${assetId}-${port}`,
|
|
247
|
+
name: assetName,
|
|
248
|
+
glbUrl: source.glbUrl,
|
|
249
|
+
// The SAME id, which is what makes this an upgrade of every placed instance rather than
|
|
250
|
+
// a new asset sitting beside them.
|
|
251
|
+
assetId,
|
|
252
|
+
options: {
|
|
253
|
+
minVoxelSize: MIN_VOXEL_SIZE,
|
|
254
|
+
maxVoxelSize: MAX_VOXEL_SIZE,
|
|
255
|
+
fitBox,
|
|
256
|
+
fillInterior: shouldFillInterior(fitBox),
|
|
257
|
+
placeholder: false,
|
|
258
|
+
},
|
|
259
|
+
}
|
|
260
|
+
: {
|
|
261
|
+
type: 'CREATE_ASSET_FROM_VXL_MASTER',
|
|
262
|
+
requestId: `prop-${assetId}-${port}`,
|
|
263
|
+
name: assetName,
|
|
264
|
+
masterUrl: source.masterUrl,
|
|
265
|
+
assetId,
|
|
266
|
+
// No fillInterior: a master already carries the occupancy the mesh path has to infer.
|
|
267
|
+
options: {
|
|
268
|
+
minVoxelSize: MIN_VOXEL_SIZE,
|
|
269
|
+
maxVoxelSize: MAX_VOXEL_SIZE,
|
|
270
|
+
fitBox,
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
const result = await host.transport.sendAndWait(request, 'ASSET_FROM_GLB_URL_RESULT', VOXELIZE_TIMEOUT_MS, { maxRetries: 1 });
|
|
150
274
|
if (!result) {
|
|
151
|
-
throw new CliError(`
|
|
152
|
-
+ '`--glb-url` to skip the paid generation step.');
|
|
275
|
+
throw new CliError(`Baking "${assetName}" timed out. ${kept.what}${kept.retry}`);
|
|
153
276
|
}
|
|
154
277
|
if (result.success === false || !isRecord(result.asset)) {
|
|
155
278
|
const reason = typeof result.error === 'string' ? result.error : 'unknown error';
|
|
156
|
-
throw new CliError(`
|
|
279
|
+
throw new CliError(`Baking "${assetName}" failed: ${reason}. ${kept.what}.`);
|
|
157
280
|
}
|
|
158
281
|
const engineAsset = result.asset;
|
|
159
282
|
// The voxelize handler reads `description` from the GLB's scene extras, which the world-forger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop.js","sourceRoot":"","sources":["../../src/generate/prop.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"prop.js","sourceRoot":"","sources":["../../src/generate/prop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAA0B,MAAM,aAAa,CAAC;AAGxE;;;;GAIG;AACH,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,+DAA+D;AAC/D,MAAM,mBAAmB,GAAG,MAAM,CAAC;AACnC,MAAM,oBAAoB,GAAG,YAAY,CAAC;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utcome {
|
|
|
11
11
|
* for them this, not `patches`, is the result that matters. Absent for every other type.
|
|
12
12
|
*/
|
|
13
13
|
glbUrl?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Only the `prop-voxel` type sets this: an HFVX voxel master, generated with no mesh at any
|
|
16
|
+
* point. The same half-made-asset story as `glbUrl` — the caller bakes it in a browser before
|
|
17
|
+
* there is anything to write — but the bake takes a different engine message, so which field
|
|
18
|
+
* came back is what tells the caller which one to send.
|
|
19
|
+
*/
|
|
20
|
+
masterUrl?: string;
|
|
14
21
|
/**
|
|
15
22
|
* Only the `vehicle` type sets this: the bake settings its GLB was authored for. `minVoxelSize`
|
|
16
23
|
* is derived from the vehicle's own proportions rather than fixed, so the CLI cannot pick it —
|
package/dist/generate/stream.js
CHANGED
|
@@ -39,7 +39,7 @@ function asVehicleOutcome(value) {
|
|
|
39
39
|
function asGenerationOutcome(data) {
|
|
40
40
|
if (!isRecord(data))
|
|
41
41
|
return null;
|
|
42
|
-
const { success, message, patches, glbUrl, vehicle } = data;
|
|
42
|
+
const { success, message, patches, glbUrl, masterUrl, vehicle } = data;
|
|
43
43
|
if (typeof success !== 'boolean' || typeof message !== 'string' || !Array.isArray(patches)) {
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
@@ -49,6 +49,7 @@ function asGenerationOutcome(data) {
|
|
|
49
49
|
message,
|
|
50
50
|
patches: patches,
|
|
51
51
|
...(typeof glbUrl === 'string' ? { glbUrl } : {}),
|
|
52
|
+
...(typeof masterUrl === 'string' ? { masterUrl } : {}),
|
|
52
53
|
...(vehicleOutcome ? { vehicle: vehicleOutcome } : {}),
|
|
53
54
|
};
|
|
54
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/generate/stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;A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E,CAAC;gBACxD,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAChD,IAAI,OAAO;oBAAE,OAAO,OAAO,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,iDAAiD,IAAI,wBAAwB;QAC3E,oFAAoF;QACpF,8EAA8E,CACjF,CAAC;AACJ,CAAC"}
|
package/dist/judge/record.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ export interface JudgeRecord {
|
|
|
11
11
|
/** The frame that was judged, relative to the project root. */
|
|
12
12
|
screenshotPath: string;
|
|
13
13
|
genre?: string;
|
|
14
|
+
/** Which platform's frame was graded. Absent on records written before `--platform` existed,
|
|
15
|
+
* which were all desktop. */
|
|
16
|
+
platform?: 'desktop' | 'mobile';
|
|
14
17
|
}
|
|
15
18
|
export declare function writeJudgeRecord(root: string, record: JudgeRecord): void;
|
|
16
19
|
export declare function readJudgeRecord(root: string): JudgeRecord | null;
|