@bitmagic/cli 0.1.18 → 0.1.20

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 CHANGED
@@ -35,11 +35,12 @@ bitmagic publish # verify-gate, build, and ship — private by defa
35
35
  | `bitmagic init [dir] [--template <id>] [--name <name>] [--idea "<pitch>"] [--env <env>] [--force]` | Scaffold a new project: mints a game, downloads the vendored engine, writes `AGENTS.md`, `GAME-DESIGN.md` and templates. `--idea` seeds the design doc's pitch. |
36
36
  | `bitmagic check` | Typecheck (`tsc --noEmit`) against the vendored engine. Fast; does not prove the game runs. |
37
37
  | `bitmagic dev [--port <port>]` | Build, then serve with `tsc --watch` + `vite`, default port 3010. |
38
+ | `bitmagic edit [--port <port>] [--editor-port <port>]` | Everything `dev` does, plus a visual scene editor at `http://localhost:3011/`: click an object, drag the gizmo, and the new transform is written to `src/work/world.json`. See **Editing the scene visually** below. |
38
39
  | `bitmagic verify [--timeout <ms>]` | Build, boot the game in a headless browser, click the engine's Play button like a player would, and report what broke. A game without the button passes as long as gameplay starts by itself (auto-starting genres, custom start UIs); a run where gameplay never starts fails. `--timeout` is settle time in ms measured after gameplay starts, so the screenshot captures gameplay. Writes the artifacts the publish gate reads (see below). |
39
40
  | `bitmagic build` | Bundle the game into one self-contained `.bitmagic/build/index.html`. Rarely needs to be run by hand — `publish` builds automatically when the project changed. |
40
41
  | `bitmagic publish [--visibility public\|private] [--name <name>] [--description <desc>] [--force]` | Verify-gate, build if needed, and upload straight to GCS. **Private unless `--visibility public` is passed.** |
41
42
  | `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`. |
