@homie-rocks/studio 0.51.4 → 0.51.6

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +10 -29
  3. package/apps/APPS.md +16 -1
  4. package/bin/homie-studio.mjs +28 -30
  5. package/guides/app/NEEDS.md +160 -0
  6. package/guides/app/SKILL.md +20 -4
  7. package/guides/art/SKILL.md +68 -140
  8. package/guides/art/scripts/art.mjs +6 -79
  9. package/guides/models/SKILL.md +73 -177
  10. package/guides/models/references/RIGHTS.md +1 -1
  11. package/guides/models/scripts/models.mjs +7 -288
  12. package/guides/music/SKILL.md +74 -183
  13. package/guides/music/references/COMPOSITION.md +21 -26
  14. package/guides/music/references/GAME-AUDIO.md +3 -3
  15. package/guides/music/references/RIGHTS.md +12 -15
  16. package/guides/music/scripts/music.mjs +11 -202
  17. package/guides/parts/SKILL.md +1 -1
  18. package/guides/shop/SKILL.md +68 -77
  19. package/guides/sound/SKILL.md +70 -1
  20. package/guides/sound/scripts/player/sound.js +233 -0
  21. package/guides/studio-setup/SKILL.md +11 -27
  22. package/guides/studio-setup/references/OFFICIAL-MEDIA.md +66 -0
  23. package/guides/style/SKILL.md +66 -3
  24. package/guides/video/SKILL.md +83 -0
  25. package/guides/video/references/DELIVERY.md +73 -0
  26. package/guides/video/references/HONESTY.md +40 -0
  27. package/guides/video/references/METHOD.md +144 -0
  28. package/guides/video/references/RECORD.md +137 -0
  29. package/guides/video/references/TRAILER.md +154 -0
  30. package/guides/video/references/examples/site-walkthrough.json +14 -0
  31. package/guides/video/references/examples/studio-play-phone.json +15 -0
  32. package/guides/video/references/examples/studio-play.json +17 -0
  33. package/guides/video/scripts/capture-game.mjs +175 -0
  34. package/guides/video/scripts/clock.js +136 -0
  35. package/guides/video/scripts/drawover/film.js +58 -0
  36. package/guides/video/scripts/drawover/index.html +9 -0
  37. package/guides/video/scripts/drawover/look.js +115 -0
  38. package/guides/video/scripts/drawover/shots.json +12 -0
  39. package/guides/video/scripts/lib/browser.mjs +87 -0
  40. package/guides/video/scripts/lib/frames.mjs +170 -0
  41. package/guides/video/scripts/lib/remix.mjs +159 -0
  42. package/guides/video/scripts/qa.mjs +127 -0
  43. package/guides/video/scripts/record-fixed.mjs +403 -0
  44. package/guides/video/scripts/record-page.mjs +477 -0
  45. package/guides/video/scripts/tap.js +108 -0
  46. package/guides/video/scripts/video.mjs +888 -0
  47. package/lib/app-needs.mjs +86 -18
  48. package/lib/app-ready.mjs +21 -0
  49. package/lib/build.mjs +12 -9
  50. package/lib/check.mjs +16 -7
  51. package/lib/cloudflare.mjs +6 -11
  52. package/lib/codex.mjs +7 -5
  53. package/lib/dev.mjs +1 -2
  54. package/lib/doctor.mjs +10 -54
  55. package/lib/mcp-tools.mjs +42 -21
  56. package/lib/mcp.mjs +1 -1
  57. package/lib/media-import.mjs +41 -0
  58. package/lib/media-workflows.mjs +13 -0
  59. package/lib/needs-headless.mjs +34 -0
  60. package/lib/official-media.mjs +15 -0
  61. package/lib/rules-build.mjs +13 -5
  62. package/lib/scaffold.mjs +2 -2
  63. package/lib/shop-links.mjs +81 -19
  64. package/lib/shop-listen.mjs +43 -0
  65. package/lib/shop-local.mjs +1 -1
  66. package/lib/shop-mcp.mjs +58 -0
  67. package/lib/stripe-connect.mjs +36 -15
  68. package/lib/template-history.json +87 -0
  69. package/lib/upgrade-media.mjs +13 -0
  70. package/lib/upgrade.mjs +10 -0
  71. package/package.json +1 -1
  72. package/parts/PARTS.md +1 -1
  73. package/rules/view.ts +4 -0
  74. package/shop/SHOP.md +110 -34
  75. package/worker/app-records.mjs +1 -0
  76. package/worker/build-id.mjs +1 -1
  77. package/worker/event-resources.mjs +9 -3
  78. package/worker/index.mjs +5 -1
  79. package/worker/local-test.mjs +4 -0
  80. package/worker/mcp-events.mjs +2 -2
  81. package/worker/mcp-tools.mjs +19 -1
  82. package/worker/mcp.mjs +1 -1
  83. package/worker/purchase-reconciliation.mjs +16 -1
  84. package/worker/shop-links.mjs +1 -1
  85. package/worker/shop-rules.mjs +3 -0
  86. package/worker/shop-subscriptions.mjs +2 -0
  87. package/worker/shop.mjs +58 -8
  88. package/worker/stripe-ownership.mjs +7 -0
  89. package/worker/version.mjs +1 -1
  90. package/guides/models/references/models.json +0 -175
  91. package/guides/music/scripts/lib/eleven.mjs +0 -260
  92. package/lib/projects-env.mjs +0 -68
  93. package/lib/projects.mjs +0 -311
  94. package/lib/provider-key.mjs +0 -21
