feat(music): integrate Flow Music & Google Labs MusicFX generation across CLI, API, MCP, and Chrome extension - #7
Open
Veer376 wants to merge 1 commit into
Open
Conversation
…ross CLI, API, MCP, and Chrome extension - Chrome Extension: add host permissions and token capture for flowmusic.app, plus SSE stream listener for clip delivery - Flow Engine (t2m.py): implement T2M generator with primary Flow Music pipeline and automatic Google Labs MusicFX fallback - HTTP API: add POST /v1/audio/generations and /v1/music/generations with Idempotency-Key support and history registry - MCP Server: add generate_flow_music tool with duration, loop, count, and seed parameters - Unified CLI: add 'flow music' command with duration, looping, variation counts, and exact output paths - Media Sniffing: extend signature detection for MP3, WAV, M4A, FLAC, OGG, and AAC formats - Tests & Docs: add 13 unit tests for music generator/API/sniffing and update README documentation
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends Flow Agent with full Text-to-Music (T2M) and soundtrack generation capabilities powered by Flow Music (
flowmusic.app) and Google Labs MusicFX (aisandbox-pa.googleapis.com).Music generation is now natively accessible across all Flow Agent interfaces: the unified CLI (
flow music), OpenAI-compatible HTTP API (/v1/audio/generationsand/v1/music/generations), MCP server (generate_flow_music), and Chrome extension bridge.What Changed
1. Chrome Extension Bridge (
flow-extension/)flowmusic.appandwww.flowmusic.app.getOrCaptureFlowMusicToken) from active Flow Music browser tabs vialocalStorage./__api/messages/{job_id}/streamto reliably capture asynchronousclip_idevents.conversation,stream,clips) through the extension with appropriate origin and bearer credentials.2. Flow Engine & Generator (
flow_engine/generators/t2m.py,bridge.py,config.py)t2m.py): Submits conversation requests, processes streamed generation events, fetches clip metadata (audio URL, WAV URL, title, duration), and downloads the resulting audio tracks./v1:runMusicFx,/v1:runSoundDemo,/v1/sound:generate,/v1/music:batchGenerateMusic) if Flow Music is unavailable or if explicitly requested.MUSIC_DURATIONS = [10, 30, 50, 70], default: 30s).3. HTTP API & Request Models (
flow_server/)POST /v1/audio/generationsand aliasPOST /v1/music/generations.MusicGenerationRequestwithprompt,duration,loop,n(1-4 variations),seed, andresponse_format(urlorb64_json).Idempotency-Keyheaders to prevent duplicate generation requests, and automatic tracking into persistenthistory.json.4. Unified CLI (
main.py)flow musiccommand:5. MCP Server (
flow_server/mcp_server.py)generate_flow_musictool enabling AI assistants (Claude, Cursor, Windsurf, Antigravity) to generate music tracks and ambient soundscapes with configurable durations, looping, count, and seeds.6. Media Sniffing & History Registry (
media_types.py,media_history.py)7. Documentation (
README.md,.gitignore)flow musicCLI examples,generate_flow_musicMCP documentation, and HTTP API endpoint details.*.mp3,*.m4a,*.wav,*.ogg,*.flac,*.aac) to.gitignore.Verification & Tests
tests/test_music_generation.py(13 tests) covering:uv run pytest -k "not test_ext_http_api").uvx ruff check . --select F,E9with 0 warnings or errors.manifest.jsonandbackground.jssyntax verified.