@bitmagic/cli 0.1.53-dev.1 → 0.1.53-dev.11
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 +140 -36
- package/dist/assets/revoxelize.d.ts +61 -1
- package/dist/assets/revoxelize.js +157 -13
- package/dist/assets/revoxelize.js.map +1 -1
- package/dist/cli.d.ts +35 -1
- package/dist/cli.js +18 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/assets.js +3 -2
- package/dist/commands/assets.js.map +1 -1
- package/dist/commands/build.d.ts +4 -0
- package/dist/commands/build.js +7 -1
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cover.d.ts +5 -0
- package/dist/commands/cover.js +3 -0
- package/dist/commands/cover.js.map +1 -1
- package/dist/commands/dev.js +1 -2
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/forge.d.ts +4 -0
- package/dist/commands/forge.js +9 -0
- package/dist/commands/forge.js.map +1 -1
- package/dist/commands/generate.d.ts +25 -0
- package/dist/commands/generate.js +80 -8
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.js +12 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/publish.d.ts +39 -5
- package/dist/commands/publish.js +102 -21
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/reload.js +1 -3
- package/dist/commands/reload.js.map +1 -1
- package/dist/commands/reset-account.js +25 -8
- package/dist/commands/reset-account.js.map +1 -1
- package/dist/commands/self-update.d.ts +67 -0
- package/dist/commands/self-update.js +196 -0
- package/dist/commands/self-update.js.map +1 -0
- package/dist/commands/upgrade.js +5 -2
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/editor/asset-detail-panel.d.ts +2 -2
- package/dist/editor/asset-detail-panel.js +5 -2
- package/dist/editor/asset-detail-panel.js.map +1 -1
- package/dist/editor/cli-update.d.ts +32 -0
- package/dist/editor/cli-update.js +67 -0
- package/dist/editor/cli-update.js.map +1 -0
- package/dist/editor/publish-panel.d.ts +31 -0
- package/dist/editor/publish-panel.js +69 -0
- package/dist/editor/publish-panel.js.map +1 -0
- package/dist/editor/server.js +43 -1
- package/dist/editor/server.js.map +1 -1
- package/dist/editor/shell-page.js +249 -8
- package/dist/editor/shell-page.js.map +1 -1
- package/dist/forge/upload-proxy.d.ts +14 -0
- package/dist/forge/upload-proxy.js +28 -1
- package/dist/forge/upload-proxy.js.map +1 -1
- package/dist/generate/model.d.ts +7 -0
- package/dist/generate/model.js +13 -3
- package/dist/generate/model.js.map +1 -1
- package/dist/generate/prop.d.ts +20 -0
- package/dist/generate/prop.js +22 -2
- package/dist/generate/prop.js.map +1 -1
- package/dist/generate/vehicle.d.ts +2 -0
- package/dist/generate/vehicle.js +1 -0
- package/dist/generate/vehicle.js.map +1 -1
- package/dist/project/dev-handle.d.ts +28 -0
- package/dist/project/dev-handle.js +43 -0
- package/dist/project/dev-handle.js.map +1 -1
- package/dist/project/jobs.js +11 -9
- package/dist/project/jobs.js.map +1 -1
- package/dist/publish/bundle.d.ts +35 -8
- package/dist/publish/bundle.js +41 -13
- package/dist/publish/bundle.js.map +1 -1
- package/dist/publish/client.d.ts +13 -2
- package/dist/publish/client.js.map +1 -1
- package/dist/publish/record.d.ts +22 -0
- package/dist/publish/record.js +62 -0
- package/dist/publish/record.js.map +1 -0
- package/dist/render/qr-output.d.ts +44 -0
- package/dist/render/qr-output.js +71 -0
- package/dist/render/qr-output.js.map +1 -0
- package/dist/render/qr-png.d.ts +37 -0
- package/dist/render/qr-png.js +111 -0
- package/dist/render/qr-png.js.map +1 -0
- package/dist/render/qr-terminal.d.ts +63 -0
- package/dist/render/qr-terminal.js +142 -0
- package/dist/render/qr-terminal.js.map +1 -0
- package/dist/render/qr.d.ts +51 -0
- package/dist/render/qr.js +516 -0
- package/dist/render/qr.js.map +1 -0
- package/dist/scaffold/project-files.d.ts +42 -9
- package/dist/scaffold/project-files.js +242 -43
- 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/scaffold/suggest-template.d.ts +2 -0
- package/dist/scaffold/suggest-template.js +2 -1
- package/dist/scaffold/suggest-template.js.map +1 -1
- package/dist/telemetry/command-context.d.ts +12 -0
- package/dist/telemetry/command-context.js +7 -0
- package/dist/telemetry/command-context.js.map +1 -1
- package/dist/telemetry/creator-prompt.d.ts +35 -0
- package/dist/telemetry/creator-prompt.js +45 -0
- package/dist/telemetry/creator-prompt.js.map +1 -0
- package/dist/update/check.js +2 -1
- package/dist/update/check.js.map +1 -1
- package/dist/update/notice.d.ts +31 -1
- package/dist/update/notice.js +39 -5
- package/dist/update/notice.js.map +1 -1
- package/dist/update/self-install.d.ts +175 -0
- package/dist/update/self-install.js +335 -0
- package/dist/update/self-install.js.map +1 -0
- package/package.json +4 -4
|
@@ -3,8 +3,9 @@ import { tsconfigPaths, importMapEntries, viteAliasEntries } from './aliases.js'
|
|
|
3
3
|
/**
|
|
4
4
|
* The legal notice stamped into every game this project publishes.
|
|
5
5
|
*
|
|
6
|
-
* **A licence obligation, not decoration.** A published game is one file with the engine
|
|
7
|
-
* third-party dependencies
|
|
6
|
+
* **A licence obligation, not decoration.** A published game is one file with the engine inlined
|
|
7
|
+
* (and, from a `--single-file` build, its third-party dependencies too), so distributing a game
|
|
8
|
+
* distributes part of the engine.
|
|
8
9
|
* PolyForm Shield's Notices section requires that anyone receiving any part of the software also
|
|
9
10
|
* receives the terms and every `Required Notice:` line; MIT and ISC require their copyright and
|
|
10
11
|
* permission notices to travel with copies; Apache-2.0 section 4 requires the licence to accompany
|
|
@@ -328,17 +329,179 @@ ${renderAliasEntries()}
|
|
|
328
329
|
`;
|
|
329
330
|
}
|
|
330
331
|
/**
|
|
331
|
-
*
|
|
332
|
+
* `CDN_IMPORTS` entries a published bundle keeps INLINED rather than fetching at runtime.
|
|
332
333
|
*
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
334
|
+
* `fflate` is the whole list, and it is a decision rather than an oversight. `engine/gzip.ts`
|
|
335
|
+
* falls back to fflate's synchronous codec when `CompressionStream` is missing — that is
|
|
336
|
+
* iOS/WebKit below 16.4 and a long tail of embedded WebViews, i.e. exactly the browsers with the
|
|
337
|
+
* least reliable module-CDN story, and the file says so in as many words ("fflate is bundled (not
|
|
338
|
+
* externalized) so it works offline and without an import map"). Moving it out would break
|
|
339
|
+
* every compressed VXL/VWLD load precisely where the fallback is the only thing that works, and
|
|
340
|
+
* buys back about 30KB. `game/vite.bundle-publish.config.js` leaves it bundled for the same
|
|
341
|
+
* reason, and the two lanes have to agree.
|
|
342
|
+
*
|
|
343
|
+
* It stays in `CDN_IMPORTS` regardless: `bitmagic dev` serves raw /dist, where the browser still
|
|
344
|
+
* has to resolve the bare `fflate` specifier through the import map.
|
|
345
|
+
*/
|
|
346
|
+
export const INLINED_CDN_IMPORTS = new Set(['fflate']);
|
|
347
|
+
/**
|
|
348
|
+
* The exact/prefix table a published bundle leaves OUT of itself: every `CDN_IMPORTS` entry whose
|
|
349
|
+
* value resolves on its own (an absolute https URL, or the self-contained `data:` shim `three`
|
|
350
|
+
* maps to) and that is not deliberately inlined above.
|
|
351
|
+
*
|
|
352
|
+
* The local alias prefixes `renderIndexHtml` merges in alongside these (`engine/` -> `/dist/...`)
|
|
353
|
+
* are excluded by the URL filter, which is load-bearing rather than incidental: a published bundle
|
|
354
|
+
* is one HTML file sitting in a bucket with no same-origin siblings to fetch, so everything those
|
|
355
|
+
* name has to be bundled.
|
|
356
|
+
*
|
|
357
|
+
* Returned as ordered pairs, not an object, because the order is part of the contract — `cdnUrl`
|
|
358
|
+
* in the generated config takes the FIRST matching prefix where a browser's import map takes the
|
|
359
|
+
* LONGEST. The two agree only because `three/addons/` is declared above `three/`; flip them and
|
|
360
|
+
* every addon resolves through the bare `three/` entry, which is a second copy of three.js: an
|
|
361
|
+
* unlit scene, and `instanceof THREE.Mesh` scans that find nothing.
|
|
362
|
+
*/
|
|
363
|
+
export function publishExternalEntries() {
|
|
364
|
+
return Object.entries(CDN_IMPORTS).filter(([key, url]) => !INLINED_CDN_IMPORTS.has(key) && /^(https?:\/\/|data:)/.test(url));
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* The generated config's CDN table and its resolver, shared by the `external` predicate and
|
|
368
|
+
* Rollup's `output.paths`.
|
|
369
|
+
*
|
|
370
|
+
* The table is baked in rather than read out of the project's own index.html at build time (which
|
|
371
|
+
* is what `game/vite.external-cdn-paths.js` does for the web lane): both files are
|
|
372
|
+
* platform-generated and rewritten together by `bitmagic upgrade`, so they cannot drift, and a
|
|
373
|
+
* literal is readable — which is the whole reason this config is vendored instead of generated.
|
|
374
|
+
*
|
|
375
|
+
* Exact ids win over prefixes regardless of declaration order; only prefixes are order-sensitive.
|
|
376
|
+
*/
|
|
377
|
+
function renderCdnModuleTable() {
|
|
378
|
+
const entries = publishExternalEntries()
|
|
379
|
+
.map(([key, url]) => ` [${JSON.stringify(key)}, ${JSON.stringify(url)}],`)
|
|
380
|
+
.join('\n');
|
|
381
|
+
return `// The third-party packages this bundle deliberately does NOT contain. The browser fetches them
|
|
382
|
+
// at runtime from the same CDN, at the same pinned versions, that index.html's import map names —
|
|
383
|
+
// this table is generated from that one source, so the two cannot come to disagree.
|
|
384
|
+
//
|
|
385
|
+
// Why the emitted imports carry ABSOLUTE URLs instead of bare specifiers for the import map to
|
|
386
|
+
// resolve: a browser without import-map support — iOS Safari before 16.4, and several in-app
|
|
387
|
+
// WebViews — dies on the first bare import with "Module specifier '@dimforge/rapier3d-compat'
|
|
388
|
+
// does not start with '/', './' or '../'", and the game never loads. These are the same URLs the
|
|
389
|
+
// map points at, so nothing else changes.
|
|
390
|
+
//
|
|
391
|
+
// ORDER IS LOAD-BEARING, and it is the OPPOSITE of the rule a browser applies to the import map.
|
|
392
|
+
// A browser takes the LONGEST matching prefix; this table takes the FIRST. So a nested prefix has
|
|
393
|
+
// to be declared ABOVE the prefix it nests inside. 'three/addons/' and 'three/examples/jsm/' sit
|
|
394
|
+
// above 'three/' for that reason: 'three/' would otherwise claim every addon and resolve it
|
|
395
|
+
// against esm.sh's plain build, which inlines its own copy of three.js. That copy shares no module
|
|
396
|
+
// with the webgpu build the engine runs on, so GLTFLoader hands back Meshes from a second Mesh
|
|
397
|
+
// class and the engine's instanceof scans find nothing in the loaded scene. Reordering this table
|
|
398
|
+
// is not cosmetic, and it fails silently.
|
|
399
|
+
const CDN_MODULES = [
|
|
400
|
+
${entries}
|
|
401
|
+
];
|
|
402
|
+
|
|
403
|
+
// The CDN URL an import resolves to, or undefined when it belongs inside this bundle. A key ending
|
|
404
|
+
// in '/' is a prefix and covers everything beneath it; every other key matches exactly. Exact
|
|
405
|
+
// matches are checked first, so an exact key can never be shadowed by a prefix above it.
|
|
406
|
+
//
|
|
407
|
+
// The project's own aliases ('engine/', 'work/', 'core/', ...) are deliberately absent from the
|
|
408
|
+
// table: they are this project's compiled code, they are inlined here, and a published game is one
|
|
409
|
+
// file in object storage with no same-origin siblings to fetch. 'fflate' is absent for a different
|
|
410
|
+
// reason — see engine/gzip.ts, it is the codec fallback for browsers that would struggle to fetch
|
|
411
|
+
// it in the first place.
|
|
412
|
+
function cdnUrl(id) {
|
|
413
|
+
for (const [key, url] of CDN_MODULES) {
|
|
414
|
+
if (!key.endsWith('/') && id === key) return url;
|
|
415
|
+
}
|
|
416
|
+
for (const [key, url] of CDN_MODULES) {
|
|
417
|
+
if (key.endsWith('/') && id.startsWith(key)) return url + id.slice(key.length);
|
|
418
|
+
}
|
|
419
|
+
return undefined;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
`;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Drops the whole creator/editor command surface out of a published bundle.
|
|
426
|
+
*
|
|
427
|
+
* A published game is player-facing and never runs in creator mode: `GameTemplate` registers the
|
|
428
|
+
* listener only behind `isCreatorMode`, so stubbing the module lets Rollup tree-shake the entire
|
|
429
|
+
* subtree behind it — FBXLoader, GLTFExporter, the voxelizer, the splat collider editors. Mirrors
|
|
430
|
+
* `game/vite.bundle-publish.config.js`, which does this for the web lane.
|
|
431
|
+
*
|
|
432
|
+
* `enforce: 'pre'` is required, not tidy: without it Vite's alias plugin resolves the `engine/`
|
|
433
|
+
* prefix to a real file first and the stub never fires.
|
|
434
|
+
*/
|
|
435
|
+
function renderCreatorHandlerStub() {
|
|
436
|
+
return `// Published games never run in creator mode, so the creator<->game command surface (and its
|
|
437
|
+
// editor-only dependencies) is dead weight. 'pre' runs before Vite's alias plugin resolves the
|
|
438
|
+
// 'engine/' prefix, which is what lets this stub win.
|
|
439
|
+
const stubCreatorHandlerPlugin = () => ({
|
|
440
|
+
name: 'stub-creator-handler',
|
|
441
|
+
enforce: 'pre',
|
|
442
|
+
resolveId(id) {
|
|
443
|
+
if (id === 'engine/template/CreatorMessageHandler.js' ||
|
|
444
|
+
id.endsWith('/engine/template/CreatorMessageHandler.js')) {
|
|
445
|
+
return '\\0creator-handler-stub';
|
|
446
|
+
}
|
|
447
|
+
return null;
|
|
448
|
+
},
|
|
449
|
+
load(id) {
|
|
450
|
+
if (id === '\\0creator-handler-stub') {
|
|
451
|
+
return 'export function registerCreatorMessageListener() {}\\n' +
|
|
452
|
+
'export function notifyPhysicsReady() {}\\n' +
|
|
453
|
+
'export function flushPendingToolMessages() {}\\n';
|
|
454
|
+
}
|
|
455
|
+
return null;
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
`;
|
|
459
|
+
}
|
|
460
|
+
/** Rollup's `external` predicate, indented to sit inside the generated `rollupOptions` block. */
|
|
461
|
+
const PUBLISH_CONFIG_EXTERNAL_BLOCK = ` // Anything the CDN table resolves stays OUT of the bundle. Every other id — the 'engine/',
|
|
462
|
+
// 'core/', 'work/' aliases above included — is bundled, which is what a single published
|
|
463
|
+
// HTML file with no same-origin siblings requires.
|
|
464
|
+
external: (id) => cdnUrl(id) !== undefined,`;
|
|
465
|
+
/**
|
|
466
|
+
* The counterpart note in the `--single-file` config, where there is no `external` at all.
|
|
467
|
+
*
|
|
468
|
+
* It also has to say what this config must NOT do. The web lane's standalone config strips the
|
|
469
|
+
* import map out of index.html once nothing is external any more — copying that here would break
|
|
470
|
+
* every `--single-file` publish, because `ENGINE_BUILD_MARKERS` in
|
|
471
|
+
* `@bitmagic/asset-core/publish-source` are two of the map's own entries and api-server's
|
|
472
|
+
* `publish/complete` range-reads the bundle's first 64KB looking for them.
|
|
473
|
+
*/
|
|
474
|
+
const PUBLISH_CONFIG_NO_EXTERNAL_NOTE = ` // No 'external' and no CDN rewriting: three.js, Rapier and the rest are bundled in, which is
|
|
475
|
+
// the entire difference between this config and vite.publish.config.js.
|
|
476
|
+
//
|
|
477
|
+
// The import map in index.html stays even though nothing needs it here. Two of its entries
|
|
478
|
+
// are what api-server reads back out of the uploaded bundle to confirm this is a real engine
|
|
479
|
+
// build; strip the map and every publish of this bundle is refused.`;
|
|
480
|
+
/** Rollup's `output.paths`, indented to sit inside the generated `output` block. */
|
|
481
|
+
const PUBLISH_CONFIG_PATHS_BLOCK = ` // Rewrite each externalized import to its absolute CDN URL, so the published HTML needs no
|
|
482
|
+
// import-map support to load. See the note on CDN_MODULES.
|
|
483
|
+
paths: (id) => cdnUrl(id) ?? id,
|
|
484
|
+
`;
|
|
485
|
+
/**
|
|
486
|
+
* Both production bundle configs, vendored into the project next to `engine/`.
|
|
487
|
+
*
|
|
488
|
+
* Rendered from one function because the two differ in exactly one dimension — whether three.js,
|
|
489
|
+
* Rapier and the other CDN packages are left external or inlined — and everything else about them
|
|
490
|
+
* (aliases, `__BUNDLED__`, the licence banner, the creator-handler stub) has to stay identical.
|
|
491
|
+
* Two hand-maintained copies is how the web lane's pair drifted.
|
|
492
|
+
*
|
|
493
|
+
* Either way the output is ONE index.html: `viteSingleFile` with an effectively unlimited inline
|
|
494
|
+
* limit, so the engine and all JS/CSS land inside it. `bitmagic publish` PUTs a single object and
|
|
495
|
+
* api-server range-reads that object to confirm the meta block, so a multi-file build would not
|
|
496
|
+
* ship at all. Game ASSETS are not inlined in either mode — they already live on the CDN with
|
|
497
|
+
* absolute URLs, and inlining them is what produced multi-hundred-MB bundles and OOM-killed the
|
|
498
|
+
* web publish pod.
|
|
337
499
|
*
|
|
338
500
|
* Vendored rather than generated per-build so a creator can read exactly what ships, and so it
|
|
339
501
|
* versions with the engine it was written for.
|
|
340
502
|
*/
|
|
341
|
-
|
|
503
|
+
function renderPublishConfig(mode) {
|
|
504
|
+
const cdn = mode === 'cdn';
|
|
342
505
|
return `import { defineConfig } from 'vite';
|
|
343
506
|
import { viteSingleFile } from 'vite-plugin-singlefile';
|
|
344
507
|
|
|
@@ -351,6 +514,8 @@ import { viteSingleFile } from 'vite-plugin-singlefile';
|
|
|
351
514
|
// 'dist/engine/engineGameTemplate.js' instead of 'dist/engine/engine/GameTemplate.js' — silently,
|
|
352
515
|
// since Rollup then just treats the unmatched id as an unresolved bare specifier and fails the
|
|
353
516
|
// build. Verified against a real \`vite build\` before trusting the plain-string form.
|
|
517
|
+
|
|
518
|
+
${cdn ? renderCdnModuleTable() : ''}${renderCreatorHandlerStub()}
|
|
354
519
|
export default defineConfig({
|
|
355
520
|
// The engine serves world.json/game.json two different ways, and this flag is how it chooses.
|
|
356
521
|
// \`utils/worldDataLoader.ts\` reads \`typeof __BUNDLED__ !== 'undefined' && __BUNDLED__\`: true
|
|
@@ -372,23 +537,40 @@ ${renderAliasEntries()}
|
|
|
372
537
|
},
|
|
373
538
|
build: {
|
|
374
539
|
// Effectively unlimited: everything the bundle references locally is inlined so the
|
|
375
|
-
// published artifact is a single file.
|
|
540
|
+
// published artifact is a single file. Game assets are absolute CDN URLs and are untouched${cdn ? ',\n // and so are the packages the table above externalizes' : ''}.
|
|
376
541
|
assetsInlineLimit: 100000000,
|
|
377
542
|
cssCodeSplit: false,
|
|
378
543
|
rollupOptions: {
|
|
544
|
+
${cdn ? PUBLISH_CONFIG_EXTERNAL_BLOCK : PUBLISH_CONFIG_NO_EXTERNAL_NOTE}
|
|
379
545
|
output: {
|
|
380
546
|
inlineDynamicImports: true,
|
|
381
|
-
// A licence obligation, not decoration — see engine/LICENSE.md. This bundle contains
|
|
382
|
-
// compiled engine code and third-party libraries whose licences
|
|
383
|
-
// travel with any copy. Removing this banner puts your published
|
|
547
|
+
${cdn ? PUBLISH_CONFIG_PATHS_BLOCK : ''} // A licence obligation, not decoration — see engine/LICENSE.md. This bundle contains
|
|
548
|
+
// compiled engine code${cdn ? '' : ' and the third-party libraries it uses'}, whose licences
|
|
549
|
+
// require their notices to travel with any copy. Removing this banner puts your published
|
|
550
|
+
// game out of compliance.
|
|
384
551
|
banner: ${JSON.stringify(PUBLISHED_BUNDLE_BANNER)},
|
|
385
552
|
},
|
|
386
553
|
},
|
|
387
554
|
},
|
|
388
|
-
plugins: [viteSingleFile()],
|
|
555
|
+
plugins: [stubCreatorHandlerPlugin(), viteSingleFile()],
|
|
389
556
|
});
|
|
390
557
|
`;
|
|
391
558
|
}
|
|
559
|
+
/**
|
|
560
|
+
* The default config: three.js, Rapier and the rest of the import map's packages are left to the
|
|
561
|
+
* CDN, exactly as `game/vite.bundle-publish.config.js` does for every production web publish.
|
|
562
|
+
*/
|
|
563
|
+
export function renderVitePublishConfig() {
|
|
564
|
+
return renderPublishConfig('cdn');
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* The `--single-file` config: nothing external, so the published HTML plays with no network at all
|
|
568
|
+
* once it has loaded. Bigger by roughly the size of three.js and Rapier, and the reason it exists
|
|
569
|
+
* is offline and packaged distribution (`file://`, Poki, a desktop shell), not everyday publishing.
|
|
570
|
+
*/
|
|
571
|
+
export function renderVitePublishStandaloneConfig() {
|
|
572
|
+
return renderPublishConfig('standalone');
|
|
573
|
+
}
|
|
392
574
|
export function renderGitignore() {
|
|
393
575
|
return ['dist/', 'node_modules/', '.bitmagic/', '.vite-cache/', ''].join('\n');
|
|
394
576
|
}
|
|
@@ -396,45 +578,49 @@ export function renderBitmagicJson(metadata) {
|
|
|
396
578
|
return renderJson(metadata);
|
|
397
579
|
}
|
|
398
580
|
/**
|
|
399
|
-
* The "Updating the bitmagic CLI" section, which
|
|
400
|
-
* still being asked.
|
|
581
|
+
* The "Updating the bitmagic CLI" section, which used to have two jobs and now has one.
|
|
401
582
|
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
583
|
+
* It began as an answer to a question the project already answered: an agent told to update the CLI
|
|
584
|
+
* had two published lines to choose from, nothing in the project naming one, and so asked the
|
|
585
|
+
* creator "dev or prod?". The section baked in the right `npm i -g` for the pin and forbade the
|
|
586
|
+
* question.
|
|
406
587
|
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
588
|
+
* That instruction was right about the line and wrong about the mechanism. A printed `npm i -g` is
|
|
589
|
+
* run by whatever `npm` the agent's shell resolves, and a coding agent's non-interactive shell
|
|
590
|
+
* sources no profile — under nvm it gets a different node's npm, installs into a prefix nothing on
|
|
591
|
+
* PATH points at, and reports success while `bitmagic --version` never moves. `bitmagic
|
|
592
|
+
* self-update` resolves its own install from the running process and reads the pin itself, so the
|
|
593
|
+
* whole two-line explanation collapses into one command that cannot be aimed at the wrong place or
|
|
594
|
+
* the wrong line. What remains of the old paragraph is the *why*, which an agent still needs when
|
|
595
|
+
* something looks wrong — not a choice for it to make.
|
|
410
596
|
*
|
|
411
|
-
* `environment` is undefined for a project scaffolded before the pin existed.
|
|
412
|
-
*
|
|
413
|
-
*
|
|
597
|
+
* `environment` is undefined for a project scaffolded before the pin existed. The command still
|
|
598
|
+
* works there (it falls back to the line the installed build is on), so that case only loses the
|
|
599
|
+
* sentence naming this project's environment.
|
|
414
600
|
*/
|
|
415
601
|
function renderCliUpdateSection(environment) {
|
|
416
|
-
const install = environment === 'prod' ? 'npm i -g @bitmagic/cli' : 'npm i -g @bitmagic/cli@dev';
|
|
417
602
|
const here = environment === undefined
|
|
418
603
|
? `This project predates the \`environment\` field of \`bitmagic.json\` and so has no pin yet.
|
|
419
|
-
Run \`bitmagic upgrade\` once to stamp one
|
|
420
|
-
meantime,
|
|
421
|
-
|
|
422
|
-
\`bitmagic.json\`),
|
|
604
|
+
Run \`bitmagic upgrade\` once to stamp one, and \`bitmagic whoami\` to see what the CLI resolves in
|
|
605
|
+
the meantime; until there is a pin, \`self-update\` keeps you on the line your installed build is
|
|
606
|
+
already on.`
|
|
607
|
+
: `This project is on the **${environment}** environment (\`environment\` in \`bitmagic.json\`), and the command reads that pin itself.`;
|
|
608
|
+
return `## Updating the bitmagic CLI
|
|
423
609
|
|
|
424
610
|
\`\`\`
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
return `## Updating the bitmagic CLI
|
|
611
|
+
bitmagic self-update
|
|
612
|
+
\`\`\`
|
|
428
613
|
|
|
429
614
|
${here}
|
|
430
615
|
|
|
431
|
-
**Never ask which line to install,
|
|
432
|
-
\`
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
with this paragraph, the file is right. The engine is a
|
|
616
|
+
**Never ask which line to install, never offer the choice, and never update with \`npm i -g @bitmagic/cli\`** —
|
|
617
|
+
\`self-update\` reinstalls into the exact place this CLI lives, using the node running it, which the \`npm\` on
|
|
618
|
+
your PATH may not be; under nvm it usually is not, and the install lands in another prefix while
|
|
619
|
+
\`bitmagic --version\` never moves. The lines are not interchangeable (\`dev\` and \`local\` take the prerelease
|
|
620
|
+
built against the dev api-server, \`prod\` the release), and the wrong one fails as opaque command errors
|
|
621
|
+
rather than version warnings — so run \`self-update\` before debugging a command that started failing
|
|
622
|
+
strangely. If \`bitmagic.json\` ever disagrees with this paragraph, the file is right. The engine is a
|
|
623
|
+
separate command: \`bitmagic upgrade\`.`;
|
|
438
624
|
}
|
|
439
625
|
export function renderAgentsMd(environment) {
|
|
440
626
|
return `# Working on this Bitmagic game
|
|
@@ -489,8 +675,8 @@ If you are unsure whether one is already running, \`bitmagic reload\` says so an
|
|
|
489
675
|
Bitmagic's IP, licensed to you under the PolyForm Shield License 1.0.0 with an additional
|
|
490
676
|
permission: build, modify, sell and distribute games anywhere you like, including off
|
|
491
677
|
bitmagic.ai and with a modified engine. What you may not do is ship the engine *as an engine*.
|
|
492
|
-
The licence obliges every published bundle to carry a notice, which is why
|
|
493
|
-
\`vite.publish
|
|
678
|
+
The licence obliges every published bundle to carry a notice, which is why both
|
|
679
|
+
\`vite.publish*.config.js\` files have a \`banner\`: leave it alone. \`engine/THIRD-PARTY-NOTICES.md\`
|
|
494
680
|
covers three.js, Rapier and the rest.
|
|
495
681
|
- \`engine/agent-docs/\` — **the engine's documentation, and the fastest thing in this project.**
|
|
496
682
|
\`engine-api/\` is a generated signature digest covering every public engine class, method and
|
|
@@ -774,6 +960,11 @@ Follow this order; \`publish\` enforces it and refuses otherwise:
|
|
|
774
960
|
3. Run \`bitmagic publish\`. It rebuilds automatically if the project changed since the last
|
|
775
961
|
build, so a manual \`bitmagic build\` first is optional.
|
|
776
962
|
|
|
963
|
+
**Show your creator the QR code.** Publish turns the game's URL into a scannable image. Your
|
|
964
|
+
output is a pipe, so it cannot be drawn in the terminal: publish writes \`.bitmagic/publish-qr.png\`
|
|
965
|
+
and names it (\`qrPath\` under \`--json\`). Surface that image like any artifact you made — scanning
|
|
966
|
+
it opens the game on a phone, and a bare URL leaves your creator retyping a game id into a browser.
|
|
967
|
+
|
|
777
968
|
**A bare \`bitmagic publish\` does not make the game public.** Every publish uploads and
|
|
778
969
|
registers the game, but \`visibility\` defaults to \`private\` — reachable by URL, not listed on
|
|
779
970
|
bitmagic.ai. Pass \`--visibility public\` explicitly, on that call, to list it; omit it on a later
|
|
@@ -793,7 +984,7 @@ If \`bitmagic publish\` exits non-zero, branch on the exit code rather than pars
|
|
|
793
984
|
|
|
794
985
|
| Code | Meaning | Fix |
|
|
795
986
|
|---|---|---|
|
|
796
|
-
| 1 | Build failed, or what was uploaded was not an engine build | Run \`bitmagic check\` to see the error, fix it. If the message
|
|
987
|
+
| 1 | Build failed, or what was uploaded was not an engine build | Run \`bitmagic check\` to see the error, fix it. If the message names a missing \`vite.publish*.config.js\`, this project predates it — run \`bitmagic upgrade\`. Do NOT retry an unchanged bundle; the refusal is deterministic |
|
|
797
988
|
| 2 | Not logged in | \`bitmagic login\` |
|
|
798
989
|
| 3 | Verify missing, stale, or failed | \`bitmagic verify\` (then publish again, or add \`--force\` for a stale/failed record) |
|
|
799
990
|
| 5 | Not this game's owner, or the account/game is banned | Not self-serve — stop and report it |
|
|
@@ -837,6 +1028,8 @@ bitmagic generate vehicle --prompt "a rusty orange pickup" | --preset VAN
|
|
|
837
1028
|
|
|
838
1029
|
Run \`bitmagic generate <type> --help\` for the full flags of any one.
|
|
839
1030
|
|
|
1031
|
+
**Always add \`--original-prompt "<creator's request, verbatim>"\`** — analytics only, never affects output.
|
|
1032
|
+
|
|
840
1033
|
Four things worth knowing before you use these:
|
|
841
1034
|
|
|
842
1035
|
1. **Each generation writes to \`src/work/world.json\`.** If you are also editing that file,
|
|
@@ -1285,6 +1478,12 @@ The \`bitmagic\` CLI generates content directly into this project. Nine types wo
|
|
|
1285
1478
|
|
|
1286
1479
|
\`--help\` on any subcommand lists its full flags.
|
|
1287
1480
|
|
|
1481
|
+
**Every one of these (and \`bitmagic forge\` / \`bitmagic cover\`) also takes
|
|
1482
|
+
\`--original-prompt "<the creator's request, verbatim>"\` — always pass it.** It is the exact
|
|
1483
|
+
words the creator used when they asked you, recorded for Bitmagic's analytics only; it never
|
|
1484
|
+
reaches the generator, so it cannot change the output. Skip it only when no creator request is
|
|
1485
|
+
behind the call.
|
|
1486
|
+
|
|
1288
1487
|
\`animation\` is the one that takes no prompt at all: the clip is built from an authored parameter
|
|
1289
1488
|
spec in one of three families — \`gait\` (the only one with a flag form), \`melee\` and \`oneShot\`
|
|
1290
1489
|
(lists of key poses, so they come from a \`--spec\` file). It is also the cheapest, one spark a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKjF
|
|
1
|
+
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKjF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;IAkBnC,CAAC;AAEL;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B,EAAE,SAAS;IACtC,2BAA2B,EAAE,SAAS;IACtC,kBAAkB,EAAE,QAAQ;IAC5B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,kCAAkC,EAAE,QAAQ;IAC5C,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,UAAU;IACjB,4FAA4F;IAC5F,6FAA6F;IAC7F,4CAA4C;CACZ,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAA2B;IACtD,aAAa,EAAE,UAAU;IACzB,cAAc,EAAE,UAAU;IAC1B,8FAA8F;IAC9F,cAAc,EAAE,QAAQ;IACxB,4FAA4F;IAC5F,mFAAmF;IACnF,eAAe,EAAE,SAAS;IAC1B,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,QAAQ;IACd,wBAAwB,EAAE,QAAQ;CACnC,CAAC;AAEF,qEAAqE;AACrE,SAAS,aAAa,CAAC,IAA+B;IACpD,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC/C,CA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OAAO;;;;;;;;;;;;;;;;;;;;;;;;CAwBR,CAAC;AACF,CAAC"}
|
package/dist/scaffold/project.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as fs from 'fs';
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import { CliError } from '../errors.js';
|
|
4
4
|
import { aliasSourceDir } from './aliases.js';
|
|
5
|
-
import { renderPackageJson, renderTsconfig, renderIndexHtml, renderViteConfig, renderVitePublishConfig, renderGitignore, renderBitmagicJson, renderAgentsMd, renderGameDesignMd, renderClaudeMd, renderJudgeSkill, renderSkillsReadme, renderGenerateSkill, renderPlanningSkill, renderEngineApiSkill, renderUsageSkill, } from './project-files.js';
|
|
5
|
+
import { renderPackageJson, renderTsconfig, renderIndexHtml, renderViteConfig, renderVitePublishConfig, renderVitePublishStandaloneConfig, renderGitignore, renderBitmagicJson, renderAgentsMd, renderGameDesignMd, renderClaudeMd, renderJudgeSkill, renderSkillsReadme, renderGenerateSkill, renderPlanningSkill, renderEngineApiSkill, renderUsageSkill, } from './project-files.js';
|
|
6
6
|
import { hashAgentsMd } from './agents-md.js';
|
|
7
7
|
import { CLAUDE_SETTINGS_FILE, renderClaudeSettings } from './claude-settings.js';
|
|
8
8
|
/**
|
|
@@ -154,6 +154,7 @@ export const PLATFORM_GENERATED_FILES = [
|
|
|
154
154
|
['tsconfig.json', renderTsconfig],
|
|
155
155
|
['vite.config.js', renderViteConfig],
|
|
156
156
|
['vite.publish.config.js', renderVitePublishConfig],
|
|
157
|
+
['vite.publish-standalone.config.js', renderVitePublishStandaloneConfig],
|
|
157
158
|
['index.html', renderIndexHtml],
|
|
158
159
|
['.claude/skills/README.md', renderSkillsReadme],
|
|
159
160
|
['.claude/skills/generating-assets/SKILL.md', renderGenerateSkill],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/scaffold/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACz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;IAED,iBAAiB,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IAEjD,2FAA2F;IAC3F,iGAAiG;IACjG,mGAAmG;IACnG,8CAA8C;IAC9C,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEtD,MAAM,KAAK,GAA4B;QACrC,CAAC,cAAc,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAChD,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACvF,CAAC,eAAe,EAAE,kBAAkB,CAAC,EAAE,GAAG,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC5F,CAAC,WAAW,EAAE,QAAQ,CAAC;QACvB,0FAA0F;QAC1F,6EAA6E;QAC7E,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,WAAW,EAAE,cAAc,EAAE,CAAC;QAC/B,CAAC,YAAY,EAAE,eAAe,EAAE,CAAC;QACjC,8FAA8F;QAC9F,+FAA+F;QAC/F,mCAAmC;QACnC,CAAC,oBAAoB,EAAE,oBAAoB,EAAE,CAAC;KAC/C,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC;QACrC,gBAAgB,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
|
|
@@ -6,6 +6,8 @@ export interface SuggestTemplateOptions {
|
|
|
6
6
|
token: string;
|
|
7
7
|
/** The creator's `--idea` pitch. */
|
|
8
8
|
idea: string;
|
|
9
|
+
/** The creator's own request, verbatim — recorded server-side for analytics, never used to pick. */
|
|
10
|
+
creatorPrompt?: string;
|
|
9
11
|
/** Every template this engine bundle carries — the model may only choose from these. */
|
|
10
12
|
templates: TemplateEntry[];
|
|
11
13
|
defaultTemplateId: string;
|
|
@@ -12,11 +12,12 @@ import { apiPost } from '../http/client.js';
|
|
|
12
12
|
* hallucinated id harmless rather than a scaffold from a directory that does not exist.
|
|
13
13
|
*/
|
|
14
14
|
export async function suggestTemplate(options) {
|
|
15
|
-
const { environment, token, idea, templates, defaultTemplateId, deps } = options;
|
|
15
|
+
const { environment, token, idea, creatorPrompt, templates, defaultTemplateId, deps } = options;
|
|
16
16
|
let response;
|
|
17
17
|
try {
|
|
18
18
|
response = await apiPost(environment, '/api/cli/v1/templates/suggest', token, {
|
|
19
19
|
idea,
|
|
20
|
+
...(creatorPrompt !== undefined ? { creatorPrompt } : {}),
|
|
20
21
|
defaultTemplateId,
|
|
21
22
|
templates: templates.map((t) => ({
|
|
22
23
|
id: t.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest-template.js","sourceRoot":"","sources":["../../src/scaffold/suggest-template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAgB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"suggest-template.js","sourceRoot":"","sources":["../../src/scaffold/suggest-template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAgB,MAAM,mBAAmB,CAAC;AA2B1D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAA+B;IAE/B,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEhG,IAAI,QAAyB,CAAC;IAC9B,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,OAAO,CACtB,WAAW,EACX,+BAA+B,EAC/B,KAAK,EACL;YACE,IAAI;YACJ,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,iBAAiB;YACjB,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC/B,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE;gBACpB,WAAW,EAAE,CAAC,CAAC,WAAW,IAAI,EAAE;gBAChC,KAAK,EAAE,CAAC,CAAC,KAAK;aACf,CAAC,CAAC;SACJ,EACD,IAAI,CACL,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;IAChC,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,EAAE,CAAC;QAClF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,UAAU;QACV,MAAM,EAAE,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;KAC1E,CAAC;AACJ,CAAC"}
|
|
@@ -54,11 +54,23 @@ export interface CommandContext {
|
|
|
54
54
|
startedAt: number;
|
|
55
55
|
/** See the module header: the stored access token at start, for the one command that removes it. */
|
|
56
56
|
tokenSnapshot: TokenSnapshot | null;
|
|
57
|
+
/**
|
|
58
|
+
* The creator's own request, once, for the whole command — `null` when the flag was absent or
|
|
59
|
+
* the creator opted out of telemetry.
|
|
60
|
+
*
|
|
61
|
+
* It is one value per invocation, so it is captured where every other per-invocation fact is
|
|
62
|
+
* captured rather than being handed down through each request builder. Threading it meant
|
|
63
|
+
* sixteen call sites had to remember to pass it, and the three that built their bodies through
|
|
64
|
+
* their own runners had already been given their own copy of the guard.
|
|
65
|
+
*/
|
|
66
|
+
creatorPrompt: string | null;
|
|
57
67
|
}
|
|
58
68
|
export interface BeginCommandInput {
|
|
59
69
|
name: string;
|
|
60
70
|
json: boolean;
|
|
61
71
|
explicitEnv?: string;
|
|
72
|
+
/** `--original-prompt`, as typed. See `creator-prompt.ts`. */
|
|
73
|
+
creatorPrompt?: string;
|
|
62
74
|
env?: Record<string, string | undefined>;
|
|
63
75
|
isTTY?: boolean;
|
|
64
76
|
now?: () => number;
|
|
@@ -100,6 +100,13 @@ export function beginCommand(input) {
|
|
|
100
100
|
environment,
|
|
101
101
|
startedAt: (input.now ?? Date.now)(),
|
|
102
102
|
tokenSnapshot: collect ? snapshotToken(environment, input.baseDir) : null,
|
|
103
|
+
// Gated on `collect` like the snapshots above: this is the one field the CLI sends that is a
|
|
104
|
+
// human's own prose rather than a fact about a command, so an opted-out creator must not have
|
|
105
|
+
// it forwarded. Dropping it HERE rather than at each request builder is what makes that true
|
|
106
|
+
// for every command at once, including any added later.
|
|
107
|
+
creatorPrompt: collect && typeof input.creatorPrompt === 'string' && input.creatorPrompt.trim().length > 0
|
|
108
|
+
? input.creatorPrompt.trim()
|
|
109
|
+
: null,
|
|
103
110
|
};
|
|
104
111
|
return current;
|
|
105
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-context.js","sourceRoot":"","sources":["../../src/telemetry/command-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAoB,MAAM,2BAA2B,CAAC;AAe3F,MAAM,iBAAiB,GAAgD,CAAC,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AAEvG,MAAM,UAAU,YAAY,CAAC,KAI5B;IACC,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,iBAAiB,EAAE,CAAC;QACjD,IAAI,KAAK,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CAAC,CAAC,mBAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrE,OAAO,GAAG;QACR,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QACpG,WAAW;QACX,SAAS,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE;QACpC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;QACzE,6FAA6F;QAC7F,8FAA8F;QAC9F,6FAA6F;QAC7F,wDAAwD;QACxD,aAAa,EAAE,OAAO,IAAI,OAAO,KAAK,CAAC,aAAa,KAAK,QAAQ,IAAI,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;YACxG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE;YAC5B,CAAC,CAAC,IAAI;KACT,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAAU,cAAc;IAC5B,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,2BAA2B;IACzC,OAAO,GAAG,IAAI,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--original-prompt`: the creator's request in their own words.
|
|
3
|
+
*
|
|
4
|
+
* Every command that takes it — `init`, `forge`, `cover`, and the ten
|
|
5
|
+
* `generate` subcommands — declares the flag from here and builds the wire
|
|
6
|
+
* field with the one function below, because the four hand-rolled copies this
|
|
7
|
+
* replaced had already drifted: three disagreed with the other seven about
|
|
8
|
+
* whether an empty string counts, and none of them honoured `DO_NOT_TRACK`.
|
|
9
|
+
*
|
|
10
|
+
* The wire field is `creatorPrompt`, deliberately NOT `originalUserPrompt`.
|
|
11
|
+
* That name already means something on the forge lane —
|
|
12
|
+
* `ForgeJobInput.originalUserPrompt` is fed to the director and the designer
|
|
13
|
+
* and is persisted onto the level asset as `worldForgerUserPrompt` — so
|
|
14
|
+
* reusing it made a flag documented as inert change what got built. One name,
|
|
15
|
+
* one meaning: `creatorPrompt` is analytics-only on every lane.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ORIGINAL_PROMPT_FLAG: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The creator's own words as the wire field, or nothing.
|
|
23
|
+
*
|
|
24
|
+
* Reads the running command rather than taking the value from its caller: `--original-prompt` is
|
|
25
|
+
* one value per invocation, captured once in `beginCommand` (which is also where `DO_NOT_TRACK`
|
|
26
|
+
* drops it), so a request builder does not need to be handed it. `override` exists for tests and
|
|
27
|
+
* for the one caller that has a value but no running command.
|
|
28
|
+
*
|
|
29
|
+
* Returns nothing when no command is running — a module called directly by a test, never the CLI.
|
|
30
|
+
*/
|
|
31
|
+
export declare function creatorPromptField(override?: unknown): {
|
|
32
|
+
creatorPrompt: string;
|
|
33
|
+
} | Record<string, never>;
|
|
34
|
+
/** `body` plus the creator's own words, when the flag was given and telemetry is on. */
|
|
35
|
+
export declare function withParent(body: Record<string, unknown>): Record<string, unknown>;
|