@@ -1,197 +1,88 @@
1
1
  ---
2
2
  name: music
3
- description: Make songs, themes and game scores for a Homie studio with ElevenLabs Music, through the creator's OWN ElevenLabs account — a composition plan for anything sung, a transcription check that every line is actually sung, mastering to a loudness target, seamless loops and stems for games — then a song page on the studio's site. It tells the person the plan, the rights and the credit cost before anything is rendered, and never spends past the budget they set. Use when someone in a studio asks for a song, a theme song, a jingle, background music, a game score, loops or stems.
4
- compatibility: Node 22 and ffmpeg. ElevenLabs' own CLI (elevenlabs, signed in with elevenlabs auth login) or ELEVENLABS_API_KEY, on the creator's own ElevenLabs account.
3
+ description: "Compose music with the official ElevenLabs MCP and keep arrangement, rights, mastering and scene integration in Homie."
4
+ compatibility: Node 22 and the official ElevenLabs plugin in the AI client. Local media processing uses ffmpeg and Chrome where needed.
5
5
  metadata:
6
6
  providers: elevenlabs
7
7
  ---
8
8
 
9
- # Music for a studio
10
-
11
- A studio is the folder with `studio.json` (the `studio-setup` skill makes one). Songs live in
12
- `music/<slug>/`, listed in `music/manifest.json`; a published entry is a page at
13
- `/music/<slug>/` on the studio's own site. Everything below runs through one script in this
14
- skill's folder: `scripts/music.mjs` (in Claude Code:
15
- `node "${CLAUDE_PLUGIN_ROOT}/skills/music/scripts/music.mjs" <command>`; elsewhere, the path next
16
- to this file). Run it from inside the studio. It needs Node 22 and ffmpeg. Every command takes
17
- `--json`.
18
-
19
- Finish in this turn: a render is one call that usually returns in a minute or two. Only stop early to
20
- ask the person something (the go-ahead on the cost, a budget, an install).
21
-
22
- ## 1. The provider, only now
23
-
24
- A studio that never makes music is never asked about ElevenLabs. **Free first:** sound effects, a
25
- chiptune or synth theme, a game score from chords and patterns, loops and stems that cost nothing and
26
- need no account are the `sound` skill (synthesized on this computer). Use this skill for sung songs and
27
- produced music from a model, when the person wants that and has (or will make) an ElevenLabs account.
28
- Check when this skill starts:
29
-
30
- ```sh
31
- node <music.mjs> check
32
- ```
33
-
34
- It reports the road (the `elevenlabs` CLI signed in, or `ELEVENLABS_API_KEY` in the
35
- environment), the plan, the credits left and when they reset, whether the account can go over,
36
- the rights that plan gives, ffmpeg, and whether the studio's site has song pages.
37
-
38
- Not connected? Offer ElevenLabs' own tools, never a copy of anyone's key or code:
39
-
40
- - **The official CLI** (what this skill uses for music): `brew install elevenlabs/tap/elevenlabs`
41
- (or `npm install -g @elevenlabs/cli`), then `elevenlabs auth login`. It opens ElevenLabs in the
42
- browser; the person signs in once and the sign-in stays in the OS keychain. Nobody pastes a key.
43
- Install the CLI yourself as part of the requested music work. An older CLI works; `brew upgrade elevenlabs` keeps it current
44
- (1.4.0 on 2026-09-25).
45
- - An existing API key in the environment still works, but never send a new person to find or set one.
46
- Use the browser sign-in above.
47
- - **ElevenLabs' plugin** for Claude Code (`/plugin marketplace add elevenlabs/plugin`, then
48
- `/plugin install elevenlabs@elevenlabs`; in Codex `codex plugin marketplace add elevenlabs/plugin`)
49
- brings their own skills and their hosted MCP (`https://api.elevenlabs.io/v1/mcp`, signed in on
50
- ElevenLabs' page: speech, voices, transcription, agents). Their skills alone: `npx skills add
51
- elevenlabs/skills`. It is optional here, and their MCP has no music tools: songs, stems and the
52
- lyric check go through this skill's script, which keeps the budget, the receipts and the rights.
53
- Their speech and sound-effect tools spend the same credits: tell the person the cost first, and the
54
- Homie mod (Claude Code) and Homie's hooks (Codex) hold a generating tool (an `estimate_only` call is free).
55
-
56
- Prefer the CLI to a raw API call or a pasted key; never call ElevenLabs' API with `curl` for a song
57
- (the same request twice is twice the bill, and nothing records it).
58
-
59
- No ffmpeg: offer `brew install ffmpeg` (macOS) or the system package; the person approves.
60
-
61
- ## 2. Say the plan and the rights, plainly, before anything is made
62
-
63
- From `check`, tell the person in two or three lines: the plan (tier), the credits left, and what
64
- the plan allows. ElevenLabs' terms: **the free plan has no commercial licence** (no ads, sales or
65
- monetised channels, and published copies credit "Eleven Music"); **paid plans include a
66
- commercial licence** (not for Beta features) under their Terms and Prohibited Use Policy. The plan
67
- **at render time** is what counts, and every render records it. Details:
68
- `references/RIGHTS.md`.
69
-
70
- ## 3. Write the song
71
-
72
- Write `music/<slug>/spec.json` (shape and a full example: `references/COMPOSITION.md`): tempo,
73
- key, global styles and what to avoid, and sections in whole bars, each either instrumental or
74
- with its sung lines. Then:
75
-
76
- ```sh
77
- node <music.mjs> plan <slug> --spec music/<slug>/spec.json
78
- ```
79
-
80
- It builds the composition plan (every section a whole number of bars, so section starts are bar
81
- lines that loops and video cuts can land on), checks ElevenLabs' limits (each section 3 s to
82
- 120 s, lines up to 200 characters) and quotes the cost.
83
-
84
- - **Anything sung goes through the plan's sections.** A prompt with lyrics beside it has come
85
- back with nothing sung; `render --prompt` refuses words for that reason.
86
- - A theme or a song: the hook inside the first 10 seconds, one or two sung lines per bar at
87
- most, simple words that sing clearly.
88
- - A game score: instrumental, a steady tempo, sections of 4, 8 or 16 bars that can each loop.
89
- - Describe sound, not artists: no "in the style of" a real singer or band, no real person's name
90
- or voice (ElevenLabs refuses them, and they are not ours to use).
91
-
92
- ## 4. Price it, get the go-ahead, render once
93
-
94
- ```sh
95
- node <music.mjs> quote --seconds <s> [--vocals] [--budget <credits>]
9
+ # Music for the scene
10
+
11
+ Read the studio's style and the scene's emotional arc. Write a composition brief with
12
+ instrumentation, tempo, duration, transitions, loop points and any exact lyrics.
13
+ Use original language; preserve the owner's requested musical direction.
14
+
15
+ Use the official ElevenLabs plugin's MCP creative workflow. Discover current tools first:
16
+ `creative_get_flow_node_types` and `creative_get_model_guide` describe supported nodes
17
+ and prompting; `creative_get_flow_run_status` follows a submitted flow. Only invoke
18
+ music or sound generation if the connected server actually exposes that capability.
19
+ The hosted OAuth server's public descriptions vary; never invent a music tool name or
20
+ silently substitute speech. If unavailable, explain the missing capability and continue
21
+ local composition/placement with a supplied file. The official provider plugin owns any
22
+ alternative setup flow; Homie does not install a key-based local server or read CLI auth.
23
+
24
+ Use the provider's estimate capability where exposed and record credits as quoted or
25
+ measured. Read the current account plan's music terms before commercial use. Keep
26
+ lyrics, composition brief and generation identifiers beside the song.
27
+ Local `scripts/music.mjs` retains `plan`, `analyze`, `master`, `loop`, `add` and `publish`.
28
+ Master from the downloaded audio, check clipping and loudness, audition the loop seam,
29
+ and verify every sung line by listening. Transcription or stems, if needed, use discovered
30
+ official MCP capabilities; neither is assumed available. Add metadata and credits to
31
+ `music/manifest.json`, then wire the track to the scene or music page. Publish only when requested.
32
+
33
+ ## Official generation workflow
34
+
35
+ The owner's AI uses the provider's official plugin/MCP in its own client. Homie never
36
+ asks for, stores, reads or prints provider credentials. Read the current provider
37
+ skill and discover its available tools and input schemas; host prefixes vary.
38
+ Connection instructions and verified sources: [official integrations](../studio-setup/references/OFFICIAL-MEDIA.md).
39
+ If tools are missing, connect that official plugin once in the client's browser flow.
40
+ Do not fall back to a Homie client, key file, environment key or CLI generation wrapper.
41
+
42
+ Before spending, state the model, count/duration, estimated cost and remaining approved
43
+ budget. Use the owner's existing authorization; ask only if the spend is outside it.
44
+ Record the request ID as soon as accepted. Poll that same request; never resubmit to
45
+ retry a slow job. Unknown cost is unknown, never zero. Provider billing is authoritative;
46
+ Homie's local receipt cannot enforce spending in another client.
47
+
48
+ ## Place and prove the result
49
+
50
+ Download the completed tool's output using the AI client's file/download facilities.
51
+ Keep temporary signed URLs out of committed records. Keep the original in the studio's
52
+ art/job folder; put the optimized delivered asset beside its game/app, or in music/ or
53
+ videos/ for a published work. Record a receipt with these fields:
54
+
55
+ ```json
56
+ {
57
+ "provider": "fal",
58
+ "tool": "run_model",
59
+ "model": "exact endpoint returned by the provider",
60
+ "requestId": "actual request ID",
61
+ "prompt": "the actual prompt, including style constraints",
62
+ "styleRevision": "revision from the studio's style",
63
+ "rights": {"source": "provider/model terms URL", "checkedAt": "YYYY-MM-DD", "commercial": false, "note": "record the actual plan and permitted use"},
64
+ "cost": {"status": "unknown"}
65
+ }
96
66
  ```
97
67
 
98
- About **27.5 credits per second** of `music_v2` (measured on a paid account; every render then
99
- records what it really cost, read off the account before and after). Tell the person the cost and
100
- ask for the go-ahead and a cap. Then:
68
+ For ElevenLabs use its actual discovered tool and model, and its flow/session or request
69
+ identifier. A measured cost uses `{"status":"actual","amount":1,"unit":"credits"}`;
70
+ a quote uses `estimate`. Never claim commercial rights from the fact that generation
71
+ succeeded. Read the provider and model terms for the account's plan; record attribution,
72
+ reference-image permissions and any restrictions. Mark test fixtures `"fixture": true`.
101
73
 
102
- ```sh
103
- node <music.mjs> budget <slug> --cap <credits they agreed to>
104
- node <music.mjs> render <slug> --dry-run # free: the CLI validates the request and sends nothing
105
- node <music.mjs> render <slug> --yes # the one paid render
106
- ```
107
-
108
- - `render` refuses with no budget, refuses anything that would pass the cap, and asks again
109
- without `--yes`. If the ask costs more than the cap, say so and offer what fits: the longest
110
- length within it (`quote --budget` works it out), or a shorter section that loops honestly to
111
- length (a loop, called a loop). Never raise a cap yourself.
112
- - ElevenLabs' balance can take a minute to show a render (measured: unchanged right after,
113
- +445 a minute later). `render` waits up to 40 s for it; if it has not moved, the quote is
114
- counted against the cap and the receipt is marked pending. `node <music.mjs> reconcile <slug>`
115
- a minute later writes the real number. Never report a pending cost as zero.
116
- - Never re-send a failed render on your own: the same request twice is twice the bill. A render
117
- that was sent and never answered leaves `work/render-<n>.pending`; the script refuses to send
118
- again until the person has looked at their ElevenLabs history and agrees (`--again`).
119
- - Never buy credits, never change the plan, never turn on usage-based billing.
120
-
121
- ## 5. Check that every line is sung
122
-
123
- ```sh
124
- node <music.mjs> lyrics <slug>
125
- ```
126
-
127
- ElevenLabs' own speech-to-text (Scribe) listens to the render, and every planned line is
128
- matched against what it heard, in order. A line passes at 75 % of its words (sung contractions
129
- drift: "I'll" comes back "I"). A **MISS** is a line the model did not sing, or sang as something
130
- else. Tell the person; the fix is a simpler line (the key word on a strong beat, fewer syllables)
131
- and another paid render, which needs their go-ahead. Update the lyrics shown on the page to what
132
- is actually sung.
133
-
134
- ## 6. Master it
135
-
136
- ```sh
137
- node <music.mjs> master <slug> # -14 LUFS integrated, -1 dBTP: the web and streaming
138
- node <music.mjs> master <slug> --lufs -18 --tp -1.5 # a bed under game sound effects
139
- node <music.mjs> analyze music/<slug>/<slug>.mp3 # duration, loudness, tempo, first beat
140
- ```
141
-
142
- Two-pass loudness, then a limiter, measured after on both the WAV master (kept off the site) and
143
- the mp3 the page plays. Listen-worthy numbers go in your report, not adjectives.
144
-
145
- ## 7. Loops and stems for games
146
-
147
- ```sh
148
- node <music.mjs> loop <slug> --bars 8 --from-bar 4 # a seamless loop cut on bar lines, WAV + OGG
149
- node <music.mjs> stems <slug> --yes # paid, priced by measurement; ask first
150
- ```
151
-
152
- The loop is cut at the song's measured bar lines, the tail crossfaded into the head, and checked:
153
- the jump at the wrap against the music's own sample steps, and the beat grid of the loop played
154
- three times. Never ship a loop as mp3 (encoders pad the ends with silence). Using loops in a
155
- game: `references/GAME-AUDIO.md`.
156
-
157
- ## 8. The page
74
+ Wire the delivered path into the scene or manifest, then run:
158
75
 
