feat: add tests, Node.js compatibility, and structured music flags#29
Closed
raylanlin wants to merge 9 commits intoMiniMax-AI:mainfrom
Closed
feat: add tests, Node.js compatibility, and structured music flags#29raylanlin wants to merge 9 commits intoMiniMax-AI:mainfrom
raylanlin wants to merge 9 commits intoMiniMax-AI:mainfrom
Conversation
511c113 to
58e2d06
Compare
added 2 commits
April 6, 2026 09:58
- Add test/commands/file/upload.test.ts - Add test/commands/search/query.test.ts - Add test/commands/vision/describe.test.ts - Add resetStatusBar() to fix test state pollution (Issue #9) - Replace Bun.file() with fs/promises.readFile() for Node.js compatibility
Add --vocals, --genre, --mood, --instruments, --bpm, and --avoid flags to the music generate command. These flags are merged into the --prompt string before the API call, making it easy to describe vocal style and musical characteristics without hand-crafting a long prompt. music-2.5 interprets rich natural-language prompts — vocal descriptors like "warm male and bright female duet" and instrumentation details are reflected in the generated output. The previous --help examples only showed 2-3 word style descriptions, which didn't communicate this capability. Also adds instrumental music guidance in the examples: since music-2.5 has no --instrumental flag, the examples now show the [intro] [outro] workaround alongside a descriptive prompt. Tests: 68 pass, 0 fail (3 new tests added)
added 7 commits
April 6, 2026 10:03
Adds --extra flag to capture requirements not covered by other structured flags, such as per-section dynamics, specific playing techniques, or other details that don't fit into --vocals, --genre, --mood, etc. Example: --extra "verse 1 male solo, verse 2 female solo, chorus layered harmonies"
…ll parity Adds three missing structured flags from skill's generate_music.sh: - --tempo: qualitative tempo description (fast/slow/moderate) - --key: musical key (C major, A minor, etc.) - --instrumental: boolean flag for pure music (no vocals) The --instrumental flag uses the same [intro] [outro] workaround as the skill, but makes it a single boolean switch instead of requiring manual lyrics + avoid flags. CLI now has full parity with skill plus one extra flag: - --extra: catch-all for any additional requirements Total structured flags: vocals, genre, mood, instruments, tempo, bpm, key, avoid, extra, instrumental (10 flags)
All three flags from skill's generate_music.sh are now standalone: - --use-case: context like "background music", "theme song" - --structure: song layout like "verse-chorus-verse-bridge-chorus" - --references: reference tracks/artists like "similar to Ed Sheeran"" --extra remains as a catch-all for any other fine-grained requirements. Total structured flags now: 13 (vocals, genre, mood, instruments, tempo, bpm, key, use-case, structure, references, avoid, extra, instrumental)
- Only apply instrumental workaround when lyrics is not provided - Skip 'No lyrics' warning for instrumental tracks - Reorder structuredParts to match options list order
- Reject --instrumental when --lyrics or --lyrics-file is provided (conflicting intent: instrumental means no vocals) - Support '无歌词' / 'no lyrics' in --lyrics as instrumental request - Update --lyrics description to mention '无歌词' option - Update examples to show both --instrumental and --lyrics '无歌词' - Add 3 new tests for instrumental/lyrics conflict handling
- Add '无歌词' hint to --lyrics-file description for consistency - Remove redundant 'no lyrics.' check (users won't type with period) - Clarify conflict error message for --instrumental + --lyrics - Add test for 'no lyrics' (English) as instrumental request
Adds --aigc-watermark boolean flag to embed AI-generated content watermark in the generated audio. This is useful for content provenance and compliance purposes. - Update MusicRequest type to include aigc_watermark field - Add flag to options list with clear description - Add to test coverage
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
This PR bundles three independent improvements:
1. Missing tests for new commands (file/upload, search/query, vision/describe)
Three commands introduced in recent PRs had no test coverage. Added tests following the existing pattern.
2. Node.js compatibility fixes
resetStatusBar()export (src/output/status-bar.ts)file/upload.ts— replace Bun-specific APIsBun.file().size→fs.statSync().size(Node.js 18+)3. Structured flags for
music generate(full skill parity)Problem: The
--helpexamples only showed minimal style descriptions ("Upbeat pop"), which did not communicate thatmusic-2.5interprets rich natural-language prompts well.New flags (all merged into
--promptbefore the API call):--vocals"warm male and bright female duet"--genrefolk,pop,jazz--moodwarm,melancholic,uplifting--instruments"acoustic guitar, piano"--tempofast,slow,moderate--bpm95--keyC major,A minor--use-case"background music for video","theme song"--structure"verse-chorus-verse-bridge-chorus"--references"similar to Ed Sheeran, Taylor Swift"--avoid"electronic beats"--instrumental--instrumental--extra"bridge builds tension"Complete parity with skill — all 12 flags from
generate_music.share now standalone, plus--extraas a catch-all.Tests
68 pass, 0 fail, 98 expect() calls (was 65/0/81)