@bitmagic/cli 0.1.65-dev.16 → 0.1.65-dev.17
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 +87 -39
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/character.d.ts +18 -0
- package/dist/commands/character.js +268 -0
- package/dist/commands/character.js.map +1 -0
- package/dist/commands/generate.d.ts +31 -15
- package/dist/commands/generate.js +46 -63
- package/dist/commands/generate.js.map +1 -1
- package/dist/generate/character-body.d.ts +79 -0
- package/dist/generate/character-body.js +100 -0
- package/dist/generate/character-body.js.map +1 -0
- package/dist/mobile/asset-hosts.d.ts +7 -9
- package/dist/mobile/asset-hosts.js +7 -16
- package/dist/mobile/asset-hosts.js.map +1 -1
- package/dist/project/character-search.d.ts +30 -0
- package/dist/project/character-search.js +82 -0
- package/dist/project/character-search.js.map +1 -0
- package/dist/scaffold/blender-level-skill-files.js +3 -2
- package/dist/scaffold/blender-level-skill-files.js.map +1 -1
- package/dist/scaffold/project-files.js +3 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -202,7 +202,8 @@ browser reloads itself on every change and the assets panel shows each generatio
|
|
|
202
202
|
| `bitmagic publish [--visibility public\|private] [--name <name>] [--description <desc>] [--force] [--single-file] [--version-url] [--no-qr]` | Verify-gate, build if needed, and upload straight to GCS. `--single-file` publishes the offline bundle described under `bitmagic build`; switching the flag between runs always rebuilds, since it changes nothing on disk for the reuse check to notice. **Keeps the game's current visibility**; a new game is private until published with `--visibility public`. Prints the link worth sharing: `bitmagic.ai/play/<ID>/` — the game's page, with its name, cover and comments — for a public game, and `bitmagic.ai/games/<ID>/` for a private one. Both always serve the newest publish, so a link handed out today keeps working after tomorrow's publish; `--version-url` also prints the URL of this one build (`.../indexN.html`), for pinning a bug report to it. Shows the shared URL as a QR code so you can scan it onto a phone — drawn in the terminal, or written to `.bitmagic/publish-qr.png` when it cannot be. `--no-qr` skips both. |
|
|
203
203
|
| `bitmagic self-update [--tag latest\|dev]` | Update the **CLI itself** to the newest build of its line, installing into the place this CLI actually lives rather than wherever the `npm` on your `PATH` would put it — which under nvm is routinely somewhere else. Reads the project's line from `bitmagic.json` when there is one, so it also fixes a wrong-line install; `--tag` overrides. Verifies the version on disk moved, and refuses (naming the path) for an `npx` run, a source checkout, or an install shape it cannot recognise. Not to be confused with `upgrade`, which is about the project's engine. |
|
|
204
204
|
| `bitmagic upgrade [--engine <version>] [--force]` | Refresh vendored platform files and the CLI's own skills to the currently published engine. Refuses a dirty git tree unless `--force`. Also records the project's `environment` in `bitmagic.json` if it has none yet — the engine it just vendored came from that api-server — and says so when it does. |
|
|
205
|
-
| `bitmagic generate <skybox\|background\|block-type\|sound\|music\|image\|video\|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; a low-poly project keeps the mesh as a `glb` asset — see **Art style**), `vehicle` adds a new drivable one, `animation` takes a parameter spec rather than a prompt, `block-type` registers a custom voxel block, `video` makes a short clip for a cutscene (played with `engine.playVideo("<id>")`) — see **Cutscene clips** below. `skybox` and `background` write the **same** field: pick one.
|
|
205
|
+
| `bitmagic generate <skybox\|background\|block-type\|sound\|music\|image\|video\|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; a low-poly project keeps the mesh as a `glb` asset — see **Art style**), `vehicle` adds a new drivable one, `animation` takes a parameter spec rather than a prompt, `block-type` registers a custom voxel block, `video` makes a short clip for a cutscene (played with `engine.playVideo("<id>")`) — see **Cutscene clips** below. `skybox` and `background` write the **same** field: pick one. **`character` now lives in its own group** — `bitmagic character generate|search|add` — and `bitmagic generate character` is a deprecated alias of the first; see **Characters**. |
|
|
206
|
+
| `bitmagic character <generate\|search\|add> ...` | Forge a character, look through the ready-made ones, or add one. `generate` costs sparks and may substitute a close-enough stored body (`--fresh` always forges). `search` lists the shelf's closest matches with their scores — free, changes nothing. `add` puts a stored body in the game for free and never forges. See **Characters** below. |
|
|
206
207
|
| `bitmagic assets add <file> [--name <n>] [--asset-id <id>] [--keep-glb\|--voxelize] [--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` — or unless the project is low-poly (see **Art style**). Free — no sparks. See **Adding your own assets** below. |
|
|
207
208
|
| `bitmagic assets list` | The assets in `world.json`: id, name, type, size, placed instances, and total references. Local, no network. |
|
|
208
209
|
| `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. |
|
|
@@ -1314,48 +1315,95 @@ read by everything that used to assume cubes:
|
|
|
1314
1315
|
| `bitmagic cover`, `bitmagic reference make` | MagicaVoxel-style prompt lead and tail | flat-shaded low-poly lead and tail (same image model) |
|
|
1315
1316
|
| `bitmagic assets add x.glb` | voxelized in a headless browser | kept as a `glb` asset; `--voxelize` bakes it |
|
|
1316
1317
|
| `bitmagic generate model` / `prop` | voxel master, baked in the browser | mesh generated, re-uploaded into the project, registered as `glb` (`--height` / the placeholder's fitBox); `--voxelize` bakes it |
|
|
1317
|
-
| `bitmagic generate
|
|
1318
|
+
| `bitmagic character generate` | voxelized rig, library search first | the textured low-poly rig; its own library shelf, searched only where the server has enabled it; `--voxelize` overrides |
|
|
1319
|
+
| `bitmagic character search` / `add` | searches the voxel shelf | searches the low-poly shelf |
|
|
1318
1320
|
| `bitmagic generate vehicle` | voxel | still voxel — the builder is voxel-native; the command says so |
|
|
1319
1321
|
| `bitmagic judge` with no `## Art direction` | grades the style it sees | judges within low-poly |
|
|
1320
1322
|
| the engine on load | sunset hemisphere light and a faint bloom | neither; a `MeshLevel` brings its own lighting |
|
|
1321
1323
|
|
|
1322
|
-
###
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1324
|
+
### Characters
|
|
1325
|
+
|
|
1326
|
+
Characters are their own command group, because two different requests used to
|
|
1327
|
+
share one command:
|
|
1328
|
+
|
|
1329
|
+
```
|
|
1330
|
+
bitmagic character generate --name guard --prompt "..." [--fresh]
|
|
1331
|
+
bitmagic character search --prompt "..." [--limit 5] [--representation voxel|lowpoly]
|
|
1332
|
+
bitmagic character add --name guard (--id <sid> | --prompt "...")
|
|
1333
|
+
```
|
|
1334
|
+
|
|
1335
|
+
- **`generate`** forges a new body and costs sparks. It still consults the
|
|
1336
|
+
library first and substitutes a close-enough stored one where the server has
|
|
1337
|
+
that enabled — that is a cache hit on a generation you asked for, and it is
|
|
1338
|
+
what makes a character sometimes arrive in two seconds. `--fresh` turns it off
|
|
1339
|
+
and always forges. (`--no-library` is the deprecated spelling of `--fresh`.)
|
|
1340
|
+
- **`search`** lists the closest ready-made bodies with their scores. Free,
|
|
1341
|
+
read-only, and it writes nothing to your game.
|
|
1342
|
+
- **`add`** puts a stored body in the game. Free, instant, and it **never
|
|
1343
|
+
forges**: if the shelf has nothing usable the command fails and charges
|
|
1344
|
+
nothing, rather than quietly falling back to a paid generation.
|
|
1345
|
+
|
|
1346
|
+
`bitmagic generate character` still works and is a deprecated alias of
|
|
1347
|
+
`bitmagic character generate`; `--library-only` on it is now
|
|
1348
|
+
`bitmagic character add`.
|
|
1349
|
+
|
|
1350
|
+
#### Why `search` exists
|
|
1351
|
+
|
|
1352
|
+
Search is not a nicety here, it is the mechanism. Scored against the live index,
|
|
1353
|
+
genuine matches land at 0.62–0.83 — and humanoid prompts the shelf *cannot*
|
|
1354
|
+
answer land at 0.55–0.70, inside that range. "A beekeeper" fetches a humanoid bee
|
|
1355
|
+
at 0.65; "a hazmat worker" a boy mechanic at 0.65. Both are confident, both are
|
|
1356
|
+
wrong, and no threshold rejects them without also rejecting real matches. A
|
|
1357
|
+
number cannot tell these apart. You can, in about a second:
|
|
1358
|
+
|
|
1359
|
+
```
|
|
1360
|
+
$ bitmagic character search --prompt "a deep sea diver"
|
|
1361
|
+
3 ready-made voxel character(s) for "a deep sea diver":
|
|
1362
|
+
|
|
1363
|
+
# id match auto description
|
|
1364
|
+
1 b1877 57% yes a bearded pirate captain
|
|
1365
|
+
2 b0412 54% - a man in a rubber raincoat
|
|
1366
|
+
3 b2003 52% - an astronaut in a white suit
|
|
1367
|
+
|
|
1368
|
+
Add one: bitmagic character add --id b1877 --name <name>
|
|
1369
|
+
```
|
|
1370
|
+
|
|
1371
|
+
The **auto** column is the bar automatic substitution has to clear (55% on the
|
|
1372
|
+
voxel shelf, 65% on the thinner low-poly one). It is shown rather than applied:
|
|
1373
|
+
a body below it is often still the one you want, and knowing it is a stretch is
|
|
1374
|
+
the useful part.
|
|
1375
|
+
|
|
1376
|
+
`add --id` reads the candidates the last `search` cached in
|
|
1377
|
+
`.bitmagic/character-search.json`, so it needs only the id — no re-search, and no
|
|
1378
|
+
retyping the prompt. `add --prompt` with no id takes the closest usable body
|
|
1379
|
+
whatever it scored, which is the "any of these will do" request.
|
|
1380
|
+
|
|
1381
|
+
Neither `--head-scale` nor `--mesh-model` exists on `add`, and that is the point
|
|
1382
|
+
of the split: proportions are baked into a stored body and a mesh model selects
|
|
1383
|
+
how a character would be *forged*. The old `--library-only` had to accept the
|
|
1384
|
+
first and refuse the second; a command that never forges simply does not offer
|
|
1385
|
+
them.
|
|
1386
|
+
|
|
1387
|
+
The shelf follows the project's art style like every other character request: a
|
|
1388
|
+
voxel game searches voxel bodies, a low-poly game searches low-poly ones, and an
|
|
1389
|
+
empty result never falls back to the other medium. `--representation` overrides
|
|
1390
|
+
it if you want to look at the other shelf.
|
|
1391
|
+
|
|
1392
|
+
#### Low-poly characters cost more to forge
|
|
1393
|
+
|
|
1394
|
+
In a low-poly game the textured rig IS the product, so `bitmagic character generate`
|
|
1395
|
+
forges it with `runware-rodin-gen-2`: a quad remesh at a triangle count we choose,
|
|
1396
|
+
with the concept sheet's own A-pose kept. **That bills 60 sparks and takes about
|
|
1397
|
+
three minutes per character**, against 15 sparks and forty seconds for a voxel
|
|
1398
|
+
body — pass `--mesh-model unified-trellis` to put one back on the cheap lane at
|
|
1399
|
+
15 sparks. A voxel game does not get it: the body is rebuilt out of cubes, so the
|
|
1400
|
+
remesh and the texture are thrown away.
|
|
1401
|
+
|
|
1402
|
+
Wall time is why the forge job budget is 20 minutes and api-server's in-handler
|
|
1403
|
+
generation deadline is 29: at the old 8-minute and 280 s ceilings a slow mesh
|
|
1404
|
+
model was killed about three seconds before it finished, after being billed.
|
|
1405
|
+
Cloud Run's own 1800 s request timeout was already high enough and is set in
|
|
1406
|
+
roleverse-infra.
|
|
1359
1407
|
|
|
1360
1408
|
Both commands print `Art style: … (game.json)` so a transcript shows which medium drove them, and a
|
|
1361
1409
|
value that is neither word is reported once and treated as voxel. The web Creator does not read
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -22,6 +22,7 @@ import { reloadCommand } from './commands/reload.js';
|
|
|
22
22
|
import { verifyCommand } from './commands/verify.js';
|
|
23
23
|
import { buildCommand } from './commands/build.js';
|
|
24
24
|
import { generateCommand } from './commands/generate.js';
|
|
25
|
+
import { characterCommand } from './commands/character.js';
|
|
25
26
|
import { assetsCommand } from './commands/assets.js';
|
|
26
27
|
import { levelsCommand } from './commands/levels.js';
|
|
27
28
|
import { themeCommand } from './commands/theme.js';
|
|
@@ -214,6 +215,7 @@ const rawCommands = {
|
|
|
214
215
|
verify: verifyCommand,
|
|
215
216
|
build: buildCommand,
|
|
216
217
|
generate: generateCommand,
|
|
218
|
+
character: characterCommand,
|
|
217
219
|
assets: assetsCommand,
|
|
218
220
|
levels: levelsCommand,
|
|
219
221
|
theme: themeCommand,
|
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,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAA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,CAAC,CAAC;IAE1B,SAAS,CAAC;QACR,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAEtE,MAAM,KAAK,GAAG,eAAe,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAY,CAAC,CAAC;QAC1E,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QAE9B,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAW,CAAC;QACxC,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9B,OAAO,CACL,oBAAoB,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI;gBAC3E,cAAc,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;gBACjD,qBAAqB,MAAM,IAAI,IAAI,2CAA2C;gBAC9E,4DAA4D,CAC7D,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,KAAK,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type CharacterSearchRecord } from '../project/character-search.js';
|
|
2
|
+
import { type CharacterArgs } from '../generate/character-body.js';
|
|
3
|
+
/**
|
|
4
|
+
* What `bitmagic character add` will ask for, from its flags and the cached search.
|
|
5
|
+
*
|
|
6
|
+
* Pure, and separated from the command so the branch that matters — which of the
|
|
7
|
+
* two forms was asked for, and whether the cache can answer it — is testable
|
|
8
|
+
* without a project, a token or a network. It returns the character args rather
|
|
9
|
+
* than a body so the shared `buildCharacterBody` still owns the wire shape.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveAddRequest(args: {
|
|
12
|
+
name: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
prompt?: string;
|
|
15
|
+
applyToPlayer?: boolean;
|
|
16
|
+
record: CharacterSearchRecord | null;
|
|
17
|
+
}): CharacterArgs;
|
|
18
|
+
export declare const characterCommand: import("citty").CommandDef<import("citty").ArgsDef>;
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `bitmagic character` — make one, look through the ready-made ones, or add one.
|
|
3
|
+
*
|
|
4
|
+
* Its own noun group rather than three flags on `bitmagic generate character`,
|
|
5
|
+
* because the shelf and the forge are two different requests that happened to
|
|
6
|
+
* share a command:
|
|
7
|
+
*
|
|
8
|
+
* generate costs sparks, makes a new body, may substitute a close stored one
|
|
9
|
+
* search free, read-only, shows what the shelf has and how close it is
|
|
10
|
+
* add free, puts a stored body in the game, never forges
|
|
11
|
+
*
|
|
12
|
+
* The old surface expressed "add" as `generate character --library-only`, a
|
|
13
|
+
* command that generates nothing, and it carried two flags that existed only to
|
|
14
|
+
* be refused on that path (`--head-scale` was accepted, reported and dropped;
|
|
15
|
+
* `--mesh-model` was rejected outright). Both refusals disappear here, because a
|
|
16
|
+
* command that never forges simply does not offer the flags that pick how a
|
|
17
|
+
* forge runs.
|
|
18
|
+
*
|
|
19
|
+
* `search` exists because no similarity floor can do this job. Measured against
|
|
20
|
+
* the live index, genuine matches score 0.624-0.831 while humanoid prompts the
|
|
21
|
+
* shelf cannot answer score 0.552-0.698 — overlapping, so a threshold that keeps
|
|
22
|
+
* the good ones keeps "a humanoid bee" for "a beekeeper" too. A person reading
|
|
23
|
+
* three captions settles in a second what a number cannot settle at all.
|
|
24
|
+
*/
|
|
25
|
+
import { defineCommand } from 'citty';
|
|
26
|
+
import { CliError } from '../errors.js';
|
|
27
|
+
import { createOutput } from '../output.js';
|
|
28
|
+
import { apiGet } from '../http/client.js';
|
|
29
|
+
import { resolveArtStyle } from '../project/art-style.js';
|
|
30
|
+
import { findCachedCandidate, readCharacterSearch, writeCharacterSearch, } from '../project/character-search.js';
|
|
31
|
+
import { ORIGINAL_PROMPT_FLAG, withParent } from '../telemetry/creator-prompt.js';
|
|
32
|
+
import { JSON_FLAG, resolveRun, runAssetGeneration } from './generate.js';
|
|
33
|
+
import { APPLY_TO_PLAYER_ARG, buildCharacterBody, defaultVoxelizeForProject, FRESH_ARG, HEAD_SCALE_ARG, LIBRARY_ARG, MESH_MODEL_ARG, NAME_ARG, PROMPT_ARG, VOXELIZE_ARG, } from '../generate/character-body.js';
|
|
34
|
+
const generateCommand = defineCommand({
|
|
35
|
+
meta: {
|
|
36
|
+
name: 'generate',
|
|
37
|
+
description: 'Forge a new rigged character and add it to world.json assets. Costs sparks.',
|
|
38
|
+
},
|
|
39
|
+
args: {
|
|
40
|
+
name: NAME_ARG,
|
|
41
|
+
prompt: PROMPT_ARG,
|
|
42
|
+
'apply-to-player': APPLY_TO_PLAYER_ARG,
|
|
43
|
+
'head-scale': HEAD_SCALE_ARG,
|
|
44
|
+
fresh: FRESH_ARG,
|
|
45
|
+
library: LIBRARY_ARG,
|
|
46
|
+
voxelize: VOXELIZE_ARG,
|
|
47
|
+
'mesh-model': MESH_MODEL_ARG,
|
|
48
|
+
'original-prompt': ORIGINAL_PROMPT_FLAG,
|
|
49
|
+
json: JSON_FLAG,
|
|
50
|
+
},
|
|
51
|
+
async run({ args }) {
|
|
52
|
+
const body = buildCharacterBody({
|
|
53
|
+
name: args.name,
|
|
54
|
+
prompt: args.prompt,
|
|
55
|
+
applyToPlayer: args['apply-to-player'],
|
|
56
|
+
headScale: args['head-scale'],
|
|
57
|
+
fresh: args.fresh,
|
|
58
|
+
library: args.library,
|
|
59
|
+
voxelize: args.voxelize ?? defaultVoxelizeForProject(),
|
|
60
|
+
meshModel: args['mesh-model'],
|
|
61
|
+
});
|
|
62
|
+
await runAssetGeneration('character', 'character', withParent(body), args.json === true);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
/** `62%` — the only form a similarity is ever shown in, so the table lines up. */
|
|
66
|
+
function percent(value) {
|
|
67
|
+
return `${Math.round(value * 100)}%`;
|
|
68
|
+
}
|
|
69
|
+
function renderCandidates(candidates, threshold, log) {
|
|
70
|
+
const width = Math.max(2, ...candidates.map((row) => row.sid.length));
|
|
71
|
+
log('');
|
|
72
|
+
log(` # ${'id'.padEnd(width)} match auto description`);
|
|
73
|
+
candidates.forEach((row, index) => {
|
|
74
|
+
// The "auto" column is why the floor is reported rather than applied: it
|
|
75
|
+
// says which of these automatic substitution would have taken, so a creator
|
|
76
|
+
// can see both that a body cleared the bar and that a weaker one exists.
|
|
77
|
+
const auto = row.similarity >= threshold ? ' yes' : ' -';
|
|
78
|
+
const label = row.subject ?? row.description ?? '';
|
|
79
|
+
log(` ${String(index + 1).padStart(1)} ${row.sid.padEnd(width)} ${percent(row.similarity).padStart(5)} ${auto} ${label.slice(0, 60)}`);
|
|
80
|
+
});
|
|
81
|
+
log('');
|
|
82
|
+
}
|
|
83
|
+
const searchCommand = defineCommand({
|
|
84
|
+
meta: {
|
|
85
|
+
name: 'search',
|
|
86
|
+
description: 'List the ready-made characters closest to a description. Free; changes nothing.',
|
|
87
|
+
},
|
|
88
|
+
args: {
|
|
89
|
+
prompt: {
|
|
90
|
+
type: 'string',
|
|
91
|
+
required: true,
|
|
92
|
+
description: 'What the character should look like.',
|
|
93
|
+
},
|
|
94
|
+
limit: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
description: 'How many candidates to list, 1-16. Default 5.',
|
|
97
|
+
},
|
|
98
|
+
representation: {
|
|
99
|
+
type: 'string',
|
|
100
|
+
description: "Which shelf to search: 'voxel' or 'lowpoly'. Omit to follow the project's art style.",
|
|
101
|
+
},
|
|
102
|
+
json: JSON_FLAG,
|
|
103
|
+
},
|
|
104
|
+
async run({ args }) {
|
|
105
|
+
const json = args.json === true;
|
|
106
|
+
const { output, runDeps, context, environment, token } = await resolveRun(json);
|
|
107
|
+
const representation = (() => {
|
|
108
|
+
const asked = args.representation;
|
|
109
|
+
// `resolveArtStyle` also reports a game.json value that is neither word,
|
|
110
|
+
// which is the same note every other art-style-aware command prints.
|
|
111
|
+
if (asked === undefined)
|
|
112
|
+
return resolveArtStyle(context.root, output.info) === 'low-poly' ? 'lowpoly' : 'voxel';
|
|
113
|
+
if (asked !== 'voxel' && asked !== 'lowpoly') {
|
|
114
|
+
throw new CliError("--representation must be 'voxel' or 'lowpoly'.", 1, 'invalid_flag');
|
|
115
|
+
}
|
|
116
|
+
return asked;
|
|
117
|
+
})();
|
|
118
|
+
const query = new URLSearchParams({
|
|
119
|
+
gameId: context.metadata.gameId,
|
|
120
|
+
prompt: args.prompt,
|
|
121
|
+
representation,
|
|
122
|
+
});
|
|
123
|
+
if (args.limit !== undefined)
|
|
124
|
+
query.set('limit', args.limit);
|
|
125
|
+
const response = await apiGet(environment, `/api/cli/v1/characters/search?${query.toString()}`, token, runDeps);
|
|
126
|
+
// Written even when empty: "the shelf has nothing like this" is a result a
|
|
127
|
+
// re-run should not have to rediscover, and an empty cache makes `add --id`
|
|
128
|
+
// say "search first" rather than "no such id".
|
|
129
|
+
writeCharacterSearch(context.root, {
|
|
130
|
+
prompt: response.prompt,
|
|
131
|
+
representation,
|
|
132
|
+
threshold: response.threshold,
|
|
133
|
+
searchedAt: new Date().toISOString(),
|
|
134
|
+
candidates: response.candidates,
|
|
135
|
+
});
|
|
136
|
+
if (response.candidates.length === 0) {
|
|
137
|
+
const nearest = response.topSimilarity !== undefined
|
|
138
|
+
? ` The closest was ${percent(response.topSimilarity)}, which had no usable file.`
|
|
139
|
+
: '';
|
|
140
|
+
output.info(`No ready-made ${representation} character matches "${response.prompt}".${nearest}`);
|
|
141
|
+
output.info(`Forge one instead: bitmagic character generate --name <name> --prompt "${response.prompt}"`);
|
|
142
|
+
output.result({ ok: true, kind: 'character search', representation, threshold: response.threshold, candidates: [], ...(response.reason ? { reason: response.reason } : {}) });
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
output.info(`${response.candidates.length} ready-made ${representation} character(s) for "${response.prompt}":`);
|
|
146
|
+
renderCandidates(response.candidates, response.threshold, output.info);
|
|
147
|
+
const best = response.candidates[0];
|
|
148
|
+
if (best.similarity < response.threshold) {
|
|
149
|
+
// Said plainly rather than hidden: on this corpus a confident-looking
|
|
150
|
+
// caption can still be the wrong character, and the creator is the only
|
|
151
|
+
// one who can tell.
|
|
152
|
+
output.info(`None clears the ${percent(response.threshold)} bar automatic substitution requires — read the captions before adding one.`);
|
|
153
|
+
}
|
|
154
|
+
output.info(`Add one: bitmagic character add --id ${best.sid} --name <name>`);
|
|
155
|
+
output.result({
|
|
156
|
+
ok: true,
|
|
157
|
+
kind: 'character search',
|
|
158
|
+
representation,
|
|
159
|
+
threshold: response.threshold,
|
|
160
|
+
candidates: response.candidates,
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
/**
|
|
165
|
+
* What `bitmagic character add` will ask for, from its flags and the cached search.
|
|
166
|
+
*
|
|
167
|
+
* Pure, and separated from the command so the branch that matters — which of the
|
|
168
|
+
* two forms was asked for, and whether the cache can answer it — is testable
|
|
169
|
+
* without a project, a token or a network. It returns the character args rather
|
|
170
|
+
* than a body so the shared `buildCharacterBody` still owns the wire shape.
|
|
171
|
+
*/
|
|
172
|
+
export function resolveAddRequest(args) {
|
|
173
|
+
if (args.id === undefined) {
|
|
174
|
+
if (args.prompt === undefined) {
|
|
175
|
+
throw new CliError('Pass --id (from `bitmagic character search`) or --prompt to take the closest match.', 1, 'invalid_flag');
|
|
176
|
+
}
|
|
177
|
+
// The no-id form: the server searches with no floor and adds the best usable
|
|
178
|
+
// body, or fails without charging. Deliberately still available — "any of
|
|
179
|
+
// these will do" is a real request, and it is one call rather than two.
|
|
180
|
+
return {
|
|
181
|
+
name: args.name,
|
|
182
|
+
prompt: args.prompt,
|
|
183
|
+
applyToPlayer: args.applyToPlayer,
|
|
184
|
+
libraryOnly: true,
|
|
185
|
+
voxelize: defaultVoxelizeForProject(),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
if (args.record === null) {
|
|
189
|
+
throw new CliError('No character search to pick from. Run `bitmagic character search --prompt "..."` first.', 1, 'no_search');
|
|
190
|
+
}
|
|
191
|
+
const candidate = findCachedCandidate(args.record, args.id);
|
|
192
|
+
if (candidate === null) {
|
|
193
|
+
const known = args.record.candidates.map((row) => row.sid).join(', ');
|
|
194
|
+
throw new CliError(`"${args.id}" was not in the last character search`
|
|
195
|
+
+ (known === '' ? ' (it found nothing).' : `. It offered: ${known}.`)
|
|
196
|
+
+ ' Run `bitmagic character search` again to pick from a fresh list.', 1, 'unknown_candidate');
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
name: args.name,
|
|
200
|
+
// The CREATOR's brief, not the library row's own caption: this is what a
|
|
201
|
+
// regeneration re-drives, so it must describe what they asked for.
|
|
202
|
+
prompt: args.prompt ?? args.record.prompt,
|
|
203
|
+
applyToPlayer: args.applyToPlayer,
|
|
204
|
+
libraryPick: {
|
|
205
|
+
sid: candidate.sid,
|
|
206
|
+
assetUrl: candidate.assetUrl,
|
|
207
|
+
similarity: candidate.similarity,
|
|
208
|
+
...(candidate.description ? { description: candidate.description } : {}),
|
|
209
|
+
},
|
|
210
|
+
// The shelf that produced the row decides the medium, not the project's art
|
|
211
|
+
// style at the moment of adding: mixing them would hand a low-poly game a
|
|
212
|
+
// pile of cubes.
|
|
213
|
+
voxelize: args.record.representation === 'voxel',
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
const addCommand = defineCommand({
|
|
217
|
+
meta: {
|
|
218
|
+
name: 'add',
|
|
219
|
+
description: 'Add a ready-made character from the library to world.json assets. Free; never forges.',
|
|
220
|
+
},
|
|
221
|
+
args: {
|
|
222
|
+
name: NAME_ARG,
|
|
223
|
+
id: {
|
|
224
|
+
type: 'string',
|
|
225
|
+
description: 'The id of a candidate from `bitmagic character search`. Omit to take the closest match to --prompt.',
|
|
226
|
+
},
|
|
227
|
+
prompt: {
|
|
228
|
+
type: 'string',
|
|
229
|
+
description: 'What the character should look like. Required without --id; with --id it defaults to the search that found it.',
|
|
230
|
+
},
|
|
231
|
+
'apply-to-player': APPLY_TO_PLAYER_ARG,
|
|
232
|
+
'original-prompt': ORIGINAL_PROMPT_FLAG,
|
|
233
|
+
json: JSON_FLAG,
|
|
234
|
+
},
|
|
235
|
+
async run({ args }) {
|
|
236
|
+
const json = args.json === true;
|
|
237
|
+
const { context } = await resolveRun(json);
|
|
238
|
+
const output = createOutput(json);
|
|
239
|
+
// Only the --id form consults the cache; the --prompt form is a fresh ask.
|
|
240
|
+
const record = args.id === undefined ? null : readCharacterSearch(context.root);
|
|
241
|
+
const request = resolveAddRequest({
|
|
242
|
+
name: args.name,
|
|
243
|
+
id: args.id,
|
|
244
|
+
prompt: args.prompt,
|
|
245
|
+
applyToPlayer: args['apply-to-player'],
|
|
246
|
+
record,
|
|
247
|
+
});
|
|
248
|
+
if (request.libraryPick) {
|
|
249
|
+
// The search's own date, not an expiry: age is worth seeing, and the
|
|
250
|
+
// catalogue only changes when somebody promotes to it.
|
|
251
|
+
output.info(`Adding ${request.libraryPick.sid} (${percent(request.libraryPick.similarity)} match`
|
|
252
|
+
+ `${record?.searchedAt ? `, from the search on ${record.searchedAt.slice(0, 10)}` : ''}).`);
|
|
253
|
+
}
|
|
254
|
+
await runAssetGeneration('character', 'character', withParent(buildCharacterBody(request)), json);
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
export const characterCommand = defineCommand({
|
|
258
|
+
meta: {
|
|
259
|
+
name: 'character',
|
|
260
|
+
description: 'Forge a character, search the ready-made ones, or add one to your game.',
|
|
261
|
+
},
|
|
262
|
+
subCommands: {
|
|
263
|
+
generate: generateCommand,
|
|
264
|
+
search: searchCommand,
|
|
265
|
+
add: addCommand,
|
|
266
|
+
},
|
|
267
|
+
});
|
|
268
|
+
//# sourceMappingURL=character.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"character.js","sourceRoot":"","sources":["../../src/commands/character.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,GAGrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,EAEzB,SAAS,EACT,cAAc,EACd,WAAW,EACX,cAAc,EACd,QAAQ,EACR,UAAU,EACV,YAAY,GACb,MAAM,+BAA+B,CAAC;AAcvC,MAAM,eAAe,GAAG,aAAa,CAAC;IACpC,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,6EAA6E;KAC3F;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,UAAU;QAClB,iBAAiB,EAAE,mBAAmB;QACtC,YAAY,EAAE,cAAc;QAC5B,KAAK,EAAE,SAAS;QAChB,OAAO,EAAE,WAAW;QACpB,QAAQ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MAAM,EAAE,aAAa;QACrB,GAAG,EAAE,UAAU;KAChB;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type CommandRunDeps } from './run-deps.js';
|
|
2
|
+
import { type ProjectContext } from '../project/context.js';
|
|
2
3
|
import { type GenerationOutcome } from '../generate/stream.js';
|
|
3
4
|
import { type PropVoxelizeResult } from '../generate/prop.js';
|
|
4
5
|
import { type VehicleInstallResult } from '../generate/vehicle.js';
|
|
5
6
|
import { type GenerateModelResult } from '../generate/model.js';
|
|
6
7
|
import { type AnimationFromVideoRun } from '../generate/animation-from-video.js';
|
|
7
8
|
import { type VideoRun } from '../generate/video.js';
|
|
9
|
+
import type { Environment } from '../config/environments.js';
|
|
8
10
|
import type { VoxelizeGlb } from '../assets/voxelize-glb.js';
|
|
9
11
|
import type { KeepGlb } from '../assets/keep-glb.js';
|
|
10
12
|
export interface SkyboxArgs {
|
|
@@ -55,21 +57,7 @@ export interface ImageArgs {
|
|
|
55
57
|
referenceImageUrl?: string;
|
|
56
58
|
}
|
|
57
59
|
export declare function buildImageBody(args: ImageArgs): Record<string, unknown>;
|
|
58
|
-
export
|
|
59
|
-
name: string;
|
|
60
|
-
prompt: string;
|
|
61
|
-
applyToPlayer?: boolean;
|
|
62
|
-
headScale?: string;
|
|
63
|
-
/** citty's negative boolean: `--no-library` arrives as `false`; the flag has no positive form. */
|
|
64
|
-
library?: boolean;
|
|
65
|
-
/** `--library-only`: take the closest stored body, never forge, never charge. */
|
|
66
|
-
libraryOnly?: boolean;
|
|
67
|
-
/** Absent = the generator's default (true); the command fills it from the project's art style. */
|
|
68
|
-
voxelize?: boolean;
|
|
69
|
-
/** Asset Forger image-to-mesh model; absent = the Forger default. */
|
|
70
|
-
meshModel?: string;
|
|
71
|
-
}
|
|
72
|
-
export declare function buildCharacterBody(args: CharacterArgs): Record<string, unknown>;
|
|
60
|
+
export { buildCharacterBody, type CharacterArgs } from '../generate/character-body.js';
|
|
73
61
|
export interface AnimationArgs {
|
|
74
62
|
/** Asset-record name. Defaults to the spec's own `name` when omitted. */
|
|
75
63
|
description?: string;
|
|
@@ -153,6 +141,21 @@ export interface GenerateRunDeps extends CommandRunDeps {
|
|
|
153
141
|
/** Injected in tests so the kept-mesh lane (`--keep-glb` / low-poly projects) runs without a network. */
|
|
154
142
|
keepGlbUpload?: KeepGlb;
|
|
155
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* What the three browser-baking runners below (prop, vehicle, model) each need before they can
|
|
146
|
+
* start, resolved identically by all of them: where the project is, which api-server it belongs
|
|
147
|
+
* to, and a token to talk to it with.
|
|
148
|
+
*
|
|
149
|
+
* `output` and `runDeps` come back too because both depend on `--json` — see commandRunDeps for
|
|
150
|
+
* why a deps object built before that flag is known routes prose onto stdout.
|
|
151
|
+
*/
|
|
152
|
+
export declare function resolveRun(json: boolean, deps?: GenerateRunDeps): Promise<{
|
|
153
|
+
output: import("../output.js").Output;
|
|
154
|
+
runDeps: GenerateRunDeps;
|
|
155
|
+
context: ProjectContext;
|
|
156
|
+
environment: Environment;
|
|
157
|
+
token: string;
|
|
158
|
+
}>;
|
|
156
159
|
/**
|
|
157
160
|
* Runs one `bitmagic generate <subcommand>`: requests the asset, then applies the returned
|
|
158
161
|
* patches to world.json. Returns the successful outcome, whose `patches` carry the generated
|
|
@@ -320,6 +323,19 @@ export declare function runModelGeneration(options: {
|
|
|
320
323
|
json: boolean;
|
|
321
324
|
deps?: GenerateRunDeps;
|
|
322
325
|
}): Promise<GenerateModelResult>;
|
|
326
|
+
/**
|
|
327
|
+
* The two flags several subcommands share, declared once — the same shape `assets.ts` and
|
|
328
|
+
* `levels.ts` already use for their own `JSON_FLAG`.
|
|
329
|
+
*
|
|
330
|
+
* `--help` is an agent's discovery mechanism, so the wording is part of the interface: restated
|
|
331
|
+
* once per subcommand it drifts, and two subcommands describing the same flag differently read as
|
|
332
|
+
* two different flags. `as const` preserves the literal `type`, which is what citty infers
|
|
333
|
+
* `args.json`'s boolean and `args['reference-image-url']`'s string from.
|
|
334
|
+
*/
|
|
335
|
+
export declare const JSON_FLAG: {
|
|
336
|
+
readonly type: "boolean";
|
|
337
|
+
readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
|
|
338
|
+
};
|
|
323
339
|
/**
|
|
324
340
|
* The `--video` lane of `bitmagic generate animation`. Job-shaped rather than streamed (see
|
|
325
341
|
* generate/animation-from-video.ts), so it cannot share `runAssetGeneration`; it does share the
|