Skip to content

feat: add tests, Node.js compatibility, and structured music flags#29

Closed
raylanlin wants to merge 9 commits intoMiniMax-AI:mainfrom
raylanlin:main
Closed

feat: add tests, Node.js compatibility, and structured music flags#29
raylanlin wants to merge 9 commits intoMiniMax-AI:mainfrom
raylanlin:main

Conversation

@raylanlin
Copy link
Copy Markdown
Collaborator

@raylanlin raylanlin commented Apr 5, 2026

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)

  • Added exported function so tests can reset module-level state (fixes #9)

file/upload.ts — replace Bun-specific APIs

  • Bun.file().sizefs.statSync().size (Node.js 18+)

3. Structured flags for music generate (full skill parity)

Problem: The --help examples only showed minimal style descriptions ("Upbeat pop"), which did not communicate that music-2.5 interprets rich natural-language prompts well.

New flags (all merged into --prompt before the API call):

Flag Description Example
--vocals Vocal style "warm male and bright female duet"
--genre Music genre folk, pop, jazz
--mood Mood/emotion warm, melancholic, uplifting
--instruments Instruments "acoustic guitar, piano"
--tempo Tempo description fast, slow, moderate
--bpm Exact BPM 95
--key Musical key C major, A minor
--use-case Use case context "background music for video", "theme song"
--structure Song structure "verse-chorus-verse-bridge-chorus"
--references Reference tracks "similar to Ed Sheeran, Taylor Swift"
--avoid Elements to avoid "electronic beats"
--instrumental Pure music flag --instrumental
--extra Additional requirements "bridge builds tension"

Complete parity with skill — all 12 flags from generate_music.sh are now standalone, plus --extra as a catch-all.


Tests

68 pass, 0 fail, 98 expect() calls (was 65/0/81)

@raylanlin raylanlin force-pushed the main branch 2 times, most recently from 511c113 to 58e2d06 Compare April 5, 2026 03:07
@raylanlin raylanlin changed the title Fix: add missing tests, resetStatusBar, and Node.js compatibility feat: add tests, Node.js compatibility, and structured music flags Apr 6, 2026
Raylan LIN 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)
Raylan LIN 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
@raylanlin raylanlin closed this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant