@bitmagic/cli 0.1.65-dev.19 → 0.1.65-dev.2
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 +13 -127
- package/dist/assets/materials.d.ts +0 -9
- package/dist/assets/materials.js +2 -10
- package/dist/assets/materials.js.map +1 -1
- package/dist/cli.d.ts +0 -9
- package/dist/cli.js +0 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/forge.d.ts +0 -15
- package/dist/commands/forge.js +38 -143
- package/dist/commands/forge.js.map +1 -1
- package/dist/commands/generate.d.ts +13 -31
- package/dist/commands/generate.js +56 -48
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/trailer.js +1 -1
- package/dist/commands/trailer.js.map +1 -1
- package/dist/editor/asset-viewer.js +8 -31
- package/dist/editor/asset-viewer.js.map +1 -1
- package/dist/forge/run-pipeline.js +1 -5
- package/dist/forge/run-pipeline.js.map +1 -1
- package/dist/forge/stream.d.ts +1 -5
- package/dist/forge/stream.js +0 -4
- package/dist/forge/stream.js.map +1 -1
- package/dist/mobile/asset-hosts.d.ts +9 -7
- package/dist/mobile/asset-hosts.js +16 -7
- package/dist/mobile/asset-hosts.js.map +1 -1
- package/dist/scaffold/blender-level-skill-files.js +2 -3
- package/dist/scaffold/blender-level-skill-files.js.map +1 -1
- package/dist/scaffold/project-files.js +12 -16
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/scaffold/project.js +1 -4
- package/dist/scaffold/project.js.map +1 -1
- package/dist/scaffold/skill-files.d.ts +5 -32
- package/dist/scaffold/skill-files.js +63 -102
- package/dist/scaffold/skill-files.js.map +1 -1
- package/dist/telemetry/creator-prompt.d.ts +2 -18
- package/dist/telemetry/creator-prompt.js +3 -24
- package/dist/telemetry/creator-prompt.js.map +1 -1
- package/dist/telemetry/report.js +16 -31
- package/dist/telemetry/report.js.map +1 -1
- package/package.json +4 -4
- package/assets/skills/trailer-craft.md +0 -180
- package/dist/commands/character.d.ts +0 -18
- package/dist/commands/character.js +0 -268
- package/dist/commands/character.js.map +0 -1
- package/dist/forge/edit-target.d.ts +0 -30
- package/dist/forge/edit-target.js +0 -88
- package/dist/forge/edit-target.js.map +0 -1
- package/dist/forge/prune-store.d.ts +0 -46
- package/dist/forge/prune-store.js +0 -86
- package/dist/forge/prune-store.js.map +0 -1
- package/dist/forge/remote-store.d.ts +0 -36
- package/dist/forge/remote-store.js +0 -113
- package/dist/forge/remote-store.js.map +0 -1
- package/dist/generate/character-body.d.ts +0 -79
- package/dist/generate/character-body.js +0 -100
- package/dist/generate/character-body.js.map +0 -1
- package/dist/project/character-search.d.ts +0 -30
- package/dist/project/character-search.js +0 -82
- package/dist/project/character-search.js.map +0 -1
- package/dist/scaffold/asset-pipeline-skill-files.d.ts +0 -38
- package/dist/scaffold/asset-pipeline-skill-files.js +0 -202
- package/dist/scaffold/asset-pipeline-skill-files.js.map +0 -1
|
@@ -11,17 +11,7 @@
|
|
|
11
11
|
* `project-files.test.ts` enforces the frontmatter (name == directory) and that AGENTS.md names
|
|
12
12
|
* every shipped skill. The same template-literal rule applies: the markdown is full of backticks,
|
|
13
13
|
* so every one inside is escaped as \` and the test checks the rendered output.
|
|
14
|
-
*
|
|
15
|
-
* One renderer here breaks the template-literal rule on purpose: `renderTrailerCraftReference`
|
|
16
|
-
* reads `assets/skills/trailer-craft.md`, because that file is the SOURCE OF TRUTH for trailer
|
|
17
|
-
* craft in two places at once — the skill scaffolded into a creator's project, and the monorepo's
|
|
18
|
-
* own `make-trailer` skill, which symlinks to the same file. Craft is the half of trailer guidance
|
|
19
|
-
* that is not about commands, so both readers need all of it and neither owns it; a second copy
|
|
20
|
-
* would drift the moment either was edited, and the drift is silent (both files still look like
|
|
21
|
-
* guidance). A shipped asset is the only shape that lets a symlink do the sharing.
|
|
22
14
|
*/
|
|
23
|
-
import fs from 'node:fs';
|
|
24
|
-
import { fileURLToPath } from 'node:url';
|
|
25
15
|
import { describeSkillsDir } from './agent-targets.js';
|
|
26
16
|
/**
|
|
27
17
|
* `.kiro/steering/bitmagic.md` — Kiro's startup instructions, and the only per-agent extra file
|
|
@@ -85,10 +75,10 @@ See \`AGENTS.md\` at the project root for the guidance an agent should read befo
|
|
|
85
75
|
${alsoWritten}
|
|
86
76
|
## Which of these are yours
|
|
87
77
|
|
|
88
|
-
\`planning-a-game/\`, \`finding-engine-apis/\`, \`generating-assets/\`, \`
|
|
89
|
-
\`
|
|
90
|
-
\`
|
|
91
|
-
|
|
78
|
+
\`planning-a-game/\`, \`finding-engine-apis/\`, \`generating-assets/\`, \`checking-usage/\`,
|
|
79
|
+
\`judging-quality/\`, \`theming-the-hud/\`, \`making-a-trailer/\`, \`publishing-a-game/\`,
|
|
80
|
+
\`working-with-the-creator/\`, \`converting-unity-levels/\`, \`building-levels-in-blender/\` — and
|
|
81
|
+
this README — are shipped by the Bitmagic CLI and **re-rendered by \`bitmagic upgrade\`**. They
|
|
92
82
|
describe what the CLI and the engine can do, so they have to stay current with both; edits to them
|
|
93
83
|
are lost on the next upgrade.
|
|
94
84
|
|
|
@@ -97,7 +87,6 @@ are lost on the next upgrade.
|
|
|
97
87
|
| \`planning-a-game/\` | starting a game, a genre, or anything touching more than one gameplay feature — scoping the first playable slice and writing \`mechanics-plan.md\` |
|
|
98
88
|
| \`finding-engine-apis/\` | you need an engine API and do not know its name or signature, or \`bitmagic check\` cannot resolve a symbol |
|
|
99
89
|
| \`generating-assets/\` | the game needs a skybox, a background, a custom block type, sound, music, image, character, animation or vehicle |
|
|
100
|
-
| \`choosing-asset-pipelines/\` | deciding HOW to make something — which command, skill, file or free built-in fits a level, character, prop, vehicle, weapon, sky, block, image, animation, audio or cutscene need, roughly what it costs in sparks and minutes, and when to ask the creator before an expensive one |
|
|
101
90
|
| \`checking-usage/\` | asked what sparks were spent on, how much Pro allowance is left, or whether there is enough left to keep generating |
|
|
102
91
|
| \`judging-quality/\` | a milestone is done and the game deserves an independent quality verdict — \`bitmagic judge\` |
|
|
103
92
|
| \`theming-the-hud/\` | any ask about the game's LOOK — colors, fonts, rounder/sharper, outlines, glow, glossy, mobile-button styling |
|
|
@@ -116,14 +105,11 @@ in \`AGENTS.md\` — both are left alone.
|
|
|
116
105
|
* `<skills dir>/making-a-trailer/SKILL.md` — the whole trailer flow, and the craft that makes a
|
|
117
106
|
* cut watchable.
|
|
118
107
|
*
|
|
119
|
-
* Two kinds of knowledge live here on purpose
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* (\`renderTrailerCraftReference\`) because it is longer than the flow and read once per trailer
|
|
125
|
-
* rather than once per command. The tuning table at the end is the part the creator actually
|
|
126
|
-
* experiences: a prompt in, a shots.json edit out, one command to see it.
|
|
108
|
+
* Two kinds of knowledge live here on purpose. The FLOW (record → make → look → publish) is plain
|
|
109
|
+
* command routing an agent could read off \`--help\`. The CRAFT — ordering, pacing, the five variety
|
|
110
|
+
* axes, the selection rules the repo's own trailer reviews paid for — is not derivable from any
|
|
111
|
+
* command, and without it the agent's "tuning" is random. The tuning table at the end is the part
|
|
112
|
+
* the creator actually experiences: a prompt in, a shots.json edit out, one command to see it.
|
|
127
113
|
*/
|
|
128
114
|
export function renderTrailerSkill() {
|
|
129
115
|
return `---
|
|
@@ -142,43 +128,19 @@ and running one command again.
|
|
|
142
128
|
|
|
143
129
|
1. **Have \`bitmagic dev\` running** (it is the sink the recorder streams frames to, and the HUD
|
|
144
130
|
replay for \`--ui\`). ffmpeg and Google Chrome must be installed; the commands say so if not.
|
|
145
|
-
2. **Record
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
becomes 30 s of footage (the command reports both). After stop the frames are extracted from the
|
|
159
|
-
capture; the command waits for that. Aim for about 3x the trailer length: a 30 s trailer wants
|
|
160
|
-
90 s of footage, so \`--seconds 120\` or two sittings.
|
|
161
|
-
|
|
162
|
-
**A fly-through needs nobody.** \`--flythrough\` clicks through the menu and Play itself, then
|
|
163
|
-
glides the camera along an authored path WHILE THE GAME RUNS — traffic drives, animations play,
|
|
164
|
-
physics ticks — and stops at the last marker. It is the whole trailer flow with no human in it,
|
|
165
|
-
so reach for it when the creator is not around, when you are working on your own, or when they
|
|
166
|
-
would rather not be filmed playing badly.
|
|
167
|
-
|
|
168
|
-
**Offer it even when there IS gameplay.** A chase camera almost never gives you the two shots
|
|
169
|
-
the craft doc asks for by name — a composed cold open and one calm wide breath before the end —
|
|
170
|
-
and a fly-through costs the creator nothing. Record a short one as well and join the two:
|
|
171
|
-
|
|
172
|
-
\`\`\`
|
|
173
|
-
bitmagic trailer merge <gameplay-dir> <flythrough-dir> --out <dir>
|
|
174
|
-
\`\`\`
|
|
175
|
-
|
|
176
|
-
\`merge\` is how two sittings become one cuttable recording, and it does not care how the
|
|
177
|
-
footage was made — only that the runs share a resolution and post-processing state. So the cut
|
|
178
|
-
can pull an establishing shot from the fly-through and everything else from play.
|
|
179
|
-
Tell the creator the offer in one line ("I can also fly a camera through the level for the
|
|
180
|
-
opening shot — you don't have to do anything"), and write the path yourself from the level you
|
|
181
|
-
built: \`world.json\` has the coordinates.
|
|
131
|
+
2. **Record.** \`bitmagic trailer record --seconds 60\` opens Chrome on the dev view, waits for the
|
|
132
|
+
creator to press Play, starts the recorder for them, stops after 60 s (or when they press F9),
|
|
133
|
+
and prints the recording directory. Ask the creator to PLAY WELL — the trailer is only as good
|
|
134
|
+
as the footage: overtakes, jumps, kills, close calls, a finish. \`--seconds\` is wall-clock; the
|
|
135
|
+
recording counts FRAMES at 60 fps, and the game runs as fast as the machine encodes them — on a
|
|
136
|
+
machine capturing at 30 fps, 60 s of play becomes 30 s of footage (the command reports both).
|
|
137
|
+
After stop the frames are extracted from the capture; the command waits for that. Aim for
|
|
138
|
+
footage of about 3x the trailer length: a 30 s trailer wants
|
|
139
|
+
90 s of footage, so \`--seconds 120\` or two sittings. Two sittings?
|
|
140
|
+
\`bitmagic trailer merge <dirA> <dirB> --out <dir>\`.
|
|
141
|
+
No human available: author \`trailer/flythrough.json\` (below) and
|
|
142
|
+
\`bitmagic trailer record --flythrough trailer/flythrough.json\` records a camera path with
|
|
143
|
+
nobody playing — scenery trailers, world reveals.
|
|
182
144
|
3. **Make.** \`bitmagic trailer make --music-prompt "<style that fits the game>" --title "<name>"\`
|
|
183
145
|
analyzes the recording, generates a music bed (sparks — say so to the creator; \`--music <file>\`
|
|
184
146
|
uses their own track, \`--no-music\` skips it), writes a first cut to \`trailer/shots.json\`,
|
|
@@ -201,7 +163,7 @@ cut before delivering.
|
|
|
201
163
|
| File | What it is |
|
|
202
164
|
|---|---|
|
|
203
165
|
| \`trailer/shots.json\` | **The cut.** Committed. Your edits live here; \`make\` re-cuts from it every run. |
|
|
204
|
-
| \`trailer/flythrough.json\` |
|
|
166
|
+
| \`trailer/flythrough.json\` | Optional camera path for a no-human recording. |
|
|
205
167
|
| \`.bitmagic/trailer/recordings/<name>/\` | A recording: \`<name>_%06d.png\` at 60 fps + \`timeline.json\` (events, sounds, HUD). |
|
|
206
168
|
| \`.bitmagic/trailer/<name>/analysis.json\` | Scored highlight windows: \`startFrame\`, \`endFrame\`, \`score\`, event digests (\`"f3121 explosion i0.9"\`), \`sheet\`. |
|
|
207
169
|
| \`.bitmagic/trailer/<name>/sheets/\` | Contact sheets, one per window — read these. |
|
|
@@ -238,26 +200,46 @@ seconds or \`"last-clip"\` for the end card. \`bitmagic trailer cut\` turns this
|
|
|
238
200
|
|
|
239
201
|
Positions are world units (\`engine/agent-docs/coordinate-system.md\`); \`timestamp\` is seconds,
|
|
240
202
|
ascending from 0; \`lookAt\` (or an Euler \`rotation\`) per marker. The camera glides through the
|
|
241
|
-
markers and the recording stops at the last one
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
203
|
+
markers and the recording stops at the last one.
|
|
204
|
+
|
|
205
|
+
## Craft — read before touching the cut
|
|
206
|
+
|
|
207
|
+
**Order: Genre → Hook → Anchors → Content.** The first 1–2 shots must say what kind of game this
|
|
208
|
+
is. The hook — the thing only this game has — lands inside the first third. The middle holds the
|
|
209
|
+
anchors people expect from the genre; breadth (levels, modes) comes last.
|
|
210
|
+
|
|
211
|
+
**Skeleton first, footage last.** Cold open → introduction → escalation → climax → one breath →
|
|
212
|
+
end card. Reserve the end card (2–3 s, one card) before anything else, then find the ONE clip
|
|
213
|
+
that proves each beat — not "fifteen great clips", which drifts toward sameness.
|
|
214
|
+
|
|
215
|
+
**Pacing.** Shots run 1.5–3 s for arcade action, with a few longer holds where one continuous
|
|
216
|
+
action is the payoff. Vary lengths (2, 3, 4, 6 beats); do not cut on every beat — let a musical
|
|
217
|
+
hit land on an in-clip impact sometimes. Build to a peak, then a calmer wider shot, then build
|
|
218
|
+
again. 30–45 s total. More cutting is not better editing: if one take shows the whole stunt,
|
|
219
|
+
keep the take.
|
|
220
|
+
|
|
221
|
+
**Variety, five axes** — audit the labels in shots.json top to bottom, repetition shows in text
|
|
222
|
+
before you ever re-watch: content (different actions, escalate rather than repeat), composition
|
|
223
|
+
(camera distance and framing), energy (intense vs quiet), pacing (section tempo), shot length.
|
|
224
|
+
**Rule of three**: never more than three similar things in a row, and max three of any shot
|
|
225
|
+
type in the whole cut.
|
|
226
|
+
|
|
227
|
+
**Text.** End card only, unless the footage cannot say it. ≤ 6 words, evocative verbs, sounds
|
|
228
|
+
like this game and no other. Banned: quantities ("5 unique levels"), genre stacks, verb lists
|
|
229
|
+
("Race! Drift! Win!"), stock phrases ("Get ready…", "…like never before"). Cards get their own
|
|
230
|
+
beat — never over action.
|
|
231
|
+
|
|
232
|
+
## Selection rules this project already paid for
|
|
233
|
+
|
|
234
|
+
- **Never slow motion.** On gameplay footage it reads as a low framerate. \`speed\` is 1.0.
|
|
235
|
+
- **Numbers are not interest.** A high \`impactSpeed\` is often a car dead against a wall — the
|
|
236
|
+
worst clip. A crash earns its slot only if things visibly break and motion continues.
|
|
237
|
+
- **Low speed can BE the drama.** Wheelspin recoveries, plowing back onto the track, being
|
|
238
|
+
overtaken while struggling — often the best clips, and they score near zero.
|
|
239
|
+
- **"Some shots of X" means a few.** One standing start is an opener; five is a broken trailer.
|
|
240
|
+
- **Menu and selection screens need \`"ui": false\`** — the HUD replay paints the race HUD over them.
|
|
241
|
+
- **Verify on pixels.** Sheets and stills, every candidate. Then render — iterating is minutes and
|
|
242
|
+
revisions are kept, so render rather than debate.
|
|
261
243
|
|
|
262
244
|
## Tuning from prompts
|
|
263
245
|
|
|
@@ -272,8 +254,6 @@ The creator talks; you edit \`trailer/shots.json\`, run \`bitmagic trailer make\
|
|
|
272
254
|
| "show the menu / the map / the start" | add ONE shot from the recording's opening with \`"ui": false\` |
|
|
273
255
|
| "put the title at the end" / "change the tagline" | \`titles: [{ "at": "last-clip", "text": "…", "sub": "…", "style": "card" }]\` |
|
|
274
256
|
| "add a title at the start" | a \`title\`-style cue at \`at: 0\` for ~2.5 s, and make the first shot calm enough to read over |
|
|
275
|
-
| "show more of the world / the level", "a wider shot", "an establishing shot" | record a fly-through, \`merge\` it with the gameplay recording, and take the cold open (and the breath) from it |
|
|
276
|
-
| "I can't play right now", "you do it", nobody available | \`record --flythrough\` — it clicks Play itself and needs no one |
|
|
277
257
|
| "different music", "more epic / chill" | \`--music-prompt\` with the new direction (spends sparks), or \`--music <file>\`; shots keep their beat counts and re-snap |
|
|
278
258
|
| "no HUD" / "show the HUD" | drop or add \`--ui\` (per shot: \`"ui": false\`) |
|
|
279
259
|
| "the HUD stutters" / "smoother HUD" | raise \`--ui-keyframe-rate\` on \`make\` or \`render\` (default 30/s; 0 = every change) |
|
|
@@ -285,25 +265,6 @@ Then: **quota check** the labels (rule of three, one standing start), render, ex
|
|
|
285
265
|
from the changed region, compare with the previous \`-rN\`, deliver the URL.
|
|
286
266
|
`;
|
|
287
267
|
}
|
|
288
|
-
/**
|
|
289
|
-
* `<skills dir>/making-a-trailer/references/trailer-craft.md` — the only shipped skill file that is
|
|
290
|
-
* read from disk rather than written as a template literal.
|
|
291
|
-
*
|
|
292
|
-
* It is a shipped asset (`assets/skills/`, listed in package.json's `files`) because two skills
|
|
293
|
-
* need the same bytes: this one, and the monorepo's own `.claude/skills/make-trailer/`, whose copy
|
|
294
|
-
* is a SYMLINK to the asset. Trailer craft is editing knowledge — it says nothing about the CLI, so
|
|
295
|
-
* neither reader owns it and neither can be given an abridgement without going stale against the
|
|
296
|
-
* other. The same reasoning as the repo's `.agents/skills -> ../.claude/skills` link: a link is not
|
|
297
|
-
* a copy, so there is nothing to keep in step and no check to forget to run.
|
|
298
|
-
*
|
|
299
|
-
* Resolved from this module's own location the way `defaultTitleFont` resolves the bundled font:
|
|
300
|
-
* `../../assets/` is the same hop from `src/scaffold/` and from `dist/scaffold/`, so it works run
|
|
301
|
-
* from source and from an installed package alike.
|
|
302
|
-
*/
|
|
303
|
-
export function renderTrailerCraftReference() {
|
|
304
|
-
const source = fileURLToPath(new URL('../../assets/skills/trailer-craft.md', import.meta.url));
|
|
305
|
-
return fs.readFileSync(source, 'utf-8');
|
|
306
|
-
}
|
|
307
268
|
/**
|
|
308
269
|
* `<skills dir>/publishing-a-game/SKILL.md` — the whole ship-it path, and every way it refuses.
|
|
309
270
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-files.js","sourceRoot":"","sources":["../../src/scaffold/skill-files.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"skill-files.js","sourceRoot":"","sources":["../../src/scaffold/skill-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+HR,CAAC;AACF,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,+BAA+B;IAC7C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkER,CAAC;AACF,CAAC"}
|
|
@@ -40,9 +40,8 @@ export declare function creatorPromptField(override?: unknown): {
|
|
|
40
40
|
/** `body` plus the creator's own words, when the flag was given and telemetry is on. */
|
|
41
41
|
export declare function withParent(body: Record<string, unknown>): Record<string, unknown>;
|
|
42
42
|
/**
|
|
43
|
-
* The creator's ask as an opaque, stable dedupe key — what
|
|
44
|
-
*
|
|
45
|
-
* words themselves in {@link creatorAskText}, for a channel that shows them and stores nothing.)
|
|
43
|
+
* The creator's ask as an opaque, stable dedupe key — what the command beacon sends so
|
|
44
|
+
* api-server can count "prompts this game was built with" without ever being told the text.
|
|
46
45
|
*
|
|
47
46
|
* The CLI is the ONLY producer of this value. api-server stores it and compares it to other
|
|
48
47
|
* values from this same function; it never recomputes one from text, so the two sides cannot
|
|
@@ -57,18 +56,3 @@ export declare function withParent(body: Record<string, unknown>): Record<string
|
|
|
57
56
|
* `--original-prompt` produces — the count is a floor, never an overcount.
|
|
58
57
|
*/
|
|
59
58
|
export declare function creatorAskDigest(override?: unknown): string | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* The creator's ask as TEXT, bounded for a wire that has a body limit.
|
|
62
|
-
*
|
|
63
|
-
* The beacon carries this so the live-prompts Slack channel can show what an
|
|
64
|
-
* agent is being asked for on the commands that send no prompt anywhere else —
|
|
65
|
-
* `build`, `verify`, `dev`, `reload`, `publish` — which are most of what
|
|
66
|
-
* building a GDK project consists of. api-server posts it and never stores it:
|
|
67
|
-
* the count still runs on {@link creatorAskDigest}, and no prompt text reaches
|
|
68
|
-
* Postgres.
|
|
69
|
-
*
|
|
70
|
-
* Capped by the same rule the digest hashes under, so the two always describe
|
|
71
|
-
* the same words. `DO_NOT_TRACK` drops it upstream in `beginCommand`, like
|
|
72
|
-
* every other field here.
|
|
73
|
-
*/
|
|
74
|
-
export declare function creatorAskText(override?: unknown): string | undefined;
|
|
@@ -52,9 +52,8 @@ export function withParent(body) {
|
|
|
52
52
|
return 'creatorPrompt' in field ? { ...body, ...field } : body;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* The creator's ask as an opaque, stable dedupe key — what
|
|
56
|
-
*
|
|
57
|
-
* words themselves in {@link creatorAskText}, for a channel that shows them and stores nothing.)
|
|
55
|
+
* The creator's ask as an opaque, stable dedupe key — what the command beacon sends so
|
|
56
|
+
* api-server can count "prompts this game was built with" without ever being told the text.
|
|
58
57
|
*
|
|
59
58
|
* The CLI is the ONLY producer of this value. api-server stores it and compares it to other
|
|
60
59
|
* values from this same function; it never recomputes one from text, so the two sides cannot
|
|
@@ -69,29 +68,9 @@ export function withParent(body) {
|
|
|
69
68
|
* `--original-prompt` produces — the count is a floor, never an overcount.
|
|
70
69
|
*/
|
|
71
70
|
export function creatorAskDigest(override) {
|
|
72
|
-
const text = creatorAskText(override);
|
|
73
|
-
if (text === undefined)
|
|
74
|
-
return undefined;
|
|
75
|
-
return createHash('sha256').update(text).digest('hex').slice(0, 16);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* The creator's ask as TEXT, bounded for a wire that has a body limit.
|
|
79
|
-
*
|
|
80
|
-
* The beacon carries this so the live-prompts Slack channel can show what an
|
|
81
|
-
* agent is being asked for on the commands that send no prompt anywhere else —
|
|
82
|
-
* `build`, `verify`, `dev`, `reload`, `publish` — which are most of what
|
|
83
|
-
* building a GDK project consists of. api-server posts it and never stores it:
|
|
84
|
-
* the count still runs on {@link creatorAskDigest}, and no prompt text reaches
|
|
85
|
-
* Postgres.
|
|
86
|
-
*
|
|
87
|
-
* Capped by the same rule the digest hashes under, so the two always describe
|
|
88
|
-
* the same words. `DO_NOT_TRACK` drops it upstream in `beginCommand`, like
|
|
89
|
-
* every other field here.
|
|
90
|
-
*/
|
|
91
|
-
export function creatorAskText(override) {
|
|
92
71
|
const field = creatorPromptField(override);
|
|
93
72
|
if (!('creatorPrompt' in field))
|
|
94
73
|
return undefined;
|
|
95
|
-
return field.creatorPrompt.slice(0, MAX_ASK_CHARS);
|
|
74
|
+
return createHash('sha256').update(field.creatorPrompt.slice(0, MAX_ASK_CHARS)).digest('hex').slice(0, 16);
|
|
96
75
|
}
|
|
97
76
|
//# sourceMappingURL=creator-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creator-prompt.js","sourceRoot":"","sources":["../../src/telemetry/creator-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,sGAAsG;AACtG,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B,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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,QAAkB;IACjD,MAAM,KAAK,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC3C,IAAI,CAAC,CAAC,eAAe,IAAI,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAClD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7G,CAAC"}
|
package/dist/telemetry/report.js
CHANGED
|
@@ -16,19 +16,11 @@
|
|
|
16
16
|
* bounded to {@link REPORT_TIMEOUT_MS} per request so a finished command is
|
|
17
17
|
* never held open by a sulking network (the same reasoning as
|
|
18
18
|
* update/check.ts). It never prints.
|
|
19
|
-
* 2.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* rule
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* `creatorPrompt` is the one field that carries words, and it is not
|
|
26
|
-
* analytics: api-server posts it to an internal Slack channel and stores it
|
|
27
|
-
* nowhere — not GA4, not Postgres, not BigQuery. It is here because the
|
|
28
|
-
* commands that send prompt text to a route are the generators, and an
|
|
29
|
-
* agent building a GDK project spends most of its commands on the offline
|
|
30
|
-
* ones. `DO_NOT_TRACK` drops it with everything else. See
|
|
31
|
-
* {@link CommandProvenance}.
|
|
19
|
+
* 2. It sends categories, never messages: the command name, ok/failed, the
|
|
20
|
+
* exit code, a `CliError.code`, and a duration. A message can name a path;
|
|
21
|
+
* that does not belong in an analytics event. The two later additions keep
|
|
22
|
+
* the rule: the project's game id is an id we minted, and the creator's ask
|
|
23
|
+
* travels as an opaque DIGEST, never its words. See {@link CommandProvenance}.
|
|
32
24
|
* 3. It is authenticated with the creator's own token, so the server can key
|
|
33
25
|
* the event to the account and look up their real Pro state. No token, no
|
|
34
26
|
* report — an anonymous beacon would be a spammable endpoint for nothing.
|
|
@@ -40,7 +32,7 @@ import { resolveAuth0ClientId } from '../config/environments.js';
|
|
|
40
32
|
import { getAccessToken } from '../auth/session.js';
|
|
41
33
|
import { readProjectGameIdOrNull } from '../project/context.js';
|
|
42
34
|
import { apiServerHeaders } from './request-headers.js';
|
|
43
|
-
import { creatorAskDigest
|
|
35
|
+
import { creatorAskDigest } from './creator-prompt.js';
|
|
44
36
|
import { currentCommand, isTelemetryDisabled } from './command-context.js';
|
|
45
37
|
// Re-exported because this is where the opt-out is enforced for a report that is already
|
|
46
38
|
// under way; `beginCommand` consults the same predicate to skip collecting anything at all.
|
|
@@ -93,28 +85,21 @@ function defaultDeps() {
|
|
|
93
85
|
return { fetch: globalThis.fetch, env: process.env };
|
|
94
86
|
}
|
|
95
87
|
/**
|
|
96
|
-
* The game and the ask, when this command has either.
|
|
97
|
-
* api-server validates the body strictly, and an absent key is how "nothing to say" is
|
|
98
|
-
* everywhere else on this wire.
|
|
99
|
-
*
|
|
100
|
-
* Nothing is present unless the command declared `--original-prompt` AND the agent passed it —
|
|
101
|
-
* `creatorAskDigest` reads the value `beginCommand` captured, which is also where `DO_NOT_TRACK`
|
|
102
|
-
* already dropped it.
|
|
88
|
+
* The game and the ask, when this command has either. Both keys are omitted rather than sent as
|
|
89
|
+
* null: api-server validates the body strictly, and an absent key is how "nothing to say" is
|
|
90
|
+
* spelled everywhere else on this wire.
|
|
103
91
|
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
92
|
+
* The digest is only ever present when the command declared `--original-prompt` AND the agent
|
|
93
|
+
* passed it — `creatorAskDigest` reads the value `beginCommand` captured, which is also where
|
|
94
|
+
* `DO_NOT_TRACK` already dropped it. The pair is only sent together: a digest with no game
|
|
95
|
+
* cannot be counted, and a game with no digest is not an ask.
|
|
108
96
|
*/
|
|
109
97
|
function provenance(deps) {
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
98
|
+
const askDigest = creatorAskDigest();
|
|
99
|
+
if (askDigest === undefined)
|
|
112
100
|
return {};
|
|
113
101
|
const gameId = readProjectGameIdOrNull(deps.cwd);
|
|
114
|
-
|
|
115
|
-
if (gameId === undefined || askDigest === undefined)
|
|
116
|
-
return { creatorPrompt };
|
|
117
|
-
return { creatorPrompt, gameId, askDigest };
|
|
102
|
+
return gameId === undefined ? {} : { gameId, askDigest };
|
|
118
103
|
}
|
|
119
104
|
/**
|
|
120
105
|
* Report the running command's `report` to api-server. Resolves when the report
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/telemetry/report.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/telemetry/report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAuB,MAAM,sBAAsB,CAAC;AAEhG,yFAAyF;AACzF,4FAA4F;AAC5F,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC,MAAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AA2CpD;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,MAAM,IAAI,GAAG,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IA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,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;SAChF,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,2EAA2E;QAC3E,kEAAkE;IACpE,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitmagic/cli",
|
|
3
|
-
"version": "0.1.65-dev.
|
|
3
|
+
"version": "0.1.65-dev.2",
|
|
4
4
|
"description": "Build Bitmagic games from your own agent tool",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Bitmagic Oy",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"playwright-core": "^1.59.1",
|
|
26
26
|
"tar": "^7.4.3",
|
|
27
27
|
"ws": "^8.21.3",
|
|
28
|
-
"@bitmagic/
|
|
29
|
-
"@bitmagic/
|
|
30
|
-
"@bitmagic/
|
|
28
|
+
"@bitmagic/animation-forger": "0.1.20-dev.2",
|
|
29
|
+
"@bitmagic/world-forger": "0.1.25-dev.2",
|
|
30
|
+
"@bitmagic/asset-core": "0.2.20-dev.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@eslint/js": "^9.38.0",
|