Files
music-video-gen/flow-state/package.json
T
DejvinoandClaude b7c3537fcb LLM song-tweak: AI Gateway via Vercel AI SDK, budgeted tune flow
Add a ✨ tune button that lets an LLM inspect the proposed
visualization and tweak the proc-song knobs so the next generation
looks better. Edits only the 7 songbank params (bpm, brightness,
noise, noiseColour, dynamics, transition, arrangement) — never the
Look — then re-synthesizes and re-generates locally for preview.

- ai + @ai-sdk/openai + zod (library per plan) against the Vercel AI
  Gateway (OpenAI-compatible, configurable via
  VITE_AI_GATEWAY_URL/MODEL/API_KEY, localStorage override,
  .env.example).
- Structured output (TweakResultSchema) + clampEdits enforces ranges;
  prompt ≤ ~2.5k tokens, max 2-3 knobs ±0.15 / bpm ±8.
- Budget caps: 3/load + 10/session (sessionStorage), checked before
  network, NO_EDITS refunded, offline/auth/rate-limit mapped.
- Prompt split into src/llm/spec.js (pure, node-testable) + llmTweak.js
  (gateway + digest) to keep `node --test` off the Vite JSON path.
- UI: ⚙️ gateway/model/key dialog (localStorage flow-state:llm),
  confirm(prompt) with hint, diff modal with Apply/Dismiss; Apply
  synthesizes → FeatureTrack → generateLook → Show.useTrack.
- Tests: 7 new LLM cases (clamp, schema, prompt, budget), 18/18 pass.
  Build + lint:scenes green.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-13 20:03:27 +02:00

30 lines
803 B
JSON

{
"name": "flow-state",
"version": "1.0.0",
"description": "Ambient/EDM music video generator with a deterministic render core",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"lint:scenes": "node tools/lint-scenes.js",
"test": "node --test test/*.test.js",
"new:scene": "node tools/new-scene.js",
"build:songs": "node tools/build-song-bank.js",
"check:songs": "node tools/build-song-bank.js --check",
"cast:census": "node tools/cast-census.js"
},
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.62.1",
"vite": "^7.2.2"
},
"dependencies": {
"@ai-sdk/openai": "^3.0.112",
"ai": "^6.0.282",
"mp4-muxer": "^5.2.2",
"three": "^0.181.1",
"zod": "^4.6.4"
}
}