@hiper2d/ai-agents 0.28.1 → 0.29.0
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/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +41 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1267,20 +1267,29 @@ var SupportedAiModels = {
|
|
|
1267
1267
|
thinkingBudgetTokens: 1024,
|
|
1268
1268
|
tags: ["slow", "cheap"]
|
|
1269
1269
|
},
|
|
1270
|
-
// MiniMax M3 (OpenAI-compatible endpoint, 1M context).
|
|
1271
|
-
//
|
|
1272
|
-
//
|
|
1273
|
-
//
|
|
1274
|
-
//
|
|
1275
|
-
//
|
|
1276
|
-
// Temperature
|
|
1270
|
+
// MiniMax M3.1 Flash (OpenAI-compatible endpoint, 1M context). `minimax` repointed 2026-10-27
|
|
1271
|
+
// from MiniMax-M3 ($0.30/$1.20 after the permanent 50% off, 25s single-sample turn, 60s
|
|
1272
|
+
// timeouts in prod on 2026-10-25 and 10-27) to MiniMax-M3.1-Flash: half the price
|
|
1273
|
+
// ($0.15/$0.60), and the first MiniMax model with an effort dial — low|medium|high|xhigh|max,
|
|
1274
|
+
// provider default max, so it is pinned. Thinking is always on (`thinking: disabled` → 400),
|
|
1275
|
+
// thinking arrives in `reasoning_content` because the agent sends `reasoning_split: true`
|
|
1276
|
+
// (M3.1 rejects false). Temperature and top_p are documented as ignored ("not supported
|
|
1277
|
+
// yet", always 1 / 0.95), so the entry sets none and the agent sends none.
|
|
1278
|
+
// Live 2026-10-27 at medium: the all-providers sweep ran the schema ask in 3.1s, prose in
|
|
1279
|
+
// 1.7s and the 8-character scene (363 output tokens) in 2.4s — ~150 tok/s, the fastest
|
|
1280
|
+
// provider in the sweep that day (Kimi Highspeed's scene takes 8s); a 3.2k-token game
|
|
1281
|
+
// prompt with a two-sentence JSON reply took 1.9-2.1s at every effort level vs 3.5s for M3.
|
|
1282
|
+
// Tagged `fast` rather than `very-fast`: the sweep straddles the 3s line and production
|
|
1283
|
+
// turns carry 10k+ tokens of context. Launched 2026-09-27 as Token-Plan-only (the
|
|
1284
|
+
// 2026-10-02 probe got `unknown model` on the pay-as-you-go key); on the key since at
|
|
1285
|
+
// least 2026-10-27.
|
|
1277
1286
|
[LLM_CONSTANTS.MINIMAX]: {
|
|
1278
|
-
displayName: "MiniMax M3",
|
|
1279
|
-
modelApiName: "MiniMax-M3",
|
|
1287
|
+
displayName: "MiniMax M3.1 Flash",
|
|
1288
|
+
modelApiName: "MiniMax-M3.1-Flash",
|
|
1280
1289
|
apiKeyName: API_KEY_CONSTANTS.MINIMAX,
|
|
1281
1290
|
hasThinking: true,
|
|
1282
|
-
|
|
1283
|
-
tags: ["
|
|
1291
|
+
reasoningEffort: "medium",
|
|
1292
|
+
tags: ["fast", "cheap"]
|
|
1284
1293
|
},
|
|
1285
1294
|
// Meta Muse Spark 1.3 (added 2026-09-12) on Meta's own Model API — Standard tier, i.e.
|
|
1286
1295
|
// the private model id (the `-contributor` id is a quarter of the price but Meta trains
|
|
@@ -1597,18 +1606,14 @@ var MODEL_PRICING = {
|
|
|
1597
1606
|
outputPrice: 0.47,
|
|
1598
1607
|
cacheHitPrice: 0.016
|
|
1599
1608
|
},
|
|
1600
|
-
// MiniMax M3. Rates from platform.minimax.io/docs/guides/pricing-paygo (2026-
|
|
1601
|
-
//
|
|
1602
|
-
// (≥512 input tokens), hits reported in
|
|
1603
|
-
//
|
|
1609
|
+
// MiniMax M3.1 Flash. Rates from platform.minimax.io/docs/guides/pricing-paygo (2026-10-27,
|
|
1610
|
+
// USD): one tier across the 1M window (M3 had ≤512k / >512k tiers; the page lists none for
|
|
1611
|
+
// M3.1 Flash). Caching is automatic (≥512 input tokens), hits reported in
|
|
1612
|
+
// prompt_tokens_details.cached_tokens; no write fee listed.
|
|
1604
1613
|
[SupportedAiModels[LLM_CONSTANTS.MINIMAX].modelApiName]: {
|
|
1605
|
-
inputPrice: 0.
|
|
1606
|
-
outputPrice:
|
|
1607
|
-
cacheHitPrice: 0.
|
|
1608
|
-
extendedContextInputPrice: 0.6,
|
|
1609
|
-
extendedContextOutputPrice: 2.4,
|
|
1610
|
-
extendedContextCacheHitPrice: 0.12,
|
|
1611
|
-
extendedContextThresholdTokens: 512e3
|
|
1614
|
+
inputPrice: 0.15,
|
|
1615
|
+
outputPrice: 0.6,
|
|
1616
|
+
cacheHitPrice: 0.015
|
|
1612
1617
|
},
|
|
1613
1618
|
// Meta Muse Spark 1.3, Standard tier. Rates from ai.developer.meta.com/docs/pricing-rate-limits
|
|
1614
1619
|
// (2026-09-12): no long-context premium at any point of the 1M window; reasoning tokens bill
|
|
@@ -1638,7 +1643,7 @@ var HYBRID_THINKING_API_NAMES = /* @__PURE__ */ new Set([
|
|
|
1638
1643
|
// hybrid by the same definition: we force reasoning on, so they carry the multiplier.
|
|
1639
1644
|
SupportedAiModels[LLM_CONSTANTS.QWEN_MAX].modelApiName,
|
|
1640
1645
|
SupportedAiModels[LLM_CONSTANTS.QWEN_FLASH].modelApiName,
|
|
1641
|
-
|
|
1646
|
+
// MiniMax left the set 2026-10-27: M3.1 Flash cannot turn thinking off (M3 could).
|
|
1642
1647
|
// Mistral reasons only when asked (`reasoning_effort`), and we always ask — hybrid by the
|
|
1643
1648
|
// same definition as Qwen. Added 2026-09-18 when the Mistral entries went thinking-on.
|
|
1644
1649
|
SupportedAiModels[LLM_CONSTANTS.MISTRAL_SMALL].modelApiName
|
|
@@ -1711,6 +1716,7 @@ var META_REASONING_EFFORTS = ["minimal", "low", "medium", "high", "xhigh", "max"
|
|
|
1711
1716
|
var MISTRAL_REASONING_EFFORTS = ["high"];
|
|
1712
1717
|
var XAI_REASONING_EFFORTS = ["low", "medium", "high", "xhigh"];
|
|
1713
1718
|
var KIMI_REASONING_EFFORTS = ["low", "high", "max"];
|
|
1719
|
+
var MINIMAX_REASONING_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
|
|
1714
1720
|
function clampReasoningEffort(effort, allowed) {
|
|
1715
1721
|
const rank = REASONING_EFFORT_SCALE.indexOf(effort);
|
|
1716
1722
|
let best = allowed[0];
|
|
@@ -1734,6 +1740,7 @@ var toFuguEffort = (effort) => clampReasoningEffort(effort, FUGU_REASONING_EFFOR
|
|
|
1734
1740
|
var toMistralEffort = (effort) => clampReasoningEffort(effort, MISTRAL_REASONING_EFFORTS);
|
|
1735
1741
|
var toXaiEffort = (effort) => clampReasoningEffort(effort, XAI_REASONING_EFFORTS);
|
|
1736
1742
|
var toKimiEffort = (effort) => clampReasoningEffort(effort, KIMI_REASONING_EFFORTS);
|
|
1743
|
+
var toMiniMaxEffort = (effort) => clampReasoningEffort(effort, MINIMAX_REASONING_EFFORTS);
|
|
1737
1744
|
|
|
1738
1745
|
// src/pricing/token-usage-utils.ts
|
|
1739
1746
|
function extractTokenUsage(response) {
|
|
@@ -5051,10 +5058,10 @@ var MiniMaxAgent = class extends AbstractAgent {
|
|
|
5051
5058
|
get defaultParams() {
|
|
5052
5059
|
return {
|
|
5053
5060
|
model: this.model,
|
|
5054
|
-
temperature: this.temperature,
|
|
5061
|
+
...this.temperature !== void 0 ? { temperature: this.temperature } : {},
|
|
5055
5062
|
stream: false,
|
|
5056
|
-
// MiniMax deprecates max_tokens in favor of max_completion_tokens (
|
|
5057
|
-
// far above anything a turn needs).
|
|
5063
|
+
// MiniMax deprecates max_tokens in favor of max_completion_tokens (the M-series max is
|
|
5064
|
+
// 512K, far above anything a turn needs).
|
|
5058
5065
|
max_completion_tokens: this.maxOutputTokens
|
|
5059
5066
|
};
|
|
5060
5067
|
}
|
|
@@ -5076,7 +5083,9 @@ var MiniMaxAgent = class extends AbstractAgent {
|
|
|
5076
5083
|
thinkingParams() {
|
|
5077
5084
|
return {
|
|
5078
5085
|
thinking: { type: this.enableThinking ? "adaptive" : "disabled" },
|
|
5079
|
-
reasoning_split: true
|
|
5086
|
+
reasoning_split: true,
|
|
5087
|
+
// Provider default is max; the catalog pins M3.1 Flash to medium. Older models ignore it.
|
|
5088
|
+
...this.enableThinking && this.reasoningEffort ? { reasoning_effort: toMiniMaxEffort(this.reasoningEffort) } : {}
|
|
5080
5089
|
};
|
|
5081
5090
|
}
|
|
5082
5091
|
convertToOpenAIMessages(messages) {
|
|
@@ -5489,7 +5498,7 @@ var AgentFactory = class {
|
|
|
5489
5498
|
case LLM_CONSTANTS.QWEN_MAX:
|
|
5490
5499
|
case LLM_CONSTANTS.QWEN_FLASH:
|
|
5491
5500
|
return new QwenAgent(name, instruction, model.modelApiName, key, model.temperature, shouldEnableThinking);
|
|
5492
|
-
// MiniMax M3 — adaptive thinking
|
|
5501
|
+
// MiniMax M3.1 Flash — always-on adaptive thinking, effort from the catalog
|
|
5493
5502
|
case LLM_CONSTANTS.MINIMAX:
|
|
5494
5503
|
return new MiniMaxAgent(name, instruction, model.modelApiName, key, model.temperature, shouldEnableThinking);
|
|
5495
5504
|
// Meta Muse Spark — Responses API with encrypted reasoning replay, effort from the catalog
|
|
@@ -5540,6 +5549,7 @@ export {
|
|
|
5540
5549
|
LLM_CONSTANTS,
|
|
5541
5550
|
MESSAGE_ROLE,
|
|
5542
5551
|
META_REASONING_EFFORTS,
|
|
5552
|
+
MINIMAX_REASONING_EFFORTS,
|
|
5543
5553
|
MISTRAL_REASONING_EFFORTS,
|
|
5544
5554
|
MODEL_PRICING,
|
|
5545
5555
|
MetaAgent,
|
|
@@ -5646,6 +5656,7 @@ export {
|
|
|
5646
5656
|
toGlmEffort,
|
|
5647
5657
|
toKimiEffort,
|
|
5648
5658
|
toMetaEffort,
|
|
5659
|
+
toMiniMaxEffort,
|
|
5649
5660
|
toMistralEffort,
|
|
5650
5661
|
toOpenAIEffort,
|
|
5651
5662
|
toXaiEffort,
|