@hiper2d/ai-agents 0.19.0 → 0.19.1
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 +5 -7
- package/dist/index.d.ts +5 -7
- package/dist/index.js +33 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -806,16 +806,12 @@ var LLM_CONSTANTS = {
|
|
|
806
806
|
GEMINI_PRO: "gemini-pro",
|
|
807
807
|
GEMINI_FLASH: "gemini-flash",
|
|
808
808
|
GEMINI_LITE: "gemini-lite",
|
|
809
|
-
// Reused 2026-10-06 for Mistral Large 4: the old id (Large 3) was retired 2026-09-18 and
|
|
810
|
-
// consumers had mapped it away, so the version-free id was free again.
|
|
811
|
-
MISTRAL_LARGE: "mistral-large",
|
|
812
809
|
MISTRAL_MEDIUM: "mistral-medium",
|
|
813
810
|
MISTRAL_SMALL: "mistral-small",
|
|
814
811
|
GROK: "grok",
|
|
815
812
|
KIMI: "kimi",
|
|
816
813
|
GLM: "glm",
|
|
817
814
|
GLM_FLASH: "glm-flash",
|
|
818
|
-
FUGU_ULTRA: "fugu-ultra",
|
|
819
815
|
FUGU_MAX: "fugu-max",
|
|
820
816
|
// Qwen (QwenCloud/DashScope). Stable picker ids without the version, matching the gpt/gemini
|
|
821
817
|
// pattern, so future repoints don't orphan persisted ids.
|
|
@@ -988,16 +984,20 @@ var SupportedAiModels = {
|
|
|
988
984
|
},
|
|
989
985
|
// Always-on reasoning — no non-thinking sibling. Bumped 4.6 → 4.7 on 2026-09-22 (id verified
|
|
990
986
|
// against GET /v1/models). Same price, same 200K extended-context boundary; the context
|
|
991
|
-
// window is 500K.
|
|
992
|
-
//
|
|
993
|
-
//
|
|
994
|
-
//
|
|
987
|
+
// window is 500K. 4.7 accepts `reasoning: {effort}` (low | medium | high | xhigh, default
|
|
988
|
+
// high) where 4.6 had no knob at all; GrokAgent sends the pin below.
|
|
989
|
+
//
|
|
990
|
+
// Pinned medium 2026-10-06. At high, production day summaries ran ~2 min and the werewolf
|
|
991
|
+
// day-2 fixture measured votes 27-55s and summaries 44-55s (1.5-3k output tokens) — too
|
|
992
|
+
// close to the 60s per-call timeout. At medium the same prompts took votes 5-8s and
|
|
993
|
+
// summaries 23-25s (3-5x fewer output tokens) with the same vote target and summaries just
|
|
994
|
+
// as specific.
|
|
995
995
|
[LLM_CONSTANTS.GROK]: {
|
|
996
996
|
displayName: "Grok 4.7",
|
|
997
997
|
modelApiName: "grok-4.7",
|
|
998
998
|
apiKeyName: API_KEY_CONSTANTS.GROK,
|
|
999
999
|
hasThinking: true,
|
|
1000
|
-
reasoningEffort: "
|
|
1000
|
+
reasoningEffort: "medium",
|
|
1001
1001
|
temperature: 0.7
|
|
1002
1002
|
},
|
|
1003
1003
|
// Mistral models. Two hybrid entries since 2026-09-18: reasoning is off by default on the
|
|
@@ -1017,20 +1017,12 @@ var SupportedAiModels = {
|
|
|
1017
1017
|
// `magistral-medium-latest` as one entry — so Magistral seats had silently become Medium
|
|
1018
1018
|
// seats already. Consumers map both retired ids onto the surviving pair.
|
|
1019
1019
|
//
|
|
1020
|
-
// Mistral Large 4
|
|
1021
|
-
//
|
|
1022
|
-
//
|
|
1023
|
-
// a
|
|
1024
|
-
//
|
|
1025
|
-
|
|
1026
|
-
displayName: "Mistral Large 4",
|
|
1027
|
-
// `mistral-large-4-0` is the same entry; `mistral-large-latest` still points at Large 3.
|
|
1028
|
-
modelApiName: "mistral-large-4",
|
|
1029
|
-
apiKeyName: API_KEY_CONSTANTS.MISTRAL,
|
|
1030
|
-
hasThinking: true,
|
|
1031
|
-
reasoningEffort: "high",
|
|
1032
|
-
tags: ["slow", "cheap"]
|
|
1033
|
-
},
|
|
1020
|
+
// Mistral Large 4 (`mistral-large-4`, $0.68/$2.09, $0.07 cached) was added in 0.19.0 and
|
|
1021
|
+
// removed in 0.19.1 (2026-10-06/07): too slow to play. Like Small/Medium it accepts only
|
|
1022
|
+
// reasoning_effort high|none, and unlike them it reasons when the field is omitted. At high
|
|
1023
|
+
// a realistic day-2 vote took 25-154s (half past the 60s timeout) and its parallel story
|
|
1024
|
+
// batches finished ~100s apart (Mistral served them one at a time: ~6 min per story). Off,
|
|
1025
|
+
// it answers in ~1s with no trace. Re-test before re-adding.
|
|
1034
1026
|
[LLM_CONSTANTS.MISTRAL_MEDIUM]: {
|
|
1035
1027
|
displayName: "Mistral Medium 3.5",
|
|
1036
1028
|
// The docs' explicit 3.5 id. It was `mistral-medium-3` until 2026-09-18, which Mistral
|
|
@@ -1115,9 +1107,9 @@ var SupportedAiModels = {
|
|
|
1115
1107
|
// real against $0.85 tracked, a 5.7x undercharge. It is a router with no published price,
|
|
1116
1108
|
// so the rate is not even guaranteed stable, and its cache hit rate was 9.3% — effectively
|
|
1117
1109
|
// zero, since every hit came from a duplicate call seconds apart rather than turn-to-turn
|
|
1118
|
-
// prefix reuse.
|
|
1110
|
+
// prefix reuse.
|
|
1119
1111
|
//
|
|
1120
|
-
// reasoningEffort
|
|
1112
|
+
// reasoningEffort was PINNED on both entries because the server default differs per model:
|
|
1121
1113
|
// fugu-ultra defaults to `xhigh` (console.sakana.ai/models), fugu-max to `high`. Until
|
|
1122
1114
|
// 2026-09-20 the agent sent no effort at all, so every Ultra turn ran at xhigh. Measured that
|
|
1123
1115
|
// day on a 2k-token three-day game prompt (two samples each, chat completions, json mode):
|
|
@@ -1127,17 +1119,17 @@ var SupportedAiModels = {
|
|
|
1127
1119
|
// max xhigh 41s / 47s $0.02
|
|
1128
1120
|
// `max_tokens` is not a latency lever for Ultra: Sakana applies it to the final response only,
|
|
1129
1121
|
// the orchestrator "still uses maximum token limit". Effort is the only knob.
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
},
|
|
1122
|
+
//
|
|
1123
|
+
// Fugu Ultra (`fugu-ultra`, $5/$30, $0.50 cached; ×~2 above 272K) was REMOVED in 0.19.1
|
|
1124
|
+
// (2026-10-07): too slow and too expensive for what it played. At `high` a day-2 vote took
|
|
1125
|
+
// 39s and a turn 65-78s (past the 60s request timeout), and as Game Master its four parallel
|
|
1126
|
+
// story batches ran past 240s each. It also billed "orchestration" tokens (its internal expert
|
|
1127
|
+
// calls) on top of the visible counts; FuguAgent still folds those in, in case Max ever
|
|
1128
|
+
// reports them. Consumers map the id to Max.
|
|
1138
1129
|
// Fugu Max (2026-09-20, fugu-max → fugu-max-v1.0): Sakana's "largest pool of models on the
|
|
1139
|
-
// cost–performance Pareto frontier" —
|
|
1140
|
-
//
|
|
1130
|
+
// cost–performance Pareto frontier" — 5x less than Ultra's output rate and a fraction of its
|
|
1131
|
+
// latency; the only Fugu since 0.19.1. Live 2026-10-06: day-2 vote 11s, 15-character story
|
|
1132
|
+
// pipeline 100s. It reasons (reasoning_tokens 80-500 a turn) but, like
|
|
1141
1133
|
// Ultra, never returns reasoning_content, hence hasThinking: false. No orchestration
|
|
1142
1134
|
// tokens observed on any call.
|
|
1143
1135
|
[LLM_CONSTANTS.FUGU_MAX]: {
|
|
@@ -1420,13 +1412,7 @@ var MODEL_PRICING = {
|
|
|
1420
1412
|
// Mistral models (mistral.ai/pricing/api, verified 2026-09-18). Cached tokens bill at 10% of
|
|
1421
1413
|
// the input price (documented on the prompt_cache_key param; no per-model cached prices
|
|
1422
1414
|
// published). Reasoning tokens are counted inside completion_tokens — no separate
|
|
1423
|
-
// reasoning_tokens field — so the output rate already covers the trace.
|
|
1424
|
-
// 2026-10-06 at its published rates ($0.07 cached, not an exact 10%).
|
|
1425
|
-
[SupportedAiModels[LLM_CONSTANTS.MISTRAL_LARGE].modelApiName]: {
|
|
1426
|
-
inputPrice: 0.68,
|
|
1427
|
-
outputPrice: 2.09,
|
|
1428
|
-
cacheHitPrice: 0.07
|
|
1429
|
-
},
|
|
1415
|
+
// reasoning_tokens field — so the output rate already covers the trace.
|
|
1430
1416
|
[SupportedAiModels[LLM_CONSTANTS.MISTRAL_MEDIUM].modelApiName]: {
|
|
1431
1417
|
inputPrice: 1.5,
|
|
1432
1418
|
outputPrice: 7.5,
|
|
@@ -1450,21 +1436,10 @@ var MODEL_PRICING = {
|
|
|
1450
1436
|
extendedContextCacheHitPrice: 1,
|
|
1451
1437
|
extendedContextThresholdTokens: 2e5
|
|
1452
1438
|
},
|
|
1453
|
-
// Sakana Fugu
|
|
1454
|
-
//
|
|
1455
|
-
//
|
|
1456
|
-
//
|
|
1457
|
-
// completion_tokens_details, billed at these same input/output rates — FuguAgent folds them
|
|
1458
|
-
// into the token counts before pricing.
|
|
1459
|
-
[SupportedAiModels[LLM_CONSTANTS.FUGU_ULTRA].modelApiName]: {
|
|
1460
|
-
inputPrice: 5,
|
|
1461
|
-
outputPrice: 30,
|
|
1462
|
-
cacheHitPrice: 0.5,
|
|
1463
|
-
extendedContextInputPrice: 10,
|
|
1464
|
-
extendedContextOutputPrice: 45,
|
|
1465
|
-
extendedContextCacheHitPrice: 1,
|
|
1466
|
-
extendedContextThresholdTokens: 272e3
|
|
1467
|
-
},
|
|
1439
|
+
// Sakana Fugu (console.sakana.ai/pricing, read 2026-09-20). Base `fugu` (retired 2026-08-04)
|
|
1440
|
+
// and `fugu-ultra` (removed 0.19.1) have no entries. Any "orchestration" tokens reported in
|
|
1441
|
+
// prompt_tokens_details / completion_tokens_details bill at these same rates — FuguAgent
|
|
1442
|
+
// folds them into the token counts before pricing.
|
|
1468
1443
|
// fugu-max: flat rates, no context tiers.
|
|
1469
1444
|
[SupportedAiModels[LLM_CONSTANTS.FUGU_MAX].modelApiName]: {
|
|
1470
1445
|
inputPrice: 2,
|
|
@@ -1524,7 +1499,6 @@ var HYBRID_THINKING_API_NAMES = /* @__PURE__ */ new Set([
|
|
|
1524
1499
|
SupportedAiModels[LLM_CONSTANTS.MINIMAX].modelApiName,
|
|
1525
1500
|
// Mistral reasons only when asked (`reasoning_effort`), and we always ask — hybrid by the
|
|
1526
1501
|
// same definition as Qwen. Added 2026-09-18 when the two entries went thinking-on.
|
|
1527
|
-
SupportedAiModels[LLM_CONSTANTS.MISTRAL_LARGE].modelApiName,
|
|
1528
1502
|
SupportedAiModels[LLM_CONSTANTS.MISTRAL_MEDIUM].modelApiName,
|
|
1529
1503
|
SupportedAiModels[LLM_CONSTANTS.MISTRAL_SMALL].modelApiName
|
|
1530
1504
|
]);
|
|
@@ -1593,7 +1567,7 @@ var GLM_REASONING_EFFORTS = ["low", "high", "max"];
|
|
|
1593
1567
|
var DEEPSEEK_REASONING_EFFORTS = ["low", "high", "max"];
|
|
1594
1568
|
var FUGU_REASONING_EFFORTS = ["high", "xhigh", "max"];
|
|
1595
1569
|
var META_REASONING_EFFORTS = ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
1596
|
-
var MISTRAL_REASONING_EFFORTS = ["
|
|
1570
|
+
var MISTRAL_REASONING_EFFORTS = ["high"];
|
|
1597
1571
|
var XAI_REASONING_EFFORTS = ["low", "medium", "high", "xhigh"];
|
|
1598
1572
|
var KIMI_REASONING_EFFORTS = ["low", "high", "max"];
|
|
1599
1573
|
function clampReasoningEffort(effort, allowed) {
|
|
@@ -5346,7 +5320,6 @@ var AgentFactory = class {
|
|
|
5346
5320
|
case LLM_CONSTANTS.DEEPSEEK_PRO:
|
|
5347
5321
|
return new DeepSeekV2Agent(name, instruction, model.modelApiName, key, model.temperature ?? 0, shouldEnableThinking);
|
|
5348
5322
|
// Mistral models
|
|
5349
|
-
case LLM_CONSTANTS.MISTRAL_LARGE:
|
|
5350
5323
|
case LLM_CONSTANTS.MISTRAL_MEDIUM:
|
|
5351
5324
|
case LLM_CONSTANTS.MISTRAL_SMALL:
|
|
5352
5325
|
return new MistralAgent(name, instruction, model.modelApiName, key, shouldEnableThinking);
|
|
@@ -5357,7 +5330,6 @@ var AgentFactory = class {
|
|
|
5357
5330
|
case LLM_CONSTANTS.GLM_FLASH:
|
|
5358
5331
|
return new GlmAgent(name, instruction, model.modelApiName, key, model.temperature, shouldEnableThinking);
|
|
5359
5332
|
// Sakana Fugu models — always-on reasoning, no temperature (ignored by the model)
|
|
5360
|
-
case LLM_CONSTANTS.FUGU_ULTRA:
|
|
5361
5333
|
case LLM_CONSTANTS.FUGU_MAX:
|
|
5362
5334
|
return new FuguAgent(name, instruction, model.modelApiName, key, shouldEnableThinking);
|
|
5363
5335
|
// Qwen models — thinking-only (enable_thinking always sent)
|