@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.d.mts
CHANGED
|
@@ -390,6 +390,7 @@ declare const LLM_CONSTANTS: {
|
|
|
390
390
|
MISTRAL_SMALL: string;
|
|
391
391
|
GROK: string;
|
|
392
392
|
KIMI: string;
|
|
393
|
+
KIMI_HIGHSPEED: string;
|
|
393
394
|
GLM: string;
|
|
394
395
|
GLM_FLASH: string;
|
|
395
396
|
FUGU_MAX: string;
|
|
@@ -1479,7 +1480,7 @@ declare class Gpt5Agent extends AbstractAgent {
|
|
|
1479
1480
|
* nowhere to put reasoning items. The system prompt still travels ONLY as `instructions`.
|
|
1480
1481
|
*
|
|
1481
1482
|
* Reasoning is readable only within one model family and the API silently omits items it
|
|
1482
|
-
* cannot read, so a bot moved between GPT-6 and GPT-5.6
|
|
1483
|
+
* cannot read, so a bot moved between GPT-6 and a GPT-5.6 model loses its reasoning and keeps
|
|
1483
1484
|
* working. A bot moved to another provider never reaches this code at all: every agent
|
|
1484
1485
|
* reads only its own field, and a missing one falls back to a plain message.
|
|
1485
1486
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -390,6 +390,7 @@ declare const LLM_CONSTANTS: {
|
|
|
390
390
|
MISTRAL_SMALL: string;
|
|
391
391
|
GROK: string;
|
|
392
392
|
KIMI: string;
|
|
393
|
+
KIMI_HIGHSPEED: string;
|
|
393
394
|
GLM: string;
|
|
394
395
|
GLM_FLASH: string;
|
|
395
396
|
FUGU_MAX: string;
|
|
@@ -1479,7 +1480,7 @@ declare class Gpt5Agent extends AbstractAgent {
|
|
|
1479
1480
|
* nowhere to put reasoning items. The system prompt still travels ONLY as `instructions`.
|
|
1480
1481
|
*
|
|
1481
1482
|
* Reasoning is readable only within one model family and the API silently omits items it
|
|
1482
|
-
* cannot read, so a bot moved between GPT-6 and GPT-5.6
|
|
1483
|
+
* cannot read, so a bot moved between GPT-6 and a GPT-5.6 model loses its reasoning and keeps
|
|
1483
1484
|
* working. A bot moved to another provider never reaches this code at all: every agent
|
|
1484
1485
|
* reads only its own field, and a missing one falls back to a plain message.
|
|
1485
1486
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1024,6 +1024,9 @@ var LLM_CONSTANTS = {
|
|
|
1024
1024
|
MISTRAL_SMALL: "mistral-small",
|
|
1025
1025
|
GROK: "grok",
|
|
1026
1026
|
KIMI: "kimi",
|
|
1027
|
+
// Kimi K3.1 Pro Highspeed: the same model served 2-3x faster at 2x the price (added
|
|
1028
|
+
// 2026-10-23). Version-free like `kimi`, so a K3.2 repoint keeps both ids.
|
|
1029
|
+
KIMI_HIGHSPEED: "kimi-highspeed",
|
|
1027
1030
|
GLM: "glm",
|
|
1028
1031
|
GLM_FLASH: "glm-flash",
|
|
1029
1032
|
FUGU_MAX: "fugu-max",
|
|
@@ -1145,6 +1148,9 @@ var SupportedAiModels = {
|
|
|
1145
1148
|
// slot largely redundant — retiring it is a product call, not a catalog one.
|
|
1146
1149
|
// Sol → GPT-6.1 Sol on 2026-09-29 (id verified against GET /v1/models; gpt-6-sol is still
|
|
1147
1150
|
// served). Same price as GPT-6 Sol; its no-param default effort still measures `medium`.
|
|
1151
|
+
// Terra → GPT-6.1 Terra on 2026-10-26 (id verified against GET /v1/models; gpt-5.6-terra is
|
|
1152
|
+
// still served). Half the price of 5.6 Terra ($2/$12 → $1/$5) and back in its place below
|
|
1153
|
+
// Sol. Its no-param default effort measures `medium`, like its siblings.
|
|
1148
1154
|
[LLM_CONSTANTS.GPT_SOL]: {
|
|
1149
1155
|
displayName: "GPT-6.1 Sol",
|
|
1150
1156
|
modelApiName: "gpt-6.1-sol",
|
|
@@ -1155,8 +1161,8 @@ var SupportedAiModels = {
|
|
|
1155
1161
|
tags: ["expensive"]
|
|
1156
1162
|
},
|
|
1157
1163
|
[LLM_CONSTANTS.GPT]: {
|
|
1158
|
-
displayName: "GPT-
|
|
1159
|
-
modelApiName: "gpt-
|
|
1164
|
+
displayName: "GPT-6.1 Terra",
|
|
1165
|
+
modelApiName: "gpt-6.1-terra",
|
|
1160
1166
|
apiKeyName: API_KEY_CONSTANTS.OPENAI,
|
|
1161
1167
|
reasoningEffort: "medium",
|
|
1162
1168
|
hasThinking: true,
|
|
@@ -1291,21 +1297,40 @@ var SupportedAiModels = {
|
|
|
1291
1297
|
reasoningEffort: "high",
|
|
1292
1298
|
tags: ["very-fast", "cheap"]
|
|
1293
1299
|
},
|
|
1294
|
-
// Kimi models.
|
|
1295
|
-
// it is the undocumented K2-era `thinking: disabled` toggle, which we no longer rely on.
|
|
1296
|
-
//
|
|
1297
|
-
//
|
|
1300
|
+
// Kimi models. Always-reasoning entries: K3-series models reason by default and the only way
|
|
1301
|
+
// to stop it is the undocumented K2-era `thinking: disabled` toggle, which we no longer rely on.
|
|
1302
|
+
// ~85-90% of output tokens are reasoning tokens billed at the output rate, so real
|
|
1303
|
+
// per-request cost runs well above the sticker output price.
|
|
1304
|
+
//
|
|
1305
|
+
// `kimi` repointed 2026-10-23 from kimi-k3 ($3/$15, 17-29s per turn, 146s for the
|
|
1306
|
+
// 15-character story pipeline) to Kimi K3.1 Pro ($2/$10, 1M context, same low|high|max
|
|
1307
|
+
// effort levels, default max). Live at high effort 2026-10-23: 3-sentence schema ask
|
|
1308
|
+
// 4.2-4.5s, 8-character scene (476-845 output tokens) 9.7-14.9s = 49-57 tok/s — the same
|
|
1309
|
+
// output speed as K3, so a full bot turn still lands in the 15-25s `slow` band.
|
|
1310
|
+
// Consumer policy (werewolf): 1 bot per free game (opt-in) until 100 turns are measured.
|
|
1298
1311
|
[LLM_CONSTANTS.KIMI]: {
|
|
1299
|
-
displayName: "Kimi K3",
|
|
1300
|
-
modelApiName: "kimi-k3",
|
|
1312
|
+
displayName: "Kimi K3.1 Pro",
|
|
1313
|
+
modelApiName: "kimi-k3.1-pro",
|
|
1301
1314
|
apiKeyName: API_KEY_CONSTANTS.MOONSHOT,
|
|
1302
1315
|
hasThinking: true,
|
|
1303
|
-
// Temperature is omitted from the request:
|
|
1304
|
-
// Speed samples: 17s (2026-08-04) and 28.9s (2026-08-05) — graded into the >25s tier.
|
|
1316
|
+
// Temperature is omitted from the request: K3 rejected any value other than 1.
|
|
1305
1317
|
// Pinned 'high' 2026-09-22, down from Moonshot's 'max' default: K3 had no levels at
|
|
1306
1318
|
// launch and the agent hardcoded max, so this is the first time the knob exists.
|
|
1307
1319
|
reasoningEffort: "high",
|
|
1308
|
-
tags: ["
|
|
1320
|
+
tags: ["slow", "expensive"]
|
|
1321
|
+
},
|
|
1322
|
+
// Same model, Moonshot's high-speed serving tier ("roughly two to three times faster",
|
|
1323
|
+
// platform.kimi.ai K3.1 Pro quickstart, read 2026-10-23) at 2x the price ($4/$20 — Opus 5.5
|
|
1324
|
+
// money). Live the same day: schema ask 1.9-2.4s, 8-character scene (789-982 output tokens)
|
|
1325
|
+
// 7.9-8.4s = 100-117 tok/s, twice Pro. No speed tag: that is the unlabeled 6-13s middle.
|
|
1326
|
+
// Consumer policy (werewolf): paid tier only, deliberately — the estimate is 5.2¢ a turn.
|
|
1327
|
+
[LLM_CONSTANTS.KIMI_HIGHSPEED]: {
|
|
1328
|
+
displayName: "Kimi K3.1 Pro Highspeed",
|
|
1329
|
+
modelApiName: "kimi-k3.1-pro-highspeed",
|
|
1330
|
+
apiKeyName: API_KEY_CONSTANTS.MOONSHOT,
|
|
1331
|
+
hasThinking: true,
|
|
1332
|
+
reasoningEffort: "high",
|
|
1333
|
+
tags: ["expensive"]
|
|
1309
1334
|
},
|
|
1310
1335
|
// Z.AI models — thinking-only entry (non-thinking variant retired 2026-08-05)
|
|
1311
1336
|
// reasoningEffort MUST be set: GLM-5.3 forces reasoning on and defaults the effort to 'max',
|
|
@@ -1542,30 +1567,37 @@ var MODEL_PRICING = {
|
|
|
1542
1567
|
extendedContextCacheHitPrice: 2,
|
|
1543
1568
|
extendedContextThresholdTokens: 272e3
|
|
1544
1569
|
},
|
|
1545
|
-
// OpenAI GPT-6 Sol and GPT-6 Luna (developers.openai.com/api/docs/pricing, read 2026-09-22)
|
|
1546
|
-
// plus GPT-5.6 Terra, which has no GPT-6 successor and keeps its old rates.
|
|
1570
|
+
// OpenAI GPT-6 Sol and GPT-6 Luna (developers.openai.com/api/docs/pricing, read 2026-09-22).
|
|
1547
1571
|
// Sol: $2/$10 short, $4/$15 long, cache hits $0.20/$0.40 — half what GPT-5.6 Sol cost.
|
|
1548
1572
|
// Luna: $0.10/$0.50 short, $0.20/$0.75 long, cache hits $0.01/$0.02 — also halved.
|
|
1549
1573
|
// As with Astra, OpenAI's table doesn't restate the short/long boundary, so we keep the
|
|
1550
1574
|
// 272k threshold the 5.6 siblings use. Cache WRITES (Sol $2.50/$5, Luna $0.125/$0.25) are
|
|
1551
1575
|
// not modelled: OpenAI caching is automatic and the API only reports hits.
|
|
1552
1576
|
// GPT-6.1 Sol (2026-09-29) kept GPT-6 Sol's rates exactly, cache writes included.
|
|
1577
|
+
// Re-read 2026-10-26 with the Terra launch: the page now lists Sol's cache hit at $0.10
|
|
1578
|
+
// (5% of input, the same share as Terra), not the $0.20 recorded on 2026-09-22; Astra and
|
|
1579
|
+
// Luna still show 10%. Followed the page.
|
|
1553
1580
|
[SupportedAiModels[LLM_CONSTANTS.GPT_SOL].modelApiName]: {
|
|
1554
1581
|
inputPrice: 2,
|
|
1555
1582
|
outputPrice: 10,
|
|
1556
|
-
cacheHitPrice: 0.
|
|
1583
|
+
cacheHitPrice: 0.1,
|
|
1557
1584
|
extendedContextInputPrice: 4,
|
|
1558
1585
|
extendedContextOutputPrice: 15,
|
|
1559
|
-
extendedContextCacheHitPrice: 0.
|
|
1586
|
+
extendedContextCacheHitPrice: 0.2,
|
|
1560
1587
|
extendedContextThresholdTokens: 272e3
|
|
1561
1588
|
},
|
|
1589
|
+
// GPT-6.1 Terra (developers.openai.com/api/docs/pricing, read 2026-10-26): $1/$5 short,
|
|
1590
|
+
// cache hits $0.05 (5% of input, like 6.1 Sol), 30m/12h cache writes $1.25/$2.50 — not
|
|
1591
|
+
// modelled, see above. The page's "Long" tab is rendered client-side and embeds no 6.x
|
|
1592
|
+
// rows, so the long-context rates follow the family rule every other entry here uses
|
|
1593
|
+
// (2x input, 1.5x output, 2x cache hit) over the same 272k threshold.
|
|
1562
1594
|
[SupportedAiModels[LLM_CONSTANTS.GPT].modelApiName]: {
|
|
1563
|
-
inputPrice:
|
|
1564
|
-
outputPrice:
|
|
1565
|
-
cacheHitPrice: 0.
|
|
1566
|
-
extendedContextInputPrice:
|
|
1567
|
-
extendedContextOutputPrice:
|
|
1568
|
-
extendedContextCacheHitPrice: 0.
|
|
1595
|
+
inputPrice: 1,
|
|
1596
|
+
outputPrice: 5,
|
|
1597
|
+
cacheHitPrice: 0.05,
|
|
1598
|
+
extendedContextInputPrice: 2,
|
|
1599
|
+
extendedContextOutputPrice: 7.5,
|
|
1600
|
+
extendedContextCacheHitPrice: 0.1,
|
|
1569
1601
|
extendedContextThresholdTokens: 272e3
|
|
1570
1602
|
},
|
|
1571
1603
|
[SupportedAiModels[LLM_CONSTANTS.GPT_MINI].modelApiName]: {
|
|
@@ -1597,11 +1629,18 @@ var MODEL_PRICING = {
|
|
|
1597
1629
|
cacheHitPrice: 0.022,
|
|
1598
1630
|
peakPricing: DEEPSEEK_PEAK_SCHEDULE
|
|
1599
1631
|
},
|
|
1600
|
-
// Kimi/Moonshot models
|
|
1632
|
+
// Kimi/Moonshot models (platform.kimi.ai/docs/pricing/chat, 2026-10-23). Cache writes
|
|
1633
|
+
// ($2/$4 per M for 5m/1h on Pro, $4/$8 on Highspeed) are not modelled: Moonshot caches
|
|
1634
|
+
// automatically and only reports hits.
|
|
1601
1635
|
[SupportedAiModels[LLM_CONSTANTS.KIMI].modelApiName]: {
|
|
1602
|
-
inputPrice:
|
|
1603
|
-
outputPrice:
|
|
1604
|
-
cacheHitPrice: 0.
|
|
1636
|
+
inputPrice: 2,
|
|
1637
|
+
outputPrice: 10,
|
|
1638
|
+
cacheHitPrice: 0.2
|
|
1639
|
+
},
|
|
1640
|
+
[SupportedAiModels[LLM_CONSTANTS.KIMI_HIGHSPEED].modelApiName]: {
|
|
1641
|
+
inputPrice: 4,
|
|
1642
|
+
outputPrice: 20,
|
|
1643
|
+
cacheHitPrice: 0.2
|
|
1605
1644
|
},
|
|
1606
1645
|
// Z.AI models
|
|
1607
1646
|
[SupportedAiModels[LLM_CONSTANTS.GLM].modelApiName]: {
|
|
@@ -2717,7 +2756,7 @@ ${instruction}`);
|
|
|
2717
2756
|
* nowhere to put reasoning items. The system prompt still travels ONLY as `instructions`.
|
|
2718
2757
|
*
|
|
2719
2758
|
* Reasoning is readable only within one model family and the API silently omits items it
|
|
2720
|
-
* cannot read, so a bot moved between GPT-6 and GPT-5.6
|
|
2759
|
+
* cannot read, so a bot moved between GPT-6 and a GPT-5.6 model loses its reasoning and keeps
|
|
2721
2760
|
* working. A bot moved to another provider never reaches this code at all: every agent
|
|
2722
2761
|
* reads only its own field, and a missing one falls back to a plain message.
|
|
2723
2762
|
*/
|
|
@@ -5615,6 +5654,7 @@ var AgentFactory = class {
|
|
|
5615
5654
|
case LLM_CONSTANTS.MISTRAL_SMALL:
|
|
5616
5655
|
return new MistralAgent(name, instruction, model.modelApiName, key, shouldEnableThinking);
|
|
5617
5656
|
case LLM_CONSTANTS.KIMI:
|
|
5657
|
+
case LLM_CONSTANTS.KIMI_HIGHSPEED:
|
|
5618
5658
|
return new KimiAgent(name, instruction, model.modelApiName, key, 0, shouldEnableThinking);
|
|
5619
5659
|
// Z.AI models — thinking-only since 2026-08-05
|
|
5620
5660
|
case LLM_CONSTANTS.GLM:
|