159
76
  ```sh
160
- node <music.mjs> add <slug> --title "<Title>" --blurb "<one line>" [--for-game <game id>] --publish
161
- node <music.mjs> publish <slug>
77
+ npx --no-install homie-studio media import --file <downloaded-file> --receipt <receipt.json> --out games/<id>/assets/<name> --used-by games/<id>/view.ts
162
78
  ```
163
79
 
164
- `add` writes the manifest entry from what is in `music/<slug>/` (the mp3 the page plays, the
165
- master kept off the site, loops and stems offered for download, the lyrics, the plan and rights
166
- at render time, the credits line). `publish` rebuilds and redeploys the site and checks the
167
- page answers 200 and the audio answers a byte range. Without storage the site serves the song
168
- itself (a song is a few MB; the limit is 25 MiB a file). A studio that has storage (`storage add`)
169
- keeps its big media in its own R2: the deploy uploads the song (over 1 MiB, or left out of git),
170
- reads it back, checks it by SHA-256 and serves it from R2 at the same address. If the studio is
171
- not online yet, use the `publish` skill first. If `check` says the studio's `@homie-rocks/studio`
172
- predates song pages, say so and update it.
173
-
174
- ## 9. Tell the person
175
-
176
- Four or five lines: the page link, the length, the credits it cost (measured) and what is left,
177
- the plan and whether it may be used commercially, the lyric check result, the loudness. Commit
178
- `music/` in the studio (the big audio files stay out of git by the studio's `.gitignore`; the
179
- manifest, spec, plan and receipts go in).
180
-
181
- ## Never
182
-
183
- - Never print, paste or store a key; never ask for one in chat.
184
- - Never render without the person's go-ahead on the cost, and never past their cap.
185
- - Never claim rights the plan did not give, and never drop the "Eleven Music" credit on a
186
- free-plan render.
187
- - Never imitate a real artist, voice or person.
188
-
189
- ### Existing provider credentials
80
+ This copies bytes, verifies a static reference, hashes the asset and records allowlisted
81
+ provenance in `media/provenance.json`. Reimporting the same output is idempotent; it
82
+ never generates or charges. Include each generation step's receipt for derived assets.
83
+ Run the scene and look/listen: a file and static reference are not proof that it renders
84
+ or plays. Report the placed path, usage evidence, rights and actual/estimated cost.
190
85
 
