@bitmagic/cli 0.1.59-dev.1 → 0.1.59-dev.10
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 +146 -2
- package/dist/assets/file-kind.d.ts +8 -0
- package/dist/assets/file-kind.js +24 -0
- package/dist/assets/file-kind.js.map +1 -1
- package/dist/assets/materials.d.ts +165 -0
- package/dist/assets/materials.js +395 -0
- package/dist/assets/materials.js.map +1 -0
- package/dist/assets/vxl-summary.js +12 -5
- package/dist/assets/vxl-summary.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/assets.d.ts +25 -0
- package/dist/commands/assets.js +245 -2
- package/dist/commands/assets.js.map +1 -1
- package/dist/commands/forge.d.ts +2 -2
- package/dist/commands/forge.js +40 -17
- package/dist/commands/forge.js.map +1 -1
- package/dist/commands/generate.d.ts +29 -0
- package/dist/commands/generate.js +139 -3
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/theme.d.ts +3 -0
- package/dist/commands/theme.js +201 -0
- package/dist/commands/theme.js.map +1 -0
- package/dist/editor/animation-preview-page.d.ts +6 -0
- package/dist/editor/animation-preview-page.js +123 -0
- package/dist/editor/animation-preview-page.js.map +1 -0
- package/dist/editor/journal.d.ts +25 -0
- package/dist/editor/journal.js +8 -0
- package/dist/editor/journal.js.map +1 -1
- package/dist/editor/motion-panel.d.ts +20 -0
- package/dist/editor/motion-panel.js +432 -0
- package/dist/editor/motion-panel.js.map +1 -0
- package/dist/editor/motion-sink.d.ts +35 -0
- package/dist/editor/motion-sink.js +70 -0
- package/dist/editor/motion-sink.js.map +1 -0
- package/dist/editor/server.js +126 -0
- package/dist/editor/server.js.map +1 -1
- package/dist/editor/shell-page.js +16 -1
- package/dist/editor/shell-page.js.map +1 -1
- package/dist/forge/voxelize-session.d.ts +11 -0
- package/dist/forge/voxelize-session.js +23 -1
- package/dist/forge/voxelize-session.js.map +1 -1
- package/dist/generate/animation-from-video.d.ts +52 -0
- package/dist/generate/animation-from-video.js +152 -0
- package/dist/generate/animation-from-video.js.map +1 -0
- package/dist/project/jobs.d.ts +1 -1
- package/dist/project/jobs.js.map +1 -1
- package/dist/scaffold/project-files.d.ts +1 -0
- package/dist/scaffold/project-files.js +47 -1
- 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/theme/hud-theme-catalog.d.ts +236 -0
- package/dist/theme/hud-theme-catalog.js +386 -0
- package/dist/theme/hud-theme-catalog.js.map +1 -0
- package/dist/theme/theme-color-math.d.ts +21 -0
- package/dist/theme/theme-color-math.js +99 -0
- package/dist/theme/theme-color-math.js.map +1 -0
- package/dist/theme/theme-io.d.ts +49 -0
- package/dist/theme/theme-io.js +190 -0
- package/dist/theme/theme-io.js.map +1 -0
- package/dist/theme/theme-merge.d.ts +36 -0
- package/dist/theme/theme-merge.js +81 -0
- package/dist/theme/theme-merge.js.map +1 -0
- package/dist/theme/theme-report.d.ts +28 -0
- package/dist/theme/theme-report.js +142 -0
- package/dist/theme/theme-report.js.map +1 -0
- package/dist/theme/theme-stored.d.ts +21 -0
- package/dist/theme/theme-stored.js +50 -0
- package/dist/theme/theme-stored.js.map +1 -0
- package/dist/theme/theme-validate.d.ts +41 -0
- package/dist/theme/theme-validate.js +406 -0
- package/dist/theme/theme-validate.js.map +1 -0
- package/dist/verify/classify.js +19 -0
- package/dist/verify/classify.js.map +1 -1
- package/dist/verify/hud-theme.d.ts +55 -0
- package/dist/verify/hud-theme.js +70 -0
- package/dist/verify/hud-theme.js.map +1 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -204,6 +204,7 @@ browser reloads itself on every change and the assets panel shows each generatio
|
|
|
204
204
|
| `bitmagic generate <skybox\|background\|block-type\|sound\|image\|character\|animation\|model\|prop\|vehicle> ...` | Generate one asset directly into `src/work/world.json`. Costs sparks. `model` mints a **new** 3D object from a prompt, `prop` upgrades an existing placeholder **in place** (both produce voxels directly; `--mesh` takes the older mesh path), `vehicle` adds a new drivable one, `animation` takes a parameter spec rather than a prompt, `block-type` registers a custom voxel block — see below. `skybox` and `background` write the **same** field: pick one. |
|
|
205
205
|
| `bitmagic assets add <file> [--name <n>] [--asset-id <id>] [--keep-glb] [--voxel-size <m>] [--max-voxel-size <m>] [--height <m>] [--hollow\|--solid] [--force]` | Upload **your own** file — `.glb`, `.vxl`, `.png/.jpg/.webp`, `.opus/.ogg/.m4a/.mp3`, `.json` — into the game's assets and write its entry into `src/work/world.json`. A `.glb` is voxelized in a headless browser (Chrome + a free port in 3000–3199, like `prop`) unless `--keep-glb`. Free — no sparks. See **Adding your own assets** below. |
|
|
206
206
|
| `bitmagic assets list` | The assets in `world.json`: id, name, type, size, placed instances, and total references. Local, no network. |
|
|
207
|
+
| `bitmagic assets materials <assetId> [--set <file.json>] [--auto] [--clear]` | Show what an asset's voxels look like, or say what they are **made of** — so a sword's steel blade shines and its leather grip does not. With no flag it prints the asset's colour groups; `--set` applies your verdicts; `--auto` lets a model decide (what `generate prop` and `generate model` already do on their own); `--clear` removes them. Free — no sparks, nothing generated. See **Voxel materials** below. |
|
|
207
208
|
| `bitmagic assets remove <assetId> [--force]` | Remove an asset from `world.json` (the uploaded file stays in storage). Refuses while anything in `world.json` still references it; `--force` removes the asset and its placed instances together. |
|
|
208
209
|
| `bitmagic cover [--prompt "..."] [--force] [--no-start-screen]` | Generate the game's cover art from `GAME-DESIGN.md`: sets the start screen, saves `.bitmagic/cover.webp`, becomes the publish thumbnail. Costs sparks. |
|
|
209
210
|
| `bitmagic reference <make\|accept\|show\|clear> ...` | Make a concept image of the game's world, iterate until it is right, and `accept` one — the accepted image becomes the default style reference for `generate skybox\|background\|block-type\|image`, `cover` and `forge`. Only `make` costs sparks (priced like an image). See **Reference image** below. |
|
|
@@ -251,6 +252,35 @@ Two things the spec will refuse, both before anything is sent:
|
|
|
251
252
|
`playCustomAnimation("mLimpStride01")` resolves. It is not the minted `asset_…` id — pass that
|
|
252
253
|
as `--asset-id` if you have one.
|
|
253
254
|
|
|
255
|
+
### From a video (`--video`)
|
|
256
|
+
|
|
257
|
+
The one exception to "no text-to-motion service": a clip can be made from a **video of a person
|
|
258
|
+
performing the move**, through Uthana's video-to-motion. The creator supplies the motion by doing
|
|
259
|
+
it, not by describing it, so it sits beside the authored forger rather than replacing it.
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
bitmagic generate animation --video ~/wave.mov --name "Wave"
|
|
263
|
+
bitmagic generate animation --video ~/jog.webm --name "Jog" --slot run --loop
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
- `.mp4`, `.mov`, `.avi` or `.webm`; **2–60 seconds**; under 200 MB. One person, whole body in
|
|
267
|
+
frame, plain background, good light. Anything else is re-encoded server-side, so a browser's
|
|
268
|
+
WebM recording is as good as a phone's mp4.
|
|
269
|
+
- `--slot idle|walk|run` pins the clip to that locomotion state for the player **and every NPC**
|
|
270
|
+
(persisted as `locomotionState` on the asset — no template code to edit). Omit it for a one-shot
|
|
271
|
+
clip and play it with `playCustomAnimation("<motionId>")`.
|
|
272
|
+
- It costs sparks (15, charged when Uthana accepts the video) and takes minutes: the command
|
|
273
|
+
uploads the file, submits a job, and polls until the clip lands in `src/work/world.json`.
|
|
274
|
+
- `--auto-trim` cuts the "walking to the camera" frames off both ends before Uthana sees the
|
|
275
|
+
clip: pose analysis finds where the person stepped back into frame after pressing record and
|
|
276
|
+
where they came forward to press stop. Use it for clips recorded that way; when the analysis
|
|
277
|
+
is not confident, nothing is trimmed. The result reports what was removed.
|
|
278
|
+
- `--spec`/`--family` cannot be combined with `--video`.
|
|
279
|
+
|
|
280
|
+
`bitmagic dev` has the same flow behind its **Record motion** button — record with the webcam
|
|
281
|
+
(auto-trim is applied to those recordings; picked files are sent as they are) or pick a file,
|
|
282
|
+
name it, choose a slot — and runs it through this command in the sidecar.
|
|
283
|
+
|
|
254
284
|
## Environments
|
|
255
285
|
|
|
256
286
|
`--env` accepts `dev`, `prod`, or `local`. Each command resolves its target in this order, most
|
|
@@ -586,7 +616,8 @@ reloads. The same cache feeds the editor's right-click **Add object** palette, w
|
|
|
586
616
|
|
|
587
617
|
**Click a row to look at the asset properly.** A mesh or a voxel asset opens in a viewer you can
|
|
588
618
|
drag to turn and scroll to zoom, at full detail rather than the coarse version a 46px tile is drawn
|
|
589
|
-
from; an image opens as the image; a sound gets a player
|
|
619
|
+
from; an image opens as the image; a sound gets a player; an animation plays on the engine's block
|
|
620
|
+
character — the same clip preview the Creator has — with play/pause and a speed slider. Beside it is everything the row has no
|
|
590
621
|
room for — extent in world units, voxel count, triangle count, and the asset id, with a button to
|
|
591
622
|
copy it so you can paste it into a `bitmagic generate prop --asset …`. Escape closes it. The game
|
|
592
623
|
pauses while it is open and resumes when you close it.
|
|
@@ -696,7 +727,7 @@ What each file becomes:
|
|
|
696
727
|
| `.opus .ogg .m4a .mp3` | `audio` | Uploaded as-is. The engine plays all four; the Creator would transcode to `.opus` for a smaller download, and the command prints the `ffmpeg` line that does the same. |
|
|
697
728
|
| `.json` | `json` | The config-data assets `game/agent-docs/json-assets.md` describes. |
|
|
698
729
|
| `.gltf` | refused | Its buffers and textures live in files beside it, and the game loads one URL. Export a self-contained `.glb`. |
|
|
699
|
-
| `.vox .qb .fbx .spz .ply .sog .mp4` | refused | Each needs a conversion the Creator runs server-side (voxel-model import, FBX animation import, splat transcode, video faststart). Upload those through the Creator's Assets tab. |
|
|
730
|
+
| `.vox .qb .fbx .spz .ply .sog .mp4` | refused | Each needs a conversion the Creator runs server-side (voxel-model import, FBX animation import, splat transcode, video faststart). Upload those through the Creator's Assets tab. | (An `.mp4` you want turned into an **animation** goes to `bitmagic generate animation --video` instead.)
|
|
700
731
|
|
|
701
732
|
The name defaults to the filename without its extension (`--name` overrides). The id is minted as
|
|
702
733
|
`asset_<timestamp>_<random>` unless `--asset-id` gives one — re-running with the same id **replaces**
|
|
@@ -774,6 +805,119 @@ whose vendored engine predates voxel masters takes the mesh path regardless, and
|
|
|
774
805
|
If the bake fails after the source exists, the error prints the exact command to retry the browser
|
|
775
806
|
step **without paying again** — `--master-url …` for voxels, `--glb-url …` for a mesh.
|
|
776
807
|
|
|
808
|
+
## Voxel materials
|
|
809
|
+
|
|
810
|
+
A generated voxel asset carries colours and nothing else, so every voxel shades identically: a
|
|
811
|
+
sword's steel blade responds to light exactly like its leather grip, and both read as flat paint.
|
|
812
|
+
Material classes fix that by saying what each colour is **made of**.
|
|
813
|
+
|
|
814
|
+
**You usually do not have to do anything.** `bitmagic generate prop` and `bitmagic generate model`
|
|
815
|
+
classify the asset right after the bake: a light model reads the same colour table shown below
|
|
816
|
+
together with the asset's prompt, and its verdicts are written into the `.vxl` before the command
|
|
817
|
+
returns (`Materials: metal, leather` in the output; `materials.classifier: "ai"` on the asset's
|
|
818
|
+
`world.json` entry). Pass `--no-materials` to skip it. A classification that cannot run — no model
|
|
819
|
+
credential, an engine too old to write classes — is a note, never a failed generation; the asset is
|
|
820
|
+
baked and matte, and `bitmagic assets materials <id> --auto` retries it later.
|
|
821
|
+
|
|
822
|
+
`bitmagic forge` does the same twice over: the level's own terrain gets classes the designer
|
|
823
|
+
authored per colour ("rock on steep slopes" bakes onto the stone tier), and every archetype
|
|
824
|
+
library asset the forge creates is classified right after the bake, in the same session. A matte
|
|
825
|
+
archetype is always retriable with `bitmagic assets materials <id> --auto`.
|
|
826
|
+
|
|
827
|
+
When the automatic answer is wrong, or for an asset added from a file (which records no prompt, so
|
|
828
|
+
nothing is classified automatically), `bitmagic assets materials` is two steps, and the CLI does not
|
|
829
|
+
guess at the middle one — **you do**, because you are the one who knows what the asset is meant to
|
|
830
|
+
be.
|
|
831
|
+
|
|
832
|
+
```bash
|
|
833
|
+
bitmagic assets materials sword-01 # what does this asset look like?
|
|
834
|
+
bitmagic assets materials sword-01 --set m.json # here is what those colours are
|
|
835
|
+
bitmagic assets materials sword-01 --auto # or let the model decide again
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
The first command prints the asset's colour groups:
|
|
839
|
+
|
|
840
|
+
```
|
|
841
|
+
"Longsword" signature 4f2a91cd (version 1)
|
|
842
|
+
|
|
843
|
+
20 voxels, 5 palette entries, bbox 1x20x1 voxels
|
|
844
|
+
|
|
845
|
+
id colour share height(min-max) extent(x,y,z) radial shape parts
|
|
846
|
+
g0 #dddddd 70.0% 0.33-0.98 0.00,0.65,0.00 0.00 thin-long 1
|
|
847
|
+
g1 #998866 20.0% 0.03-0.18 0.00,0.15,0.00 0.00 blob 1
|
|
848
|
+
g2 #eecc66 10.0% 0.23-0.28 0.00,0.05,0.00 0.00 blob 1
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
Read with the asset's own prompt — printed underneath — that is enough to name the materials: g0 is
|
|
852
|
+
the steel blade (most of the model, upper two thirds, long and thin), g1 the leather grip at the
|
|
853
|
+
bottom, g2 a brass pommel between them. `share` is the fraction of the asset, `height` where it
|
|
854
|
+
sits from floor to top, `extent` its size along each axis relative to the whole, `radial` how far
|
|
855
|
+
from the centre axis, and `parts` how many separate pieces the colour forms — a colour scattered
|
|
856
|
+
across the whole model in many parts is dithering, not a material.
|
|
857
|
+
|
|
858
|
+
Then write the verdicts:
|
|
859
|
+
|
|
860
|
+
```json
|
|
861
|
+
{
|
|
862
|
+
"signatureVersion": 1,
|
|
863
|
+
"signatureHash": "4f2a91cd",
|
|
864
|
+
"verdicts": [
|
|
865
|
+
{ "id": "g0", "class": "metal", "confidence": 0.95 },
|
|
866
|
+
{ "id": "g1", "class": "leather", "confidence": 0.9 },
|
|
867
|
+
{ "id": "g2", "class": "gold", "confidence": 0.6 }
|
|
868
|
+
]
|
|
869
|
+
}
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
The `signatureHash` binds the answer to the asset it describes: re-bake or re-voxelize the asset
|
|
873
|
+
and the hash changes, so a stale set of verdicts is refused rather than applied to geometry it
|
|
874
|
+
never saw.
|
|
875
|
+
|
|
876
|
+
**Classes:** `matte` (the default — no special shading), `metal`, `gold`, `chrome`, `gem`, `glass`,
|
|
877
|
+
`wood`, `stone`, `cloth`, `fur`, `leather`, `plastic`, `paint`. The first five reflect the sky; the
|
|
878
|
+
rest get a highlight from the scene's own lights, which keeps their colours exactly as they are.
|
|
879
|
+
`fur` is the odd one out — it reflects nothing, but picks up a soft halo towards its silhouette the
|
|
880
|
+
way a pelt or plush does. Use it for exactly that: a teddy bear, an animal, a fur trim. Anything
|
|
881
|
+
merely soft is `cloth`.
|
|
882
|
+
|
|
883
|
+
The engine also has three classes that EMIT light — `filament`, `neon`, `lava` — which is why you
|
|
884
|
+
may see one in a `.vxl` that this command never wrote. They are not on the list above and must not
|
|
885
|
+
be used here, deliberately: whether a surface is a light is not answerable from its colour, and a
|
|
886
|
+
wrongly glowing surface is worse than a wrongly shiny one because it also lights everything around
|
|
887
|
+
it. They are picked in the voxel editor, where a person selected the voxels and knows. A verdict
|
|
888
|
+
naming one is refused over a quarter of an asset like any precious material, and arrives with no
|
|
889
|
+
glow even when it is accepted.
|
|
890
|
+
|
|
891
|
+
**Rules worth following:**
|
|
892
|
+
|
|
893
|
+
- `matte` is the right answer for most groups, and costs nothing. Leave a group out entirely rather
|
|
894
|
+
than inventing a material for it.
|
|
895
|
+
- The asset's prompt is the strongest evidence there is — it names the materials, and your job is
|
|
896
|
+
only to decide which colour group is which.
|
|
897
|
+
- A material the prompt does **not** name needs strong evidence from the geometry. A precious
|
|
898
|
+
material (`gold`, `gem`, `glass`) claimed over more than a quarter of the asset is refused
|
|
899
|
+
outright unless the prompt says so: a wooden crate is never 40% gem, and a wrongly shiny surface
|
|
900
|
+
is what a player notices.
|
|
901
|
+
- Use a low confidence rather than guessing. Below 0.45 a verdict is dropped, which is a better
|
|
902
|
+
outcome than a surface that shines when it should not.
|
|
903
|
+
- An asset that records no prompt or description has nothing saying what it is. Prefer leaving it
|
|
904
|
+
alone.
|
|
905
|
+
|
|
906
|
+
**Budget.** Four materials per asset. Each one is an extra draw call on every placed instance, so
|
|
907
|
+
over budget the smallest is folded into a related class (`gold` into `metal`, `gem` into `glass`)
|
|
908
|
+
rather than dropped — every fold is reported. Very small groups are dropped too, except for the
|
|
909
|
+
precious classes, where a fraction of a per cent is exactly the point.
|
|
910
|
+
|
|
911
|
+
Materials are written into the `.vxl` under the **same asset id**, so every placed instance changes
|
|
912
|
+
with it. `--clear` puts an asset back to the plain look — it strips the classes and keeps every
|
|
913
|
+
slot's glow, because taking a light away is the one thing this command must never do. A re-bake
|
|
914
|
+
(`bitmagic assets revoxelize`) produces a fresh `.vxl` whose palette the old verdicts no longer
|
|
915
|
+
describe, so it classifies again on its own — `--no-materials` there leaves the re-baked asset
|
|
916
|
+
plain. Nothing here generates anything or costs
|
|
917
|
+
sparks; what it costs is the headless browser bake, since only the engine can read and write a
|
|
918
|
+
`.vxl`. An asset whose base voxels glow (from the older per-colour glow that materials replaced) is
|
|
919
|
+
refused rather than having that glow silently traded for a shine.
|
|
920
|
+
|
|
777
921
|
## Drivable vehicles
|
|
778
922
|
|
|
779
923
|
`bitmagic generate vehicle` designs a vehicle and registers it as a **new** asset — unlike
|
|
@@ -9,6 +9,14 @@ export interface AssetFileClass {
|
|
|
9
9
|
/** Lower-case extension without the dot. */
|
|
10
10
|
extension: string;
|
|
11
11
|
}
|
|
12
|
+
/** Extensions `classifyVideoFile` accepts, for help text and the README. */
|
|
13
|
+
export declare const VIDEO_EXTENSIONS: string[];
|
|
14
|
+
export interface VideoFileClass {
|
|
15
|
+
contentType: string;
|
|
16
|
+
/** Lower-case extension without the dot. */
|
|
17
|
+
extension: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function classifyVideoFile(filename: string): VideoFileClass;
|
|
12
20
|
/** Every extension `classifyAssetFile` accepts, for help text and the README. */
|
|
13
21
|
export declare const ACCEPTED_EXTENSIONS: string[];
|
|
14
22
|
/**
|
package/dist/assets/file-kind.js
CHANGED
|
@@ -39,6 +39,30 @@ const AUDIO_TYPES = {
|
|
|
39
39
|
m4a: 'audio/mp4',
|
|
40
40
|
mp3: 'audio/mpeg',
|
|
41
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* What `bitmagic generate animation --video <file>` takes. Deliberately NOT part of
|
|
44
|
+
* `classifyAssetFile`: an `.mp4` handed to `assets add` is still refused (it would be a video
|
|
45
|
+
* asset needing the Creator's faststart pass), while the same file here is the INPUT to a
|
|
46
|
+
* video-to-motion job — asset-forger re-encodes whatever it gets, so `.webm` from a browser's
|
|
47
|
+
* MediaRecorder is as good as an `.mp4` from a phone.
|
|
48
|
+
*/
|
|
49
|
+
const VIDEO_TYPES = {
|
|
50
|
+
mp4: 'video/mp4',
|
|
51
|
+
mov: 'video/quicktime',
|
|
52
|
+
avi: 'video/x-msvideo',
|
|
53
|
+
webm: 'video/webm',
|
|
54
|
+
};
|
|
55
|
+
/** Extensions `classifyVideoFile` accepts, for help text and the README. */
|
|
56
|
+
export const VIDEO_EXTENSIONS = Object.keys(VIDEO_TYPES);
|
|
57
|
+
export function classifyVideoFile(filename) {
|
|
58
|
+
const extension = fileExtension(filename);
|
|
59
|
+
const contentType = VIDEO_TYPES[extension];
|
|
60
|
+
if (contentType === undefined) {
|
|
61
|
+
throw new CliError(`--video takes ${VIDEO_EXTENSIONS.map((e) => `.${e}`).join(', ')}; `
|
|
62
|
+
+ `${JSON.stringify(path.basename(filename))} is none of those.`);
|
|
63
|
+
}
|
|
64
|
+
return { contentType, extension };
|
|
65
|
+
}
|
|
42
66
|
/** Every extension `classifyAssetFile` accepts, for help text and the README. */
|
|
43
67
|
export const ACCEPTED_EXTENSIONS = ['glb', 'vxl', 'png', 'jpg', 'jpeg', 'webp', 'opus', 'ogg', 'm4a', 'mp3', 'json'];
|
|
44
68
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-kind.js","sourceRoot":"","sources":["../../src/assets/file-kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,IAAI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/voxelize-session.js';
|
|
3
|
+
import type { ProjectContext } from '../project/context.js';
|
|
4
|
+
/**
|
|
5
|
+
* Whether this project's vendored engine can answer these messages at all.
|
|
6
|
+
*
|
|
7
|
+
* A capability PROBE, not a version compare, exactly as `engineSupportsVxlMaster`
|
|
8
|
+
* does and for the reason its own doc gives: an engine with no handler never
|
|
9
|
+
* replies, so the request would stall for the full ten-minute bake timeout and
|
|
10
|
+
* then report a timeout, with nothing pointing at the real cause.
|
|
11
|
+
*/
|
|
12
|
+
export declare function engineSupportsMaterialClasses(projectRoot: string): boolean;
|
|
13
|
+
/** One colour group of an asset, as the engine described it. */
|
|
14
|
+
export interface MaterialGroup {
|
|
15
|
+
id: string;
|
|
16
|
+
hex: string;
|
|
17
|
+
share: number;
|
|
18
|
+
shape: string;
|
|
19
|
+
}
|
|
20
|
+
/** What the engine reports about an asset's materials. */
|
|
21
|
+
export interface MaterialSignatureReply {
|
|
22
|
+
version: number;
|
|
23
|
+
hash: string;
|
|
24
|
+
voxelCount: number;
|
|
25
|
+
paletteSize: number;
|
|
26
|
+
groups: MaterialGroup[];
|
|
27
|
+
existingSlots: string[];
|
|
28
|
+
}
|
|
29
|
+
/** A single group's verdict, as written into a `--set` file. */
|
|
30
|
+
export interface MaterialVerdictInput {
|
|
31
|
+
id: string;
|
|
32
|
+
class: string;
|
|
33
|
+
confidence: number;
|
|
34
|
+
}
|
|
35
|
+
export interface MaterialsBaseOptions {
|
|
36
|
+
context: ProjectContext;
|
|
37
|
+
environment: Environment;
|
|
38
|
+
token: string;
|
|
39
|
+
assetId: string;
|
|
40
|
+
log: (message: string) => void;
|
|
41
|
+
fetchImpl?: typeof globalThis.fetch;
|
|
42
|
+
/** Injected in tests so the lane runs without Chrome. */
|
|
43
|
+
session?: typeof withVoxelizeSession;
|
|
44
|
+
}
|
|
45
|
+
export interface ReadMaterialsResult {
|
|
46
|
+
assetId: string;
|
|
47
|
+
assetName: string;
|
|
48
|
+
signature: MaterialSignatureReply;
|
|
49
|
+
/** The engine's own rendering of the signature — printed verbatim. */
|
|
50
|
+
table: string;
|
|
51
|
+
/** The asset's generation prompt or description, when it records one. */
|
|
52
|
+
promptText?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The asset to work on, refused before the browser starts if it cannot be.
|
|
56
|
+
*
|
|
57
|
+
* Only a `vxl` asset has voxels to classify. A GLB kept as a mesh, an image, a
|
|
58
|
+
* sound: none of them have a palette, and saying so up front costs nothing while
|
|
59
|
+
* a browser launch costs seconds.
|
|
60
|
+
*/
|
|
61
|
+
export declare function findVoxelAsset(world: Record<string, unknown>, assetId: string): {
|
|
62
|
+
asset: Record<string, unknown>;
|
|
63
|
+
url: string;
|
|
64
|
+
name: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The text this asset was generated from, if it records any.
|
|
68
|
+
*
|
|
69
|
+
* The single most valuable signal a classifier has — it names the materials
|
|
70
|
+
* outright — and also what the plausibility guard checks a precious-material
|
|
71
|
+
* claim against. Absent for an asset added from a file, which is exactly the case
|
|
72
|
+
* where classifying on colour alone would be guessing.
|
|
73
|
+
*/
|
|
74
|
+
export declare function assetPromptText(asset: Record<string, unknown>): string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Ask the engine what the asset is made of.
|
|
77
|
+
*
|
|
78
|
+
* Reads only — no upload, no world.json write, nothing spent. Safe to run as often
|
|
79
|
+
* as you like, which matters because it is the step an agent runs first.
|
|
80
|
+
*/
|
|
81
|
+
export declare function readAssetMaterials(options: MaterialsBaseOptions): Promise<ReadMaterialsResult>;
|
|
82
|
+
export interface SetMaterialsOptions extends MaterialsBaseOptions {
|
|
83
|
+
/** The verdicts to apply, and the signature hash they were computed against. */
|
|
84
|
+
signatureVersion: number;
|
|
85
|
+
signatureHash: string;
|
|
86
|
+
verdicts: MaterialVerdictInput[];
|
|
87
|
+
}
|
|
88
|
+
export interface ClearMaterialsOptions extends MaterialsBaseOptions {
|
|
89
|
+
clear: true;
|
|
90
|
+
}
|
|
91
|
+
export interface SetMaterialsResult {
|
|
92
|
+
assetId: string;
|
|
93
|
+
assetName: string;
|
|
94
|
+
/** The material classes now on the asset. Empty after a --clear. */
|
|
95
|
+
slots: string[];
|
|
96
|
+
/** Classes that lost a share floor, the slot budget, or the plausibility guard. */
|
|
97
|
+
dropped: Array<{
|
|
98
|
+
class: string;
|
|
99
|
+
reason: string;
|
|
100
|
+
share: number;
|
|
101
|
+
}>;
|
|
102
|
+
/** Fraction of the asset left with the default look. */
|
|
103
|
+
baseShare: number;
|
|
104
|
+
/** True when nothing changed, so no upload and no world.json write happened. */
|
|
105
|
+
unchanged: boolean;
|
|
106
|
+
assetUrl?: string;
|
|
107
|
+
instanceCount: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Apply an assignment — or strip every class with `--clear` — and record the
|
|
111
|
+
* result in world.json.
|
|
112
|
+
*
|
|
113
|
+
* The engine hands back BYTES rather than uploading, the same split
|
|
114
|
+
* `REVOXELIZE_FROM_VXL_MASTER` uses: in a pro project the CLI owns world.json,
|
|
115
|
+
* and two writers on one asset thrash the reload watcher.
|
|
116
|
+
*/
|
|
117
|
+
export declare function setAssetMaterials(options: SetMaterialsOptions | ClearMaterialsOptions): Promise<SetMaterialsResult>;
|
|
118
|
+
/** What api-server answers `POST /api/cli/v1/assets/materials/classify` with. */
|
|
119
|
+
export interface ClassifyReply {
|
|
120
|
+
signatureHash?: unknown;
|
|
121
|
+
verdicts?: unknown;
|
|
122
|
+
model?: unknown;
|
|
123
|
+
}
|
|
124
|
+
/** The model step, injectable so the lane is testable without api-server. */
|
|
125
|
+
export type ClassifyMaterials = (request: {
|
|
126
|
+
gameId: string;
|
|
127
|
+
assetName: string;
|
|
128
|
+
table: string;
|
|
129
|
+
signatureHash: string;
|
|
130
|
+
promptText?: string;
|
|
131
|
+
}) => Promise<ClassifyReply>;
|
|
132
|
+
export interface ClassifyMaterialsOptions extends MaterialsBaseOptions {
|
|
133
|
+
/** Test seam; the default posts to api-server. */
|
|
134
|
+
classify?: ClassifyMaterials;
|
|
135
|
+
}
|
|
136
|
+
export interface ClassifyMaterialsResult extends SetMaterialsResult {
|
|
137
|
+
/** The model that answered, for provenance. Absent when no verdicts came back. */
|
|
138
|
+
model?: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Read, classify and apply in ONE browser session: what `generate prop|model` run
|
|
142
|
+
* on the asset they just baked, and what `assets materials --auto` runs on demand.
|
|
143
|
+
*
|
|
144
|
+
* The middle step is api-server's light model rather than the creator's coding
|
|
145
|
+
* agent — the same prompt that agent would be shown, answered without a round
|
|
146
|
+
* trip through it, so a generated sword shines before anyone has looked at it.
|
|
147
|
+
* `assets materials --set` still overrides whatever this decided.
|
|
148
|
+
*
|
|
149
|
+
* An empty verdict list skips the APPLY entirely: the engine would leave the
|
|
150
|
+
* file byte-identical anyway, and not asking is one fewer thing to time out.
|
|
151
|
+
*/
|
|
152
|
+
export declare function classifyAssetMaterials(options: ClassifyMaterialsOptions): Promise<ClassifyMaterialsResult>;
|
|
153
|
+
/**
|
|
154
|
+
* The tail of `generate prop|model` and `assets revoxelize`: classify the asset
|
|
155
|
+
* just baked, and say what happened.
|
|
156
|
+
*
|
|
157
|
+
* **Never throws.** The asset is baked, uploaded and in world.json by the time
|
|
158
|
+
* this runs, and a generation is paid for; a classification that fails —
|
|
159
|
+
* api-server without a model credential, a browser that would not come up a
|
|
160
|
+
* second time, a vendored engine too old to write classes — costs a note, never
|
|
161
|
+
* the asset. `bitmagic assets materials <id> --auto` re-runs it on demand.
|
|
162
|
+
*/
|
|
163
|
+
export declare function classifyAssetMaterialsQuietly(options: ClassifyMaterialsOptions): Promise<{
|
|
164
|
+
slots: string[];
|
|
165
|
+
} | null>;
|