@bitmagic/cli 0.1.53-dev.2 → 0.1.53-dev.3
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 +15 -11
- package/dist/cli.d.ts +12 -0
- package/dist/cli.js +16 -1
- package/dist/cli.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/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 +3 -0
- package/dist/commands/generate.js +21 -7
- 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/generate/model.d.ts +2 -0
- package/dist/generate/model.js +6 -1
- package/dist/generate/model.js.map +1 -1
- package/dist/generate/prop.d.ts +2 -0
- package/dist/generate/prop.js +2 -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/scaffold/project-files.js +8 -0
- 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/package.json +4 -4
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitmagic/cli",
|
|
3
|
-
"version": "0.1.53-dev.
|
|
3
|
+
"version": "0.1.53-dev.3",
|
|
4
4
|
"description": "Build Bitmagic games from your own agent tool",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Bitmagic Oy",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"fflate": "^0.8.2",
|
|
24
24
|
"playwright-core": "^1.59.1",
|
|
25
25
|
"tar": "^7.4.3",
|
|
26
|
-
"@bitmagic/
|
|
27
|
-
"@bitmagic/
|
|
28
|
-
"@bitmagic/
|
|
26
|
+
"@bitmagic/asset-core": "0.2.8-dev.3",
|
|
27
|
+
"@bitmagic/world-forger": "0.1.13-dev.3",
|
|
28
|
+
"@bitmagic/animation-forger": "0.1.8-dev.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@eslint/js": "^9.38.0",
|