191
- The tools read `FAL_KEY` or `ELEVENLABS_API_KEY` first, then the plain single-line
192
- key in `~/.homie/keys/fal-key` or `~/.homie/keys/elevenlabs-key`. They also accept
193
- `~/.homie/workspace/fal-key` and `~/.homie/workspace/elevenlabs-key` from earlier
194
- installs. Checks name the source, never the key. Keep these files private (mode
195
- 0600); never copy them into a studio. ElevenLabs also accepts its CLI browser
196
- sign-in and the existing Stripe Projects connection. Run the tool’s `check`
197
- before declaring a provider disconnected.
86
+ The toolkit’s `lib/media-workflows.mjs` declares this skill’s verified tool references.
87
+ Validate them against the host’s current tool inventory before execution; tool discovery
88
+ is required for generation capabilities that have no stable documented name.
@@ -1,7 +1,8 @@
1
1
  # Composition plans
2
2
 
3
- ElevenLabs Music (`music_v2`) takes either a short prompt or a **composition plan**: a list of
4
- chunks, each with its own length, text, and styles. Anything with words goes through a plan.
3
+ Homie plans music as sections with their own length, lyrics and styles. Discover the official
4
+ ElevenLabs MCP music capability and read its current schema before adapting this local plan
5
+ to a generation request; the local plan is not a promise about a provider API.
5
6
 
