@hiper2d/ai-agents 0.26.3 → 0.28.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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +66 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -846,6 +846,9 @@ var LLM_CONSTANTS = {
|
|
|
846
846
|
MISTRAL_SMALL: "mistral-small",
|
|
847
847
|
GROK: "grok",
|
|
848
848
|
KIMI: "kimi",
|
|
849
|
+
// Kimi K3.1 Pro Highspeed: the same model served 2-3x faster at 2x the price (added
|
|
850
|
+
// 2026-10-23). Version-free like `kimi`, so a K3.2 repoint keeps both ids.
|
|
851
|
+
KIMI_HIGHSPEED: "kimi-highspeed",
|
|
849
852
|
GLM: "glm",
|
|
850
853
|
GLM_FLASH: "glm-flash",
|
|
851
854
|
FUGU_MAX: "fugu-max",
|
|
@@ -967,6 +970,9 @@ var SupportedAiModels = {
|
|
|
967
970
|
// slot largely redundant — retiring it is a product call, not a catalog one.
|
|
968
971
|
// Sol → GPT-6.1 Sol on 2026-09-29 (id verified against GET /v1/models; gpt-6-sol is still
|
|
969
972
|
// served). Same price as GPT-6 Sol; its no-param default effort still measures `medium`.
|
|
973
|
+
// Terra → GPT-6.1 Terra on 2026-10-26 (id verified against GET /v1/models; gpt-5.6-terra is
|
|
974
|
+
// still served). Half the price of 5.6 Terra ($2/$12 → $1/$5) and back in its place below
|
|
975
|
+
// Sol. Its no-param default effort measures `medium`, like its siblings.
|
|
970
976
|
[LLM_CONSTANTS.GPT_SOL]: {
|
|
971
977
|
displayName: "GPT-6.1 Sol",
|
|
972
978
|
modelApiName: "gpt-6.1-sol",
|
|
@@ -977,8 +983,8 @@ var SupportedAiModels = {
|
|
|
977
983
|
tags: ["expensive"]
|
|
978
984
|
},
|
|
979
985
|
[LLM_CONSTANTS.GPT]: {
|
|
980
|
-
displayName: "GPT-
|
|
981
|
-
modelApiName: "gpt-
|
|
986
|
+
displayName: "GPT-6.1 Terra",
|
|
987
|
+
modelApiName: "gpt-6.1-terra",
|
|
982
988
|
apiKeyName: API_KEY_CONSTANTS.OPENAI,
|
|
983
989
|
reasoningEffort: "medium",
|
|
984
990
|
hasThinking: true,
|
|
@@ -1113,21 +1119,40 @@ var SupportedAiModels = {
|
|
|
1113
1119
|
reasoningEffort: "high",
|
|
1114
1120
|
tags: ["very-fast", "cheap"]
|
|
1115
1121
|
},
|
|
1116
|
-
// Kimi models.
|
|
1117
|
-
// it is the undocumented K2-era `thinking: disabled` toggle, which we no longer rely on.
|
|
1118
|
-
//
|
|
1119
|
-
//
|
|
1122
|
+
// Kimi models. Always-reasoning entries: K3-series models reason by default and the only way
|
|
1123
|
+
// to stop it is the undocumented K2-era `thinking: disabled` toggle, which we no longer rely on.
|
|
1124
|
+
// ~85-90% of output tokens are reasoning tokens billed at the output rate, so real
|
|
1125
|
+
// per-request cost runs well above the sticker output price.
|
|
1126
|
+
//
|
|
1127
|
+
// `kimi` repointed 2026-10-23 from kimi-k3 ($3/$15, 17-29s per turn, 146s for the
|
|
1128
|
+
// 15-character story pipeline) to Kimi K3.1 Pro ($2/$10, 1M context, same low|high|max
|
|
1129
|
+
// effort levels, default max). Live at high effort 2026-10-23: 3-sentence schema ask
|
|
1130
|
+
// 4.2-4.5s, 8-character scene (476-845 output tokens) 9.7-14.9s = 49-57 tok/s — the same
|
|
1131
|
+
// output speed as K3, so a full bot turn still lands in the 15-25s `slow` band.
|
|
1132
|
+
// Consumer policy (werewolf): 1 bot per free game (opt-in) until 100 turns are measured.
|
|
1120
1133
|
[LLM_CONSTANTS.KIMI]: {
|
|
1121
|
-
displayName: "Kimi K3",
|
|
1122
|
-
modelApiName: "kimi-k3",
|
|
1134
|
+
displayName: "Kimi K3.1 Pro",
|
|
1135
|
+
modelApiName: "kimi-k3.1-pro",
|
|
1123
1136
|
apiKeyName: API_KEY_CONSTANTS.MOONSHOT,
|
|
1124
1137
|
hasThinking: true,
|
|
1125
|
-
// Temperature is omitted from the request:
|
|
1126
|
-
// Speed samples: 17s (2026-08-04) and 28.9s (2026-08-05) — graded into the >25s tier.
|
|
1138
|
+
// Temperature is omitted from the request: K3 rejected any value other than 1.
|
|
1127
1139
|
// Pinned 'high' 2026-09-22, down from Moonshot's 'max' default: K3 had no levels at
|
|
1128
1140
|
// launch and the agent hardcoded max, so this is the first time the knob exists.
|
|
1129
1141
|
reasoningEffort: "high",
|
|
1130
|
-
tags: ["
|
|
1142
|
+
tags: ["slow", "expensive"]
|
|
1143
|
+
},
|
|
1144
|
+
// Same model, Moonshot's high-speed serving tier ("roughly two to three times faster",
|
|
1145
|
+
// platform.kimi.ai K3.1 Pro quickstart, read 2026-10-23) at 2x the price ($4/$20 — Opus 5.5
|
|
1146
|
+
// money). Live the same day: schema ask 1.9-2.4s, 8-character scene (789-982 output tokens)
|
|
1147
|
+
// 7.9-8.4s = 100-117 tok/s, twice Pro. No speed tag: that is the unlabeled 6-13s middle.
|
|
1148
|
+
// Consumer policy (werewolf): paid tier only, deliberately — the estimate is 5.2¢ a turn.
|
|
1149
|
+
[LLM_CONSTANTS.KIMI_HIGHSPEED]: {
|
|
1150
|
+
displayName: "Kimi K3.1 Pro Highspeed",
|
|
1151
|
+
modelApiName: "kimi-k3.1-pro-highspeed",
|
|
1152
|
+
apiKeyName: API_KEY_CONSTANTS.MOONSHOT,
|
|
1153
|
+
hasThinking: true,
|
|
1154
|
+
reasoningEffort: "high",
|
|
1155
|
+
tags: ["expensive"]
|
|
1131
1156
|
},
|
|
1132
1157
|
// Z.AI models — thinking-only entry (non-thinking variant retired 2026-08-05)
|
|
1133
1158
|
// reasoningEffort MUST be set: GLM-5.3 forces reasoning on and defaults the effort to 'max',
|
|
@@ -1364,30 +1389,37 @@ var MODEL_PRICING = {
|
|
|
1364
1389
|
extendedContextCacheHitPrice: 2,
|
|
1365
1390
|
extendedContextThresholdTokens: 272e3
|
|
1366
1391
|
},
|
|
1367
|
-
// OpenAI GPT-6 Sol and GPT-6 Luna (developers.openai.com/api/docs/pricing, read 2026-09-22)
|
|
1368
|
-
// plus GPT-5.6 Terra, which has no GPT-6 successor and keeps its old rates.
|
|
1392
|
+
// OpenAI GPT-6 Sol and GPT-6 Luna (developers.openai.com/api/docs/pricing, read 2026-09-22).
|
|
1369
1393
|
// Sol: $2/$10 short, $4/$15 long, cache hits $0.20/$0.40 — half what GPT-5.6 Sol cost.
|
|
1370
1394
|
// Luna: $0.10/$0.50 short, $0.20/$0.75 long, cache hits $0.01/$0.02 — also halved.
|
|
1371
1395
|
// As with Astra, OpenAI's table doesn't restate the short/long boundary, so we keep the
|
|
1372
1396
|
// 272k threshold the 5.6 siblings use. Cache WRITES (Sol $2.50/$5, Luna $0.125/$0.25) are
|
|
1373
1397
|
// not modelled: OpenAI caching is automatic and the API only reports hits.
|
|
1374
1398
|
// GPT-6.1 Sol (2026-09-29) kept GPT-6 Sol's rates exactly, cache writes included.
|
|
1399
|
+
// Re-read 2026-10-26 with the Terra launch: the page now lists Sol's cache hit at $0.10
|
|
1400
|
+
// (5% of input, the same share as Terra), not the $0.20 recorded on 2026-09-22; Astra and
|
|
1401
|
+
// Luna still show 10%. Followed the page.
|
|
1375
1402
|
[SupportedAiModels[LLM_CONSTANTS.GPT_SOL].modelApiName]: {
|
|
1376
1403
|
inputPrice: 2,
|
|
1377
1404
|
outputPrice: 10,
|
|
1378
|
-
cacheHitPrice: 0.
|
|
1405
|
+
cacheHitPrice: 0.1,
|
|
1379
1406
|
extendedContextInputPrice: 4,
|
|
1380
1407
|
extendedContextOutputPrice: 15,
|
|
1381
|
-
extendedContextCacheHitPrice: 0.
|
|
1408
|
+
extendedContextCacheHitPrice: 0.2,
|
|
1382
1409
|
extendedContextThresholdTokens: 272e3
|
|
1383
1410
|
},
|
|
1411
|
+
// GPT-6.1 Terra (developers.openai.com/api/docs/pricing, read 2026-10-26): $1/$5 short,
|
|
1412
|
+
// cache hits $0.05 (5% of input, like 6.1 Sol), 30m/12h cache writes $1.25/$2.50 — not
|
|
1413
|
+
// modelled, see above. The page's "Long" tab is rendered client-side and embeds no 6.x
|
|
1414
|
+
// rows, so the long-context rates follow the family rule every other entry here uses
|
|
1415
|
+
// (2x input, 1.5x output, 2x cache hit) over the same 272k threshold.
|
|
1384
1416
|
[SupportedAiModels[LLM_CONSTANTS.GPT].modelApiName]: {
|
|
1385
|
-
inputPrice:
|
|
1386
|
-
outputPrice:
|
|
1387
|
-
cacheHitPrice: 0.
|
|
1388
|
-
extendedContextInputPrice:
|
|
1389
|
-
extendedContextOutputPrice:
|
|
1390
|
-
extendedContextCacheHitPrice: 0.
|
|
1417
|
+
inputPrice: 1,
|
|
1418
|
+
outputPrice: 5,
|
|
1419
|
+
cacheHitPrice: 0.05,
|
|
1420
|
+
extendedContextInputPrice: 2,
|
|
1421
|
+
extendedContextOutputPrice: 7.5,
|
|
1422
|
+
extendedContextCacheHitPrice: 0.1,
|
|
1391
1423
|
extendedContextThresholdTokens: 272e3
|
|
1392
1424
|
},
|
|
1393
1425
|
[SupportedAiModels[LLM_CONSTANTS.GPT_MINI].modelApiName]: {
|
|
@@ -1419,11 +1451,18 @@ var MODEL_PRICING = {
|
|
|
1419
1451
|
cacheHitPrice: 0.022,
|
|
1420
1452
|
peakPricing: DEEPSEEK_PEAK_SCHEDULE
|
|
1421
1453
|
},
|
|
1422
|
-
// Kimi/Moonshot models
|
|
1454
|
+
// Kimi/Moonshot models (platform.kimi.ai/docs/pricing/chat, 2026-10-23). Cache writes
|
|
1455
|
+
// ($2/$4 per M for 5m/1h on Pro, $4/$8 on Highspeed) are not modelled: Moonshot caches
|
|
1456
|
+
// automatically and only reports hits.
|
|
1423
1457
|
[SupportedAiModels[LLM_CONSTANTS.KIMI].modelApiName]: {
|
|
1424
|
-
inputPrice:
|
|
1425
|
-
outputPrice:
|
|
1426
|
-
cacheHitPrice: 0.
|
|
1458
|
+
inputPrice: 2,
|
|
1459
|
+
outputPrice: 10,
|
|
1460
|
+
cacheHitPrice: 0.2
|
|
1461
|
+
},
|
|
1462
|
+
[SupportedAiModels[LLM_CONSTANTS.KIMI_HIGHSPEED].modelApiName]: {
|
|
1463
|
+
inputPrice: 4,
|
|
1464
|
+
outputPrice: 20,
|
|
1465
|
+
cacheHitPrice: 0.2
|
|
1427
1466
|
},
|
|
1428
1467
|
// Z.AI models
|
|
1429
1468
|
[SupportedAiModels[LLM_CONSTANTS.GLM].modelApiName]: {
|
|
@@ -2539,7 +2578,7 @@ ${instruction}`);
|
|
|
2539
2578
|
* nowhere to put reasoning items. The system prompt still travels ONLY as `instructions`.
|
|
2540
2579
|
*
|
|
2541
2580
|
* Reasoning is readable only within one model family and the API silently omits items it
|
|
2542
|
-
* cannot read, so a bot moved between GPT-6 and GPT-5.6
|
|
2581
|
+
* cannot read, so a bot moved between GPT-6 and a GPT-5.6 model loses its reasoning and keeps
|
|
2543
2582
|
* working. A bot moved to another provider never reaches this code at all: every agent
|
|
2544
2583
|
* reads only its own field, and a missing one falls back to a plain message.
|
|
2545
2584
|
*/
|
|
@@ -5437,6 +5476,7 @@ var AgentFactory = class {
|
|
|
5437
5476
|
case LLM_CONSTANTS.MISTRAL_SMALL:
|
|
5438
5477
|
return new MistralAgent(name, instruction, model.modelApiName, key, shouldEnableThinking);
|
|
5439
5478
|
case LLM_CONSTANTS.KIMI:
|
|
5479
|
+
case LLM_CONSTANTS.KIMI_HIGHSPEED:
|
|
5440
5480
|
return new KimiAgent(name, instruction, model.modelApiName, key, 0, shouldEnableThinking);
|
|
5441
5481
|
// Z.AI models — thinking-only since 2026-08-05
|
|
5442
5482
|
case LLM_CONSTANTS.GLM:
|