@molecule/api-ai-minimax 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-10-16T23:28:28.746Z
6
+ Generated: 2026-11-13T19:22:13.914Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-ai-minimax
@@ -152,7 +152,7 @@ export function setupAiMinimax(): void {
152
152
 
153
153
  Peer dependencies:
154
154
 
155
- - `@molecule/api-ai` ^1.0.1
155
+ - `@molecule/api-ai` ^1.6.0
156
156
  - `@molecule/api-bond` ^1.0.1
157
157
  - `@molecule/api-i18n` ^1.0.1
158
158
  - `@molecule/api-secrets` ^1.0.1
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,UAAU,EAQX,MAAM,kBAAkB,CAAA;AASzB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAgyB/C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,UAAU,CAEjE"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,UAAU,EAQX,MAAM,kBAAkB,CAAA;AASzB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AA0yB/C;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,UAAU,CAEjE"}
package/dist/provider.js CHANGED
@@ -488,12 +488,14 @@ class MiniMaxAIProvider {
488
488
  // prompt_tokens INCLUDES cached tokens on OpenAI-compatible APIs — report
489
489
  // the cached portion separately (cacheReadPricePerMTok) and only the fresh
490
490
  // remainder as inputTokens, matching the other bonds' semantics.
491
+ const reasoning = usage?.completion_tokens_details?.reasoning_tokens;
491
492
  const cachedTokens = usage?.prompt_tokens_details?.cached_tokens ?? 0;
492
493
  yield {
493
494
  type: 'done',
494
495
  usage: {
495
496
  inputTokens: Math.max(0, (usage?.prompt_tokens ?? 0) - cachedTokens),
496
497
  outputTokens: usage?.completion_tokens ?? 0,
498
+ ...(typeof reasoning === 'number' ? { reasoningOutputTokens: reasoning } : {}),
497
499
  ...(cachedTokens ? { cacheReadInputTokens: cachedTokens } : {}),
498
500
  },
499
501
  };
@@ -580,6 +582,9 @@ class MiniMaxAIProvider {
580
582
  usage: {
581
583
  inputTokens: Math.max(0, state.inputTokens - state.cacheReadTokens),
582
584
  outputTokens: state.outputTokens,
585
+ ...(state.reasoningOutputTokens !== undefined
586
+ ? { reasoningOutputTokens: state.reasoningOutputTokens }
587
+ : {}),
583
588
  ...(state.cacheReadTokens ? { cacheReadInputTokens: state.cacheReadTokens } : {}),
584
589
  },
585
590
  provider: call.meta,
@@ -658,6 +663,9 @@ class MiniMaxAIProvider {
658
663
  // Usage info (may appear in the final chunk)
659
664
  const usage = event.usage;
660
665
  if (usage) {
666
+ const reasoning = usage.completion_tokens_details?.reasoning_tokens;
667
+ if (typeof reasoning === 'number')
668
+ state.reasoningOutputTokens = reasoning;
661
669
  if (usage.prompt_tokens)
662
670
  state.inputTokens = usage.prompt_tokens;
663
671
  if (usage.completion_tokens)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-ai-minimax",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "MiniMax AI provider for molecule.dev",
5
5
  "homepage": "https://www.molecule.dev/packages/api-ai-minimax",
6
6
  "type": "module",
@@ -33,14 +33,14 @@
33
33
  "directory": "packages/api/bonds/ai/minimax"
34
34
  },
35
35
  "devDependencies": {
36
- "@molecule/api-ai": "1.5.0",
36
+ "@molecule/api-ai": "1.6.1",
37
37
  "@molecule/api-bond": "1.0.4",
38
38
  "@types/node": "26.6.5",
39
39
  "typescript": "6.0.3",
40
40
  "vitest": "4.1.12"
41
41
  },
42
42
  "peerDependencies": {
43
- "@molecule/api-ai": "^1.0.1",
43
+ "@molecule/api-ai": "^1.6.0",
44
44
  "@molecule/api-bond": "^1.0.1",
45
45
  "@molecule/api-i18n": "^1.0.1",
46
46
  "@molecule/api-secrets": "^1.0.1"