Commit Graph

124 Commits

Author SHA1 Message Date
victor0602 53921b910f fix: retry transient HTTP failures 2026-08-05 19:54:22 +08:00
RyanLee 9c8870629b Merge pull request #216 from MiniMax-AI/fix/secret-key-balance-usage
fix: support secret key balance usage
2026-08-01 18:27:19 +08:00
yuanhe 9aa05d24c4 fix: support secret key balance usage 2026-08-01 18:24:04 +08:00
NianJiuZst dd9789c264 fix: harden H3 video SDK and errors 2026-08-01 15:11:42 +08:00
kapelame 0c4affd462 feat: add Hailuo H3 video generation support 2026-08-01 14:28:03 +08:00
NianJiu 3615170a2e Merge pull request #206 from shaoohh/agent/reject-truncated-downloads
fix: reject truncated downloads
2026-07-19 02:18:44 +08:00
shaoohh 5c149122d9 fix: report unavailable quota models 2026-07-19 01:49:46 +08:00
shaoohh 1998a48757 fix: reject truncated downloads 2026-07-19 01:49:32 +08:00
yuanhe a14a46a947 release: v1.0.18 2026-07-16 21:43:43 +08:00
RyanLee 79a6b2b448 Merge pull request #161 from han-dreamer/test/windows-temp-file-fixtures
test: avoid /dev/null in command tests
2026-07-15 19:10:04 +08:00
NianJiu 90142665b2 Merge pull request #195 from MiniMax-AI/codex/mask-api-key-config
fix: mask API key output and clear conflicting OAuth credentials
2026-07-15 14:10:02 +08:00
NianJiuZst 952d6f1349 fix: support music covers and surface stream errors 2026-07-15 14:05:42 +08:00
NianJiuZst dc9b7e2076 fix: mask stored API keys and clear OAuth 2026-07-15 13:54:37 +08:00
NianJiu ab29137159 Merge pull request #196 from MiniMax-AI/codex/align-music-api
fix: align music CLI and SDK with the current API contract
2026-07-14 21:08:43 +08:00
NianJiu 06eec7ab47 Merge pull request #194 from MiniMax-AI/codex/region-detection-fail-closed
fix: fail closed when API key region detection is inconclusive
2026-07-14 20:54:14 +08:00
NianJiuZst b4039d8e17 test: isolate config command mocks 2026-07-14 20:21:41 +08:00
NianJiuZst faab965e9a fix: distinguish auth and network validation failures 2026-07-14 20:21:32 +08:00
NianJiuZst facbb951d9 fix: align music clients with current API 2026-07-14 18:34:53 +08:00
NianJiuZst 98b9becb67 fix: fail closed when region detection is inconclusive 2026-07-14 18:34:52 +08:00
NianJiuZst 1635a84767 fix: isolate PR checks from review secrets 2026-07-14 18:34:52 +08:00
NianJiu eca6acfac3 Merge pull request #179 from Osamaali313/fix/boolean-flag-explicit-value
fix(args): honor explicit value on boolean flags (--flag=false)
2026-07-14 17:53:26 +08:00
NianJiu 9ad4f569b8 Merge pull request #189 from kartikkabadi/fix/document-mmx-config-dir
fix(auth): document MMX_CONFIG_DIR in credential errors
2026-07-14 16:16:24 +08:00
NianJiuZst 2f271f1f5c fix(auth): harden credential remediation guidance
Co-authored-by: Kartik <kartikkabadi@users.noreply.github.com>
2026-07-14 16:14:18 +08:00
NianJiu ad37c1126e Merge pull request #162 from han-dreamer/fix/config-write-exdev
fix: handle cross-device config writes
2026-07-14 16:03:35 +08:00
NianJiu 7324d508e6 Merge pull request #160 from MiniMax-AI/fix/music-cover-preprocess
fix: preprocess music cover lyrics flow
2026-07-14 15:58:41 +08:00
NianJiu 7818341ced Merge pull request #188 from kartikkabadi/fix/pronunciation-dict-shape
fix(speech): serialize pronunciation dictionary correctly
2026-07-14 15:56:01 +08:00
NianJiu bd52360a43 Merge pull request #183 from minmax/fix/file-upload-endpoint
fix file upload endpoint
2026-07-14 15:46:15 +08:00
NianJiu 8e876a9636 Merge pull request #158 from Ricardo-M-L/contrib/fix-stream-reader-lock-leak
fix(update): wait for writer flush, honour backpressure, clean up tmp on failure
2026-07-14 15:24:35 +08:00
Kartik 76e78691b6 fix(speech): serialize pronunciation dictionary correctly
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 13:40:08 +05:30
Kartik 213ca64780 fix(auth): document MMX_CONFIG_DIR in credential errors
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 13:35:27 +05:30
Karataev Pavel 4d4f368ab0 fix file upload endpoint 2026-06-22 22:50:15 +03:00
Osamaali313 9f1f093b81 refactor(args): validate explicit boolean flag values (review feedback)
Address PR review:
- hoist the recognised true/false token sets to module-level Sets instead
  of allocating an array on every boolean-flag parse