6
7
  ## The spec `plan` reads
7
8
 
@@ -25,9 +26,9 @@ chunks, each with its own length, text, and styles. Anything with words goes thr
25
26
  What `plan` does with it:
26
27
 
27
28
  - **Whole bars.** A section of `bars` bars at `bpm` lasts `bars × beatsPerBar × 60 / bpm`
28
- seconds; the boundaries are rounded to the millisecond so the total is exact. For `music_v2`
29
- ElevenLabs holds every section to its length, so section starts are bar lines in the render.
30
- - **Limits.** Each section 3 s to 120 s (at 120 BPM a bar is 2 s, so the shortest section is 2
29
+ seconds; the boundaries are rounded to the millisecond so the planned total is exact. Measure
30
+ the generated audio before relying on these boundaries.
31
+ - **Local planning limits.** Each section 3 s to 120 s (at 120 BPM a bar is 2 s, so the shortest section is 2
31
32
  bars); the whole song 3 s to 10 min; a line up to 200 characters.
32
33
  - **Styles.** The first chunk carries the global styles, the tempo and the key (they set the whole
33
34
  song); every later chunk repeats the tempo and adds its own. `avoid` becomes each chunk's
@@ -36,24 +37,18 @@ What `plan` does with it:
36
37
  - **Lines.** A sung section's text is `[Name]` and its lines. About one line a bar at pop tempos,
37
38
  two at most; more comes back rushed or skipped.
38
39
 
39
- ## Traps, measured
40
-
41
- - **A prompt with `lyrics_text` has come back with nothing sung.** Words go in the plan's
42
- sections. `render --prompt` refuses words for this reason.
43
- - **`output_format` is a query option, not a body field.** Put in the JSON body it is rejected
44
- before anything is sent. The script passes `--output-format mp3_48000_192`.
45
- - **Short hooks drift.** In one render a three-word hook came back as a different three words;
46
- making the key word unambiguous (and on a strong beat) fixed it in the next render. The lyric
47
- check (Scribe) is what catches this, not listening once.
48
- - **Contractions drift.** "I'll wake up" came back "I wake up": the check passes lines at 75 % of
49
- their words, and the page should show what is actually sung.
50
- - **The cost is about 27.5 credits per second** of `music_v2` on a paid plan (1,015 credits for
51
- 37 s and 5,204 for 189 s, measured). The quote uses this; the render records the real number off
52
- the account.
53
-
54
- ## What a render leaves
55
-
56
- `music/<slug>/work/render-<n>.mp3` (the audio as rendered), `render-<n>.json` (the plan
57
- ElevenLabs used, song metadata, and word timestamps: the model's own times for every sung
58
- word, which the `video` skill uses for lyric type), `music/<slug>/render.json` (the latest),
59
- `budget.json` (the cap and every call), and a line in `music/receipts.jsonl`.
40
+ ## Generation and review
41
+
42
+ Read the discovered music tool's model guide, supported durations, lyric controls and output
43
+ formats. Adapt the plan to that schema; do not send unsupported fields or assume a fixed model.
44
+ Quote the requested duration through the official integration where available, and keep it
45
+ within the approved budget. Record unknown cost explicitly when no quote is exposed.
46
+
47
+ Short hooks and contractions can drift. Listen to every sung line; use an official transcription
48
+ capability if available and compare the words with the plan. The page should show what is
49
+ actually sung. Timestamps are optional provider output, not guaranteed by Homie.
50
+
51
+ Keep the original audio under `music/<slug>/work/`, along with the local composition plan and
52
+ any usable timing metadata. Place the final audio through `homie-studio media import` and keep
53
+ its normalized receipt in `media/provenance.json`. Local analysis, mastering and loop commands
54
+ operate on downloaded files; they do not generate music or inspect provider credentials.
@@ -38,9 +38,9 @@ src.start(); // after the player's first tap or key: browsers need
38
38
 
39
39
  ## Stems
40
40
 
41
- `music.mjs stems <slug> --yes` asks ElevenLabs to split the master into stems (vocals, drums,
42
- bass, other). It is paid and its price is measured off the account, so it needs the person's
43
- go-ahead and fits inside the song's budget. Stems let a game drop the vocals under dialogue or
41
+ The official ElevenLabs MCP, if its discovered tools expose stem separation, asks ElevenLabs to split the master into stems (vocals, drums,
42
+ bass, other). Price it through the official integration and keep it inside the approved song budget.
43
+ Record provider-reported actual cost, an estimate, or unknown explicitly. Stems let a game drop the vocals under dialogue or
44
44
  bring the drums in when the action starts.
45
45
 
46
46
  ## The page
@@ -16,10 +16,10 @@ Terms change: when a person is about to publish commercially, read the current p
16
16
 
17
17
  ## The plan at render time is what counts
18
18
 
19
- `render` reads the plan before it sends anything and writes it into the render's receipt and
20
- into the manifest entry (`rights.plan`, `rights.commercial`, `rights.attribution`). The song page
21
- shows it in plain words. A render made on the free plan stays under free-plan terms after an
22
- upgrade: to use it commercially, render it again on the paid plan.
19
+ Use the official ElevenLabs MCP's available account and rights information and the current
20
+ terms to record the plan and permitted use at generation time. If the MCP does not expose a
21
+ fact, record it as unknown; do not infer a commercial licence from a successful generation.
22
+ An account upgrade does not retroactively change the terms of earlier output.
23
23
 
24
24
  ## What never goes in
25
25
 
@@ -29,15 +29,12 @@ upgrade: to use it commercially, render it again on the paid plan.
29
29
 
30
30
  ## Receipts
31
31
 
32
- Every paid call leaves three records:
32
+ Before a paid call, record the approved budget and the official tool's quote, if available.
33
+ Keep the accepted request ID so polling or downloading an existing job does not submit it again.
34
+ Save the output and a normalized receipt with `homie-studio media import`, which records the
35
+ provider, tool, model, request ID, prompt, style revision, rights source and date, cost, file
36
+ hash and consumer in `media/provenance.json`.
33
37
 
34
- - `music/<slug>/budget.json`: the cap the person agreed to, who agreed, and every call with its
35
- cost;
36
- - `music/receipts.jsonl`: one line per call (provider, model, the song id, credits quoted and
37
- measured, the plan and rights, the file it made);
38
- - optionally a team ledger: set `HOMIE_SPEND_LEDGER=<file>` (and `HOMIE_SPEND_ATTRIBUTION`) and
39
- each call is also appended there.
40
-
41
- Credits are measured off the account (used before and after the call). Another job spending on
42
- the same account at the same moment shows up in that number; the receipt keeps the quote beside
43
- it.
38
+ Distinguish provider-reported actual cost from an estimate; use unknown when neither is exposed.
39
+ Do not infer job cost from changes in the account balance. Never save raw authentication data,
40
+ signed download URLs or an unfiltered MCP response in the studio.