@bitmagic/cli 0.1.53-dev.1 → 0.1.53-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -29
- 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 +27 -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/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 +31 -4
- package/dist/commands/publish.js +86 -15
- 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/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.js +44 -27
- package/dist/scaffold/project-files.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
|
@@ -396,45 +396,49 @@ export function renderBitmagicJson(metadata) {
|
|
|
396
396
|
return renderJson(metadata);
|
|
397
397
|
}
|
|
398
398
|
/**
|
|
399
|
-
* The "Updating the bitmagic CLI" section, which
|
|
400
|
-
* still being asked.
|
|
399
|
+
* The "Updating the bitmagic CLI" section, which used to have two jobs and now has one.
|
|
401
400
|
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
401
|
+
* It began as an answer to a question the project already answered: an agent told to update the CLI
|
|
402
|
+
* had two published lines to choose from, nothing in the project naming one, and so asked the
|
|
403
|
+
* creator "dev or prod?". The section baked in the right `npm i -g` for the pin and forbade the
|
|
404
|
+
* question.
|
|
406
405
|
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
406
|
+
* That instruction was right about the line and wrong about the mechanism. A printed `npm i -g` is
|
|
407
|
+
* run by whatever `npm` the agent's shell resolves, and a coding agent's non-interactive shell
|
|
408
|
+
* sources no profile — under nvm it gets a different node's npm, installs into a prefix nothing on
|
|
409
|
+
* PATH points at, and reports success while `bitmagic --version` never moves. `bitmagic
|
|
410
|
+
* self-update` resolves its own install from the running process and reads the pin itself, so the
|
|
411
|
+
* whole two-line explanation collapses into one command that cannot be aimed at the wrong place or
|
|
412
|
+
* the wrong line. What remains of the old paragraph is the *why*, which an agent still needs when
|
|
413
|
+
* something looks wrong — not a choice for it to make.
|
|
410
414
|
*
|
|
411
|
-
* `environment` is undefined for a project scaffolded before the pin existed.
|
|
412
|
-
*
|
|
413
|
-
*
|
|
415
|
+
* `environment` is undefined for a project scaffolded before the pin existed. The command still
|
|
416
|
+
* works there (it falls back to the line the installed build is on), so that case only loses the
|
|
417
|
+
* sentence naming this project's environment.
|
|
414
418
|
*/
|
|
415
419
|
function renderCliUpdateSection(environment) {
|
|
416
|
-
const install = environment === 'prod' ? 'npm i -g @bitmagic/cli' : 'npm i -g @bitmagic/cli@dev';
|
|
417
420
|
const here = environment === undefined
|
|
418
421
|
? `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\`),
|
|
422
|
+
Run \`bitmagic upgrade\` once to stamp one, and \`bitmagic whoami\` to see what the CLI resolves in
|
|
423
|
+
the meantime; until there is a pin, \`self-update\` keeps you on the line your installed build is
|
|
424
|
+
already on.`
|
|
425
|
+
: `This project is on the **${environment}** environment (\`environment\` in \`bitmagic.json\`), and the command reads that pin itself.`;
|
|
426
|
+
return `## Updating the bitmagic CLI
|
|
423
427
|
|
|
424
428
|
\`\`\`
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
return `## Updating the bitmagic CLI
|
|
429
|
+
bitmagic self-update
|
|
430
|
+
\`\`\`
|
|
428
431
|
|
|
429
432
|
${here}
|
|
430
433
|
|
|
431
|
-
**Never ask which line to install,
|
|
432
|
-
\`
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
with this paragraph, the file is right. The engine is a
|
|
434
|
+
**Never ask which line to install, never offer the choice, and never update with \`npm i -g @bitmagic/cli\`** —
|
|
435
|
+
\`self-update\` reinstalls into the exact place this CLI lives, using the node running it, which the \`npm\` on
|
|
436
|
+
your PATH may not be; under nvm it usually is not, and the install lands in another prefix while
|
|
437
|
+
\`bitmagic --version\` never moves. The lines are not interchangeable (\`dev\` and \`local\` take the prerelease
|
|
438
|
+
built against the dev api-server, \`prod\` the release), and the wrong one fails as opaque command errors
|
|
439
|
+
rather than version warnings — so run \`self-update\` before debugging a command that started failing
|
|
440
|
+
strangely. If \`bitmagic.json\` ever disagrees with this paragraph, the file is right. The engine is a
|
|
441
|
+
separate command: \`bitmagic upgrade\`.`;
|
|
438
442
|
}
|
|
439
443
|
export function renderAgentsMd(environment) {
|
|
440
444
|
return `# Working on this Bitmagic game
|
|
@@ -774,6 +778,11 @@ Follow this order; \`publish\` enforces it and refuses otherwise:
|
|
|
774
778
|
3. Run \`bitmagic publish\`. It rebuilds automatically if the project changed since the last
|
|
775
779
|
build, so a manual \`bitmagic build\` first is optional.
|
|
776
780
|
|
|
781
|
+
**Show your creator the QR code.** Publish turns the game's URL into a scannable image. Your
|
|
782
|
+
output is a pipe, so it cannot be drawn in the terminal: publish writes \`.bitmagic/publish-qr.png\`
|
|
783
|
+
and names it (\`qrPath\` under \`--json\`). Surface that image like any artifact you made — scanning
|
|
784
|
+
it opens the game on a phone, and a bare URL leaves your creator retyping a game id into a browser.
|
|
785
|
+
|
|
777
786
|
**A bare \`bitmagic publish\` does not make the game public.** Every publish uploads and
|
|
778
787
|
registers the game, but \`visibility\` defaults to \`private\` — reachable by URL, not listed on
|
|
779
788
|
bitmagic.ai. Pass \`--visibility public\` explicitly, on that call, to list it; omit it on a later
|
|
@@ -837,6 +846,8 @@ bitmagic generate vehicle --prompt "a rusty orange pickup" | --preset VAN
|
|
|
837
846
|
|
|
838
847
|
Run \`bitmagic generate <type> --help\` for the full flags of any one.
|
|
839
848
|
|
|
849
|
+
**Always add \`--original-prompt "<creator's request, verbatim>"\`** — analytics only, never affects output.
|
|
850
|
+
|
|
840
851
|
Four things worth knowing before you use these:
|
|
841
852
|
|
|
842
853
|
1. **Each generation writes to \`src/work/world.json\`.** If you are also editing that file,
|
|
@@ -1285,6 +1296,12 @@ The \`bitmagic\` CLI generates content directly into this project. Nine types wo
|
|
|
1285
1296
|
|
|
1286
1297
|
\`--help\` on any subcommand lists its full flags.
|
|
1287
1298
|
|
|
1299
|
+
**Every one of these (and \`bitmagic forge\` / \`bitmagic cover\`) also takes
|
|
1300
|
+
\`--original-prompt "<the creator's request, verbatim>"\` — always pass it.** It is the exact
|
|
1301
|
+
words the creator used when they asked you, recorded for Bitmagic's analytics only; it never
|
|
1302
|
+
reaches the generator, so it cannot change the output. Skip it only when no creator request is
|
|
1303
|
+
behind the call.
|
|
1304
|
+
|
|
1288
1305
|
\`animation\` is the one that takes no prompt at all: the clip is built from an authored parameter
|
|
1289
1306
|
spec in one of three families — \`gait\` (the only one with a flag form), \`melee\` and \`oneShot\`
|
|
1290
1307
|
(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;;;;;;;;;;;;;;;;GAgBG;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;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DR,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6CR,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAa;IAC9C,MAAM,KAAK,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3B,OAAO;;EAEP,KAAK;QACH,CAAC,CAAC,8GAA8G;QAChH,CAAC,CAAC,0KAA0K;;;;EAI9K,KAAK,IAAI,iEAAiE;;;;;;;;;;;;;;CAc3E,CAAC;AACF,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;CAwBR,CAAC;AACF,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,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC;IACvC,CAAC;IACD,IAAI,KAAK,CAAC,IAAI;QAAE,OAAO,MAAM,CAAC;IAC9B,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;AACtC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAuC;IACzE,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;I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,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>;
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
import { currentCommand } from './command-context.js';
|
|
18
|
+
export const ORIGINAL_PROMPT_FLAG = {
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: "The creator's request in their own words, verbatim. Recorded for analytics only — "
|
|
21
|
+
+ 'it never influences what is produced. Agents: always pass this.',
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The creator's own words as the wire field, or nothing.
|
|
25
|
+
*
|
|
26
|
+
* Reads the running command rather than taking the value from its caller: `--original-prompt` is
|
|
27
|
+
* one value per invocation, captured once in `beginCommand` (which is also where `DO_NOT_TRACK`
|
|
28
|
+
* drops it), so a request builder does not need to be handed it. `override` exists for tests and
|
|
29
|
+
* for the one caller that has a value but no running command.
|
|
30
|
+
*
|
|
31
|
+
* Returns nothing when no command is running — a module called directly by a test, never the CLI.
|
|
32
|
+
*/
|
|
33
|
+
export function creatorPromptField(override) {
|
|
34
|
+
const value = override ?? currentCommand()?.creatorPrompt;
|
|
35
|
+
// citty hands back `true` for the space form of a flag the command did not declare.
|
|
36
|
+
return typeof value === 'string' && value.trim().length > 0 ? { creatorPrompt: value.trim() } : {};
|
|
37
|
+
}
|
|
38
|
+
/** `body` plus the creator's own words, when the flag was given and telemetry is on. */
|
|
39
|
+
export function withParent(body) {
|
|
40
|
+
const field = creatorPromptField();
|
|
41
|
+
// Returns `body` itself when there is nothing to add: callers pass a body a `build*Body` helper
|
|
42
|
+
// has already validated, and a needless copy is a needless difference for a caller to notice.
|
|
43
|
+
return 'creatorPrompt' in field ? { ...body, ...field } : body;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=creator-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creator-prompt.js","sourceRoot":"","sources":["../../src/telemetry/creator-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,oFAAoF;UAC7F,iEAAiE;CAC7D,CAAC;AAEX;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAkB;IACnD,MAAM,KAAK,GAAG,QAAQ,IAAI,cAAc,EAAE,EAAE,aAAa,CAAC;IAC1D,oFAAoF;IACpF,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACrG,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,UAAU,CAAC,IAA6B;IACtD,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAC;IACnC,gGAAgG;IAChG,8FAA8F;IAC9F,OAAO,eAAe,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACjE,CAAC"}
|
package/dist/update/check.js
CHANGED
|
@@ -116,7 +116,8 @@ export async function refreshUpdateCacheInBackground(currentVersion, now = Date.
|
|
|
116
116
|
const tag = updateTagFor(currentVersion);
|
|
117
117
|
const cache = readUpdateCache(baseDir);
|
|
118
118
|
// A cache about the other line is refreshed immediately however recent it is — switching lines
|
|
119
|
-
// with `
|
|
119
|
+
// with `bitmagic self-update --tag dev` must not leave the nudge mute for the rest of its
|
|
120
|
+
// interval.
|
|
120
121
|
if (cache !== null && cache.tag === tag && !isCacheStale(cache, now))
|
|
121
122
|
return;
|
|
122
123
|
const latest = await fetchTagVersion(tag, fetchImpl);
|
package/dist/update/check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/update/check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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,kBAA+C,EAC/C,OAAgB;IAEhB,MAAM,QAAQ,GACZ,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;IACtG,OAAO,QAAQ,IAAI,mBAAmB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,cAAsB,EACtB,MAAc,IAAI,CAAC,GAAG,EAAE,EACxB,OAAgB,EAChB,YAAqC,UAAU,CAAC,KAAK;IAErD,MAAM,GAAG,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,+FAA+F;IAC/F,0FAA0F;IAC1F,YAAY;IACZ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC;QAAE,OAAO;IAC7E,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACrD,+FAA+F;IAC/F,6CAA6C;IAC7C,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC"}
|
package/dist/update/notice.d.ts
CHANGED
|
@@ -10,8 +10,38 @@ export type UpdateTag = 'latest' | 'dev';
|
|
|
10
10
|
* release as "newer" for half a patch cycle and never mention the dev build that fixes things.
|
|
11
11
|
*/
|
|
12
12
|
export declare function updateTagFor(version: string): UpdateTag;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* How to install the line a build is already on, from scratch, with npm.
|
|
15
|
+
*
|
|
16
|
+
* Now only for the cases that genuinely mean a FIRST install — the README, the portal's /pro page,
|
|
17
|
+
* and `reset-account`'s "start over where a new creator starts" — where there is no bitmagic on
|
|
18
|
+
* the machine to run anything. Everything that updates an EXISTING install names
|
|
19
|
+
* `SELF_UPDATE_COMMAND` instead, for the reason spelled out there.
|
|
20
|
+
*/
|
|
14
21
|
export declare function installCommandFor(tag: UpdateTag): string;
|
|
22
|
+
/**
|
|
23
|
+
* What every update nudge names, and the one command that reliably lands.
|
|
24
|
+
*
|
|
25
|
+
* A printed `npm i -g` is run by whatever `npm` the reading shell resolves, which on a machine
|
|
26
|
+
* using nvm is routinely not the one that owns this install: a coding agent's non-interactive
|
|
27
|
+
* shell sources no profile, nvm never loads, and the install goes to a prefix nobody's PATH points
|
|
28
|
+
* at while npm reports success. `bitmagic self-update` resolves its own install from
|
|
29
|
+
* `process.execPath` and asks the shell nothing (see update/self-install.ts).
|
|
30
|
+
*
|
|
31
|
+
* Naming a bitmagic command in a message printed BY bitmagic is safe by construction: the binary
|
|
32
|
+
* is on that shell's PATH, because it just ran there. That is exactly the guarantee the npm line
|
|
33
|
+
* never had.
|
|
34
|
+
*/
|
|
35
|
+
export declare const SELF_UPDATE_COMMAND = "bitmagic self-update";
|
|
36
|
+
/**
|
|
37
|
+
* The same command when it has to cross lines.
|
|
38
|
+
*
|
|
39
|
+
* `self-update` reads a project's pin itself, so inside a project the bare form already does the
|
|
40
|
+
* right thing — but the mismatch notice is also printed outside one, and it is the single message
|
|
41
|
+
* whose whole subject is which line you should be on. Saying it out loud costs nothing and leaves
|
|
42
|
+
* nothing to infer.
|
|
43
|
+
*/
|
|
44
|
+
export declare function crossLineUpdateCommand(tag: UpdateTag): string;
|
|
15
45
|
/**
|
|
16
46
|
* What to call a line in a sentence.
|
|
17
47
|
*
|
package/dist/update/notice.js
CHANGED
|
@@ -10,10 +10,42 @@ import { isOlderSemverVersion } from '../project/version-compare.js';
|
|
|
10
10
|
export function updateTagFor(version) {
|
|
11
11
|
return version.includes('-') ? 'dev' : 'latest';
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* How to install the line a build is already on, from scratch, with npm.
|
|
15
|
+
*
|
|
16
|
+
* Now only for the cases that genuinely mean a FIRST install — the README, the portal's /pro page,
|
|
17
|
+
* and `reset-account`'s "start over where a new creator starts" — where there is no bitmagic on
|
|
18
|
+
* the machine to run anything. Everything that updates an EXISTING install names
|
|
19
|
+
* `SELF_UPDATE_COMMAND` instead, for the reason spelled out there.
|
|
20
|
+
*/
|
|
14
21
|
export function installCommandFor(tag) {
|
|
15
22
|
return tag === 'dev' ? 'npm i -g @bitmagic/cli@dev' : 'npm i -g @bitmagic/cli';
|
|
16
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* What every update nudge names, and the one command that reliably lands.
|
|
26
|
+
*
|
|
27
|
+
* A printed `npm i -g` is run by whatever `npm` the reading shell resolves, which on a machine
|
|
28
|
+
* using nvm is routinely not the one that owns this install: a coding agent's non-interactive
|
|
29
|
+
* shell sources no profile, nvm never loads, and the install goes to a prefix nobody's PATH points
|
|
30
|
+
* at while npm reports success. `bitmagic self-update` resolves its own install from
|
|
31
|
+
* `process.execPath` and asks the shell nothing (see update/self-install.ts).
|
|
32
|
+
*
|
|
33
|
+
* Naming a bitmagic command in a message printed BY bitmagic is safe by construction: the binary
|
|
34
|
+
* is on that shell's PATH, because it just ran there. That is exactly the guarantee the npm line
|
|
35
|
+
* never had.
|
|
36
|
+
*/
|
|
37
|
+
export const SELF_UPDATE_COMMAND = 'bitmagic self-update';
|
|
38
|
+
/**
|
|
39
|
+
* The same command when it has to cross lines.
|
|
40
|
+
*
|
|
41
|
+
* `self-update` reads a project's pin itself, so inside a project the bare form already does the
|
|
42
|
+
* right thing — but the mismatch notice is also printed outside one, and it is the single message
|
|
43
|
+
* whose whole subject is which line you should be on. Saying it out loud costs nothing and leaves
|
|
44
|
+
* nothing to infer.
|
|
45
|
+
*/
|
|
46
|
+
export function crossLineUpdateCommand(tag) {
|
|
47
|
+
return `${SELF_UPDATE_COMMAND} --tag ${tag}`;
|
|
48
|
+
}
|
|
17
49
|
/**
|
|
18
50
|
* What to call a line in a sentence.
|
|
19
51
|
*
|
|
@@ -98,9 +130,11 @@ export function cliUpdateNotice(currentVersion, latestVersion) {
|
|
|
98
130
|
return null;
|
|
99
131
|
if (isOlderSemverVersion(currentVersion, latestVersion) !== true)
|
|
100
132
|
return null;
|
|
101
|
-
//
|
|
102
|
-
|
|
103
|
-
|
|
133
|
+
// No `--tag` here: this notice is by definition about the line the build is already on, and
|
|
134
|
+
// `self-update` outside a project defaults to exactly that. A tester on a prerelease stays on the
|
|
135
|
+
// prerelease line, which is the guarantee the old per-line npm string existed to give.
|
|
136
|
+
return (`A newer bitmagic CLI is available: ${latestVersion} (you have ${currentVersion}). ` +
|
|
137
|
+
`Run \`${SELF_UPDATE_COMMAND}\` to update.`);
|
|
104
138
|
}
|
|
105
139
|
/**
|
|
106
140
|
* The line to say when the CLI running inside a project came from the other one.
|
|
@@ -123,6 +157,6 @@ export function cliLineMismatchNotice(currentVersion, projectEnvironment) {
|
|
|
123
157
|
return null;
|
|
124
158
|
return (`This project is on the ${projectEnvironment} environment, so its CLI comes from the ` +
|
|
125
159
|
`${describeUpdateTag(wanted)} line — but you are running a ${describeUpdateTag(installed)} ` +
|
|
126
|
-
`build (${currentVersion}). Run \`${
|
|
160
|
+
`build (${currentVersion}). Run \`${crossLineUpdateCommand(wanted)}\`.`);
|
|
127
161
|
}
|
|
128
162
|
//# sourceMappingURL=notice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice.js","sourceRoot":"","sources":["../../src/update/notice.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAKrE;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AAClD,CAAC;AAED
|
|
1
|
+
{"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