42
- | `bitmagic generate <skybox\|sound\|image\|character\|animation> ...` | Generate one asset directly into `src/work/world.json`. Costs sparks. |
43
+ | `bitmagic generate <skybox\|sound\|image\|character\|animation\|prop> ...` | Generate one asset directly into `src/work/world.json`. Costs sparks. `prop` upgrades an existing placeholder asset in place — see below. |
43
44
  | `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. |
44
45
  | `bitmagic forge --prompt "..." [--city\|--dungeon\|--platformer\|--freeform] [--name <name>] [--resume <jobId>]` | Design and bake a whole playable level into `world.json`. Slow and expensive; supports `--resume`. |
45
46
 
@@ -88,6 +89,62 @@ Re-running on an unchanged design generates nothing and costs nothing — it rep
88
89
  cover. Edit the design and run again, or pass `--force`, to replace it. Because it writes
89
90
  `world.json`, it invalidates a passing verify: run it before `bitmagic verify`, not after.
90
91
 
92
+ ## Editing the scene visually
93
+
94
+ Some things are faster with a mouse. `bitmagic edit` runs everything `bitmagic dev` runs and adds a
95
+ local editor on a second port:
96
+
97
+ ```bash
98
+ bitmagic edit
99
+ # Serving the game at http://localhost:3010/
100
+ # Editor ready at http://localhost:3011/
101
+ ```
102
+
103
+ Open the editor URL in your normal browser. The game loads paused, with a free-flying camera, the
104
+ scene hierarchy and the transform gizmo — the same editor the web Creator uses, which already ships
105
+ inside `engine/`. Click an object to select it, then move, rotate, scale, snap it to the ground,
106
+ edit its numbers in the inspector, delete it, or right-click to add one from the project's assets.
107
+
108
+ **Every change is saved to `src/work/world.json` as you make it.** There is no Save button and no
109
+ unsaved state: your agent reads the same file, and `git diff` is the record of what you moved.
110
+ Saves are surgical — one entry per object touched, nothing else in the file is rewritten.
111
+
112
+ If your agent edits `world.json` while the editor is open, the editor says so and offers a reload
113
+ rather than silently reloading over work in progress.
114
+
115
+ ### What your agent sees
116
+
117
+ Every editor action is appended to `.bitmagic/edit/events.jsonl`, one JSON object per line, and
118
+ printed to the command's own output — so the agent that launched `bitmagic edit` can tell what you
119
+ did without inferring it from a diff:
120
+
121
+ ```
122
+ {"at":"…","event":"object.moved","objectId":"inst_…","position":{"from":{…},"to":{…}}}
123
+ {"at":"…","event":"hq.requested","assetId":"asset_…","prompt":"a mossy stone arch","command":"bitmagic generate prop …"}
124
+ ```
125
+
126
+ Most lines are history. `hq.requested` is a request: it comes from the **Generate high-quality
127
+ version** button on a forged placeholder. Generating a mesh needs Asset Forger credentials that
128
+ never reach your machine, so the editor saves the description you wrote onto the asset and records
129
+ the command for your agent to run:
130
+
131
+ ```bash
132
+ bitmagic generate prop --asset <assetId> --prompt "<what it should be>"
133
+ ```
134
+
135
+ That generates the mesh, voxelizes it to the asset's recorded `fitBox`, and writes it back under
136
+ the same asset id — so every already-placed instance upgrades at once, rather than a second asset
137
+ appearing beside them. It costs sparks. If it fails after the mesh exists, the error carries the
138
+ URL: retry with `--glb-url <url>` and you are not charged again.
139
+
140
+ Both ports must fall between 3000 and 3199. That is the window the asset CDN allows as an origin;
141
+ outside it the game loads with no terrain and no error.
142
+
143
+ What it does **not** do yet: terrain and voxel sculpting. Clicking the ground still opens the
144
+ engine's terrain tools, but saving them needs an asset upload this command does not perform, so the
145
+ editor warns you as soon as you change a voxel and offers to discard it. Use the web Creator for
146
+ terrain work.
147
+
91
148
  ## Publishing
92
149
 
93
150
  `bitmagic publish` is two gated steps in one command:
package/dist/cli.d.ts CHANGED
@@ -95,6 +95,16 @@ declare const rawCommands: {
95
95
  readonly description: "Port to serve on (default 3010).";
96
96
  };
97
97
  }>;
98
+ edit: CommandDef<{
99
+ readonly port: {
100
+ readonly type: "string";
101
+ readonly description: "Port to serve the game on (default 3010).";
102
+ };
103
+ readonly 'editor-port': {
104
+ readonly type: "string";
105
+ readonly description: "Port to serve the editor on (default 3011).";
106
+ };
107
+ }>;
98
108
  verify: CommandDef<{
99
109
  readonly timeout: {
100
110
  readonly type: "string";
package/dist/cli.js CHANGED
@@ -8,6 +8,7 @@ import { initCommand } from './commands/init.js';
8
8
  import { upgradeCommand } from './commands/upgrade.js';
9
9
  import { checkCommand } from './commands/check.js';
10
10
  import { devCommand } from './commands/dev.js';
11
+ import { editCommand } from './commands/edit.js';
11
12
  import { verifyCommand } from './commands/verify.js';
12
13
  import { buildCommand } from './commands/build.js';
13
14
  import { generateCommand } from './commands/generate.js';
@@ -102,6 +103,7 @@ const rawCommands = {
102
103
  upgrade: upgradeCommand,
103
104
  check: checkCommand,
104
105
  dev: devCommand,
106
+ edit: editCommand,
105
107
  verify: verifyCommand,
106
108
  build: buildCommand,
107
109
  generate: generateCommand,
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,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,6FAA6F;AAC7F,2FAA2F;AAC3F,+FAA+F;AAC/F,gGAAgG;AAChG,8FAA8F;AAC9F,4EAA4E;AAE5E,gGAAgG;AAChG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AwB,CAAC,CAAC;AACvE,CAAC;AAED,4FAA4F;AAC5F,+FAA+F;AAC/F,+DAA+D;AAC/D,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,YAAY;IACnB,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,eAAe;IACzB,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,cAAc;CACxB,CAAC;AAIF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAC1C,MAAM,CAAC,OAAO,CAAC,WAAW,CAA+C,CAAC,GAAG,CAC5E,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CACtD,CAC0C,CAAC;AAE9C,iGAAiG;AACjG,8FAA8F;AAC9F,uFAAuF;AACvF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC;IAChC,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,gDAAgD;KAC9D;IACD,WAAW;CACZ,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const editCommand: import("citty").CommandDef<{
2
+ readonly port: {
3
+ readonly type: "string";
4
+ readonly description: "Port to serve the game on (default 3010).";
5
+ };
6
+ readonly 'editor-port': {
7
+ readonly type: "string";
8
+ readonly description: "Port to serve the editor on (default 3011).";
9
+ };
10
+ }>;
@@ -0,0 +1,147 @@
1
+ /**
2
+ * `bitmagic edit` — `dev` plus a visual scene editor.
3
+ *
4
+ * Everything `dev` does (build, `tsc --watch`, vite) plus a loopback sidecar that serves the editor
5
+ * shell and writes scene edits into `src/work/world.json`. Deliberately a superset rather than a
6
+ * flag on `dev`: `dev` is the plain run-the-game loop and must stay offline, minimal and boring,
7
+ * while `edit` opens a second port and a write path into the creator's project.
8
+ */
9
+ import { defineCommand } from 'citty';
10
+ import { spawn, spawnSync } from 'child_process';
11
+ import * as path from 'path';
12
+ import { CliError } from '../errors.js';
13
+ import { loadProjectContext, projectBin } from '../project/context.js';
14
+ import { startEditorServer } from '../editor/server.js';
15
+ import { CORS_ALLOWED_PORT_MAX, CORS_ALLOWED_PORT_MIN } from '../local-port.js';
16
+ import { waitForServer } from '../verify/wait-for-server.js';
17
+ const DEFAULT_GAME_PORT = 3010;
18
+ const DEFAULT_EDITOR_PORT = 3011;
19
+ /**
20
+ * Both ports must sit inside the CDN's CORS window.
21
+ *
22
+ * The game port for the reason `local-port.ts` documents at length: a project fetches its forged
23
+ * level and its GLBs cross-origin from the portal CDN, which allowlists `localhost:3000`-`3199`
24
+ * and nothing else. Outside it the fetch is blocked, the world loads with no terrain, and the
25
+ * symptom reads as a broken game rather than a blocked request.
26
+ *
27
+ * The editor port is checked too, even though the shell itself fetches nothing from the CDN,
28
+ * because the two are adjacent by default and a creator who moves one will move the other — being
29
+ * told the rule once, at the point of the mistake, beats discovering it as a terrain-less world.
30
+ */
31
+ function parsePort(value, fallback, flag) {
32
+ if (value === undefined)
33
+ return fallback;
34
+ const port = Number(value);
35
+ if (!Number.isInteger(port)) {
36
+ throw new CliError(`\`${flag}\` must be a whole number, got "${value}".`);
37
+ }
38
+ if (port < CORS_ALLOWED_PORT_MIN || port > CORS_ALLOWED_PORT_MAX) {
39
+ throw new CliError(`\`${flag}\` must be between ${CORS_ALLOWED_PORT_MIN} and ${CORS_ALLOWED_PORT_MAX}. `
40
+ + 'The asset CDN only allows those origins; outside that window the game loads with no terrain.');
41
+ }
42
+ return port;
43
+ }
44
+ export const editCommand = defineCommand({
45
+ meta: {
46
+ name: 'edit',
47
+ description: 'Serve the game with a visual scene editor, saving edits to world.json.',
48
+ },
49
+ args: {
50
+ port: { type: 'string', description: `Port to serve the game on (default ${DEFAULT_GAME_PORT}).` },
51
+ 'editor-port': { type: 'string', description: `Port to serve the editor on (default ${DEFAULT_EDITOR_PORT}).` },
52
+ },
53
+ async run({ args }) {
54
+ const context = loadProjectContext();
55
+ const tsc = projectBin(context.root, 'tsc');
56
+ const vite = projectBin(context.root, 'vite');
57
+ const gamePort = parsePort(args.port, DEFAULT_GAME_PORT, '--port');
58
+ const editorPort = parsePort(args['editor-port'], DEFAULT_EDITOR_PORT, '--editor-port');
59
+ if (gamePort === editorPort) {
60
+ throw new CliError('`--port` and `--editor-port` must differ — the game and the editor are two servers.');
61
+ }
62
+ // Build to completion first, exactly as `dev` does: every alias resolves into dist/, so serving
63
+ // before the first emit 404s every module.
64
+ console.log('Building…');
65
+ const build = spawnSync(tsc, [], { cwd: context.root, stdio: 'inherit' });
66
+ if (build.error) {
67
+ throw new CliError(`Could not run the TypeScript compiler: ${build.error.message}`);
68
+ }
69
+ if (build.status !== 0) {
70
+ throw new CliError('Build failed. Fix the errors above, then run `bitmagic edit` again.', build.status ?? 1);
71
+ }
72
+ // Before the children, so a port clash fails fast rather than after vite has claimed its port.
73
+ const editor = await startEditorServer({
74
+ root: context.root,
75
+ gameId: context.metadata.gameId,
76
+ gamePort,
77
+ port: editorPort,
78
+ log: (message) => console.log(message),
79
+ });
80
+ const children = [
81
+ {
82
+ name: 'tsc --watch',
83
+ process: spawn(tsc, ['--watch', '--preserveWatchOutput'], { cwd: context.root, stdio: 'inherit' }),
84
+ },
85
+ {
86
+ name: 'vite',
87
+ process: spawn(vite, ['--port', String(gamePort), '--strictPort'], { cwd: context.root, stdio: 'inherit' }),
88
+ },
89
+ ];
90
+ let shuttingDown = false;
91
+ let requestedByUser = false;
92
+ const shutdown = () => {
93
+ if (shuttingDown)
94
+ return;
95
+ shuttingDown = true;
96
+ for (const child of children)
97
+ child.process.kill('SIGTERM');
98
+ void editor.close();
99
+ };
100
+ process.on('SIGINT', () => {
101
+ requestedByUser = true;
102
+ shutdown();
103
+ });
104
+ process.on('SIGTERM', () => {
105
+ requestedByUser = true;
106
+ shutdown();
107
+ });
108
+ void waitForServer(gamePort, 30_000)
109
+ .then(() => {
110
+ console.log(`\nServing the game at ${`http://localhost:${gamePort}/`}`);
111
+ console.log(`Editor ready at ${editor.url}`);
112
+ console.log('\nOpen the editor URL, click an object and drag the gizmo.');
113
+ console.log('Every change is saved to src/work/world.json.');
114
+ // Named on startup so the agent that launched this command knows where to look without
115
+ // being told — the journal is the only record of intentions the editor cannot carry out
116
+ // itself, and of who changed what.
117
+ console.log(`Editor actions are journalled to ${path.relative(context.root, editor.journalPath)}`);
118
+ })
119
+ .catch(() => {
120
+ // The child-exit watcher below reports a vite that never comes up.
121
+ });
122
+ const failure = await new Promise((resolve) => {
123
+ let exitedCount = 0;
124
+ for (const child of children) {
125
+ child.process.on('error', (error) => {
126
+ shutdown();
127
+ resolve({ name: child.name, detail: `could not start: ${error.message}` });
128
+ });
129
+ child.process.on('exit', (code, signal) => {
130
+ exitedCount += 1;
131
+ if (!requestedByUser && !shuttingDown) {
132
+ shutdown();
133
+ resolve({ name: child.name, detail: `exited with code ${code}${signal ? ` (signal ${signal})` : ''}` });
134
+ }
135
+ else if (exitedCount === children.length) {
136
+ resolve(undefined);
137
+ }
138
+ });
139
+ }
140
+ });
141
+ await editor.close();
142
+ if (failure) {
143
+ throw new CliError(`${failure.name} ${failure.detail}. \`bitmagic edit\` stopped.`);
144
+ }
145
+ },
146
+ });
147
+ //# sourceMappingURL=edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.js","sourceRoot":"","sources":["../../src/commands/edit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAqB,MAAM,eAAe,CAAC;AACpE,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC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,EAAE,MAAM,EAAE,oBAAoB,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,YAAY,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;oBAC1G,CAAC;yBAAM,IAAI,WAAW,KAAK,QAAQ,CAAC,MAAM,EAAE,CAAC;wBAC3C,OAAO,CAAC,SAAS,CAAC,CAAC;oBACrB,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QAErB,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,IAAI,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,8BAA8B,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type GenerationOutcome } from '../generate/stream.js';
2
+ import { type PropVoxelizeResult } from '../generate/prop.js';
2
3
  export interface SkyboxArgs {
3
4
  description: string;
4
5
  referenceImageUrl?: string;
@@ -69,4 +70,18 @@ export interface GenerateRunDeps {
69
70
  * this generation, so the message says the asset was NOT lost, only not yet applied.
70
71
  */
71
72
  export declare function runAssetGeneration(type: string, label: string, body: Record<string, unknown>, json?: boolean, deps?: GenerateRunDeps): Promise<GenerationOutcome>;
73
+ /**
74
+ * `generate prop` cannot go through {@link runAssetGeneration}: the prop generator returns a mesh,
75
+ * not patches, so there is nothing to apply until the CLI has voxelized it in a browser. This owns
76
+ * that longer flow — and validates the target asset BEFORE the paid generation, so a mistyped id
77
+ * or an asset with no `fitBox` costs nothing.
78
+ */
79
+ export declare function runPropGeneration(options: {
80
+ assetId: string;
81
+ prompt: string;
82
+ /** Skip the paid generation and voxelize this mesh instead — how a failed run is retried. */
83
+ glbUrl?: string;
84
+ json: boolean;
85
+ deps?: GenerateRunDeps;
86
+ }): Promise<PropVoxelizeResult>;
72
87
  export declare const generateCommand: import("citty").CommandDef<import("citty").ArgsDef>;
@@ -1,4 +1,5 @@
1
1
  import { defineCommand } from 'citty';
2
+ import * as fs from 'fs';
2
3
  import * as path from 'path';
3
4
  import { CliError } from '../errors.js';
4
5
  import { createOutput } from '../output.js';
@@ -9,6 +10,7 @@ import { readDefaultEnvironment } from '../config/credentials.js';
9
10
  import { getAccessToken } from '../auth/session.js';
10
11
  import { requestGeneration } from '../generate/stream.js';
11
12
  import { applyPatchesToWorld } from '../generate/apply-patches.js';
13
+ import { findPropAsset, voxelizeAndInstall } from '../generate/prop.js';
12
14
  function parseNumberFlag(flagName, raw, options = {}) {
13
15
  if (raw === undefined)
14
16
  return undefined;
@@ -183,6 +185,56 @@ export async function runAssetGeneration(type, label, body, json = false, deps)
183
185
  runDeps.log('If `bitmagic dev` is running, reload the browser tab to see the change.');
184
186
  return outcome;
185
187
  }
188
+ /**
189
+ * `generate prop` cannot go through {@link runAssetGeneration}: the prop generator returns a mesh,
190
+ * not patches, so there is nothing to apply until the CLI has voxelized it in a browser. This owns
191
+ * that longer flow — and validates the target asset BEFORE the paid generation, so a mistyped id
192
+ * or an asset with no `fitBox` costs nothing.
193
+ */
194
+ export async function runPropGeneration(options) {
195
+ const output = createOutput(options.json);
196
+ const runDeps = options.deps ?? defaultDeps(options.json);
197
+ const context = loadProjectContext(runDeps.startDir);
198
+ const worldPath = path.join(context.root, aliasSourceDir('work'), 'world.json');
199
+ // Before anything is spent. `findPropAsset` throws a message naming what is wrong.
200
+ findPropAsset(JSON.parse(fs.readFileSync(worldPath, 'utf-8')), options.assetId);
201
+ const environment = resolveEnvironment({ storedDefault: readDefaultEnvironment(runDeps.baseDir) });
202
+ const token = await getAccessToken(environment, resolveAuth0ClientId(environment), { fetch: runDeps.fetch, sleep: runDeps.sleep, now: runDeps.now }, runDeps.baseDir);
203
+ let glbUrl = options.glbUrl;
204
+ if (glbUrl === undefined) {
205
+ let outcome;
206
+ try {
207
+ outcome = await requestGeneration(environment, token, 'prop', { gameId: context.metadata.gameId, prompt: options.prompt }, { fetch: runDeps.fetch, onProgress: runDeps.log });
208
+ }
209
+ catch (error) {
210
+ throw decoratedError(error, (message) => `${message} world.json is unchanged.`);
211
+ }
212
+ if (!outcome.success)
213
+ throw new CliError(`${outcome.message} world.json is unchanged.`);
214
+ if (!outcome.glbUrl) {
215
+ throw new CliError('The generator reported success but returned no mesh. world.json is unchanged.');
216
+ }
217
+ glbUrl = outcome.glbUrl;
218
+ runDeps.log(`Mesh generated: ${glbUrl}`);
219
+ }
220
+ else {
221
+ runDeps.log(`Reusing the mesh at ${glbUrl} — skipping generation.`);
222
+ }
223
+ const result = await voxelizeAndInstall({
224
+ context,
225
+ environment,
226
+ token,
227
+ assetId: options.assetId,
228
+ prompt: options.prompt,
229
+ glbUrl,
230
+ log: runDeps.log,
231
+ });
232
+ runDeps.log(`Upgraded "${result.assetName}" — ${result.instanceCount} placed instance`
233
+ + `${result.instanceCount === 1 ? '' : 's'} now use the generated version.`);
234
+ output.result({ ok: true, kind: 'prop', glbUrl, ...result });
235
+ runDeps.log('If `bitmagic edit` or `bitmagic dev` is running, reload the browser tab to see it.');
236
+ return result;
237
+ }
186
238
  // ============================================================================
187
239
  // Subcommands
188
240
  // ============================================================================
@@ -384,6 +436,40 @@ const animationCommand = defineCommand({
384
436
  await runAssetGeneration('animation', 'animation', body, args.json === true);
385
437
  },
386
438
  });
439
+ const propCommand = defineCommand({
440
+ meta: {
441
+ name: 'prop',
442
+ description: 'Replace a placeholder asset with a generated, voxelized 3D prop.',
443
+ },
444
+ args: {
445
+ asset: {
446
+ type: 'string',
447
+ required: true,
448
+ description: 'Id of the placeholder asset to upgrade. Every placed instance upgrades with it.',
449
+ },
450
+ prompt: {
451
+ type: 'string',
452
+ required: true,
453
+ description: 'What the object should be. Also saved as the asset description.',
454
+ },
455
+ 'glb-url': {
456
+ type: 'string',
457
+ description: 'Voxelize this existing mesh instead of generating one — how to retry for free.',
458
+ },
459
+ json: {
460
+ type: 'boolean',
461
+ description: 'Print the result as JSON on stdout; all progress goes to stderr.',
462
+ },
463
+ },
464
+ async run({ args }) {
465
+ await runPropGeneration({
466
+ assetId: args.asset,
467
+ prompt: args.prompt,
468
+ ...(args['glb-url'] ? { glbUrl: args['glb-url'] } : {}),
469
+ json: args.json === true,
470
+ });
471
+ },
472
+ });
387
473
  export const generateCommand = defineCommand({
388
474
  meta: {
389
475
  name: 'generate',
@@ -395,6 +481,7 @@ export const generateCommand = defineCommand({
395
481
  image: imageCommand,
396
482
  character: characterCommand,
397
483
  animation: animationCommand,
484
+ prop: propCommand,
398
485
  },
399
486
  });
400
487
  //# sourceMappingURL=generate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAA0B,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAmBnE,SAAS,eAAe,CACtB,QAAgB,EAChB,GAAuB,EACvB,UAA6B,EAAE;IAE/B,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,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,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvD,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI;SACzB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,4EAA4E;KAC1F;IACD,WAAW,EAAE;QACX,MAAM,EAAE,aAAa;QACrB,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,gBAAgB;QAC3B,SAAS,EAAE,gBAAgB;QAC3B,IAAI,EAAE,WAAW;KAClB;CACF,CAAC,CAAC"}
@@ -0,0 +1,108 @@
1
+ import type { WorldJsonShape } from '@bitmagic/world-forger/pipeline/index.js';
2
+ import type { ScenePayload } from './save.js';
3
+ /** Journal location, relative to the project root. */
4
+ export declare const JOURNAL_DIR: string;
5
+ export declare const JOURNAL_FILE = "events.jsonl";
6
+ interface Vec3 {
7
+ x: number;
8
+ y: number;
9
+ z: number;
10
+ }
11
+ /** The transform fields that actually changed, so a line reads as the edit the human made. */
12
+ interface TransformDelta {
13
+ position?: {
14
+ from: Vec3 | null;
15
+ to: Vec3;
16
+ };
17
+ rotation?: {
18
+ from: Vec3 | null;
19
+ to: Vec3;
20
+ };
21
+ scale?: {
22
+ from: Vec3 | null;
23
+ to: Vec3;
24
+ };
25
+ }
26
+ export type EditorEvent = {
27
+ event: 'session.started';
28
+ gameId: string;
29
+ gameUrl: string;
30
+ editorUrl: string;
31
+ } | ({
32
+ event: 'object.moved';
33
+ objectId: string;
34
+ type?: string;
35
+ assetId?: string;
36
+ } & TransformDelta) | {
37
+ event: 'object.added';
38
+ objectId: string;
39
+ type?: string;
40
+ assetId?: string;
41
+ position?: Vec3;
42
+ } | {
43
+ event: 'object.deleted';
44
+ objectId: string;
45
+ type?: string;
46
+ assetId?: string;
47
+ } | {
48
+ event: 'spawn.changed';
49
+ count: number;
50
+ playerSpawn?: Vec3;
51
+ } | {
52
+ event: 'markers.changed';
53
+ count: number;
54
+ } | {
55
+ event: 'worldconfig.changed';
56
+ path: string[];
57
+ }
58
+ /**
59
+ * The human asked for a high-quality version of a forger placeholder. The editor cannot do this
60
+ * itself — generation needs Asset Forger credentials that never reach a creator's machine — so
61
+ * the request is recorded here WITH the confirmed prompt, and the agent runs it.
62
+ */
63
+ | {
64
+ event: 'hq.requested';
65
+ assetId: string;
66
+ assetName: string;
67
+ prompt: string;
68
+ command: string;
69
+ };
70
+ /** One journal line: the event, stamped. */
71
+ export type JournalLine = EditorEvent & {
72
+ at: string;
73
+ };
74
+ /**
75
+ * What changed between the world on disk and what the engine is reporting.
76
+ *
77
+ * Pure, and given the BEFORE document rather than reading it — so the caller reads world.json once
78
+ * for both this and the modification builder, and the whole thing is testable without a filesystem
79
+ * or a browser.
80
+ *
81
+ * Silence is meaningful: an upserted object whose transform is unchanged produces no line. The
82
+ * engine re-serializes every object it was told is modified, including ones whose only "change"
83
+ * was being marked, and a journal that logged those would drown the real edits.
84
+ */
85
+ export declare function deriveSceneEvents(before: WorldJsonShape, payload: ScenePayload): EditorEvent[];
86
+ /** The one-line human form mirrored to stdout. The JSONL line stays the machine contract. */
87
+ export declare function formatEvent(event: EditorEvent): string;
88
+ export interface EditorJournalOptions {
89
+ root: string;
90
+ /** Where the human-readable mirror goes. Defaults to nowhere. */
91
+ log?: (message: string) => void;
92
+ /** Injected in tests so a journal can be written without a clock. */
93
+ now?: () => string;
94
+ }
95
+ /**
96
+ * Append-only writer. Failures to write are reported through `log` and never thrown: the journal
97
+ * is a record OF the edit, and losing the record must not cost the creator the edit itself.
98
+ */
99
+ export declare class EditorJournal {
100
+ private readonly file;
101
+ private readonly log;
102
+ private readonly now;
103
+ constructor(options: EditorJournalOptions);
104
+ /** Absolute path of the journal, for the startup banner that tells an agent where to look. */
105
+ get path(): string;
106
+ append(...events: EditorEvent[]): void;
107
+ }
108
+ export {};