- accept common spellings (true/1/yes/on, false/0/no/off; case- and
  whitespace-insensitive) and throw a clear error for an unrecognised
  explicit value (e.g. `--flag=maybe`, `--flag=`) so a typo cannot
  silently enable a flag, consistent with numeric-flag validation
- expand tests to cover no/off, case/whitespace, true-like values, and the
  rejection path
2026-06-15 23:15:26 +03:00
Osamaali313 b7c8b7749d fix(args): honor explicit value on boolean flags (--flag=false)
parseFlags set a boolean flag to `true` as soon as it matched the flag,
before inspecting an inline `=value`. So `--flag=false` (or `--flag=0`)
was silently set to `true` -- the opposite of what the user typed -- and
the value was discarded.

Honor an explicit value: `--flag=false`/`0`/`no`/`off` -> false; a bare
`--flag` and `--flag=true` (or any other value) stay true, so there is no
behavior change for existing usage.

Adds parseFlags tests for the bare-flag and explicit-value cases.
2026-06-15 22:54:51 +03:00
yuanhe 83dd37f449 fix(quota): render weekly boost (150%) and unlimited (status=3) quota
The /v1/token_plan/remains endpoint returns two signals the renderer
ignored:

  - weekly_boost_permille (千分制, e.g. 1500 ⇒ ×1.5 ⇒ display up to 150%)
  - current_weekly_status === 3 ⇒ weekly quota is unlimited

Previously, the weekly row always used the raw remaining percent, so
a 1.5x boost plan showed 100% instead of 150%, and an unlimited plan
was visually indistinguishable from a normal 100% account.

Changes:
  - api.ts: add weekly_boost_permille?, current_interval_status?,
    current_weekly_status? to QuotaModelRemain
  - quota-table.ts: multiply weekly percent by boost_permille/1000,
    render '无限' / 'unlimited' for status=3, raise display ceiling to
    200% to accommodate boosted values
  - quota-table.test.ts: cover 150% boost, 200% clamp, unlimited CN/EN
2026-06-09 20:29:43 +08:00
kapelame c3a58e9d3e fix(quota): use /v1/token_plan/remains and honor custom base URL
quotaEndpoint() ignored its baseUrl argument and rebuilt the host from a
`baseUrl.includes('minimaxi.com')` check, which broke `--base-url` /
custom gateways — it was the only endpoint in the file not using the
passed baseUrl. It also pointed at the legacy
`/v1/api/openplatform/coding_plan/remains` path; the server now serves
the quota under `/v1/token_plan/remains` (matching the Token Plan
naming). With a line-matched API key the old path returns
"cookie is missing, log in again" while the new path works.

- quotaEndpoint: return `${baseUrl}/v1/token_plan/remains`, dropping the
  host rewrite (REGIONS base URLs are already api-subdomain hosts).
- detect-region: probe the same new path.
- update endpoint/sdk/timeout mocks and add a custom-base-URL test.

Verified live on both lines: `quota show` renders quota over
GET .../v1/token_plan/remains for global and cn.
2026-06-08 20:03:32 +08:00
han 8de250248d test: cover EXDEV config write fallback 2026-06-02 19:58:12 +08:00
dabaotongxue e548747390 feat: use coding plan quota remains
- switch quota calls to the coding plan remains endpoint because the usage page now exposes aggregated resources through that API
- render current and weekly remaining quota in a compact single-line layout so terminal users can scan the new response shape quickly
- add regression coverage for coding plan remaining percentages and updated quota endpoint paths
2026-06-01 18:29:06 +08:00
han 3a49a14748 fix: handle cross-device config writes 2026-05-24 19:59:25 +08:00
han 8c5a4e160c test: avoid /dev/null in command tests 2026-05-23 01:25:51 +08:00
yuj 0791c282bd test(self-update): cover stream-failure cleanup + tighten error teardown
Review feedback on #158 (thanks @NianJiuZst): the error path needs to
tear the writer down BEFORE unlinking dest, otherwise the writer's
buffered bytes can race the unlink and leave a partial file in the
pagecache. And the function still had no test coverage, so the
`finish`/`drain`/cleanup/`releaseLock()` behaviour could regress
silently.

Changes:

* `downloadFile`: on error, `writer.destroy()` and await `'close'`
  before calling `unlinkSync(dest)`. Skip the wait when the writer
  is already torn down so the rejection's exception isn't masked.
* Export `downloadFile` from `src/update/self-update.ts` so unit
  tests can drive it directly (still not part of the public CLI
  surface — callers go through `applySelfUpdate`).
* Add `test/update/self-update.test.ts` with three tests, matching
  the existing `test/files/download.test.ts` style:
    - mid-stream `ReadableStream` error path: rejects, dest gone,
      tempdir empty (the case the reviewer specifically asked for)
    - happy path: payload written, dest exists
    - 4xx response: rejects with CLIError, dest not created
  `npx tsc --noEmit` passes.
2026-05-22 10:48:02 +08:00
yuanhe 2d65debf60 fix: preprocess music cover lyrics flow 2026-05-21 19:58:37 +08:00
RyanLee a6b93ba03c Merge pull request #156 from NianJiuZst/test/complete-core-coverage
test: comprehensive test coverage improvements (pure functions, SDK validation, command tests)
2026-05-17 16:31:44 +08:00
yuanhe 435758c7df release: v1.0.14
- fix test isolation: support MMX_CONFIG_DIR env for config path override
- remove free-tier music models (music-2.6-free, music-cover-free), default to music-2.6 / music-cover
- improve auth login prompt: show region info for API key option
2026-05-17 15:59:33 +08:00
NianJiuZst f8c8f33d1b fix: use beforeEach to clean CI env and properly restore TTY mocks 2026-05-16 22:10:56 +08:00
NianJiuZst 94904961ad fix: add missing createProgressBar to poll test mock 2026-05-16 22:06:34 +08:00
NianJiuZst 8860500407 fix: catch unhandled rejections in SDK and poll tests 2026-05-16 21:58:14 +08:00
NianJiuZst 60ce237e8c test: improve quota show command tests 2026-05-16 21:50:30 +08:00
NianJiuZst 6ed7c6b96d test: add mock server tests for search query command 2026-05-16 21:50:24 +08:00
NianJiuZst b753265902 test: add validation tests for file upload command (file existence, dry-run) 2026-05-16 21:46:01 +08:00
NianJiuZst 357347a4c1 test: add validation tests for image generate command (width/height, out constraints) 2026-05-16 21:45:14 +08:00