@hiper2d/ai-agents 0.26.2 → 0.27.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.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",
@@ -937,7 +940,9 @@ var SupportedAiModels = {
937
940
  reasoningEffort: "low",
938
941
  // Reasoning tokens share the output budget, so leave room for both CoT and answer.
939
942
  maxOutputTokens: 65536,
940
- tags: ["cheap"]
943
+ // slow: werewolf prod 2026-10-21, 785 calls over 30 days, p50 10s, p90 31s, max 156s;
944
+ // 7 of 79 bot turns past the 60s timeout in a 16-player game at days 8-9.
945
+ tags: ["slow", "cheap"]
941
946
  },
942
947
  // Models with always-on reasoning
943
948
  // GPT-6 Astra (2026-09-03): OpenAI's frontier tier above Sol. No `none` reasoning effort;
@@ -1017,7 +1022,9 @@ var SupportedAiModels = {
1017
1022
  apiKeyName: API_KEY_CONSTANTS.GOOGLE,
1018
1023
  hasThinking: true,
1019
1024
  reasoningEffort: "medium",
1020
- tags: ["expensive"]
1025
+ // slow: werewolf prod 2026-10-21, 193 calls over 30 days, p50 12s, p90 34s, max 207s;
1026
+ // 3 of 50 night actions past the 60s timeout even at medium effort.
1027
+ tags: ["slow", "expensive"]
1021
1028
  },
1022
1029
  [LLM_CONSTANTS.GEMINI_PRO]: {
1023
1030
  displayName: "Gemini 3.1 Pro Preview",
@@ -1068,7 +1075,10 @@ var SupportedAiModels = {
1068
1075
  apiKeyName: API_KEY_CONSTANTS.GROK,
1069
1076
  hasThinking: true,
1070
1077
  reasoningEffort: "medium",
1071
- temperature: 0.7
1078
+ temperature: 0.7,
1079
+ // very-slow: werewolf prod 2026-10-21, 29 calls over 30 days, p50 48s, p90 192s, max 244s
1080
+ // at medium effort; the 15-character story pipeline took 213s on 2026-10-07.
1081
+ tags: ["very-slow"]
1072
1082
  },
1073
1083
  // Mistral models. One hybrid entry: reasoning is off by default on the API and switched on
1074
1084
  // per request with `reasoning_effort` (see mistral-agent.ts); the trace comes back as a
@@ -1106,21 +1116,40 @@ var SupportedAiModels = {
1106
1116
  reasoningEffort: "high",
1107
1117
  tags: ["very-fast", "cheap"]
1108
1118
  },
1109
- // Kimi models. Single always-reasoning entry: K3 reasons by default and the only way to stop
1110
- // it is the undocumented K2-era `thinking: disabled` toggle, which we no longer rely on.
1111
- // K3 always reasons at max effort; ~85-90% of its output tokens are reasoning tokens billed
1112
- // at the output rate, so real per-request cost runs well above the sticker output price.
1119
+ // Kimi models. Always-reasoning entries: K3-series models reason by default and the only way
1120
+ // to stop it is the undocumented K2-era `thinking: disabled` toggle, which we no longer rely on.
1121
+ // ~85-90% of output tokens are reasoning tokens billed at the output rate, so real
1122
+ // per-request cost runs well above the sticker output price.
1123
+ //
1124
+ // `kimi` repointed 2026-10-23 from kimi-k3 ($3/$15, 17-29s per turn, 146s for the
1125
+ // 15-character story pipeline) to Kimi K3.1 Pro ($2/$10, 1M context, same low|high|max
1126
+ // effort levels, default max). Live at high effort 2026-10-23: 3-sentence schema ask
1127
+ // 4.2-4.5s, 8-character scene (476-845 output tokens) 9.7-14.9s = 49-57 tok/s — the same
1128
+ // output speed as K3, so a full bot turn still lands in the 15-25s `slow` band.
1129
+ // Consumer policy (werewolf): 1 bot per free game (opt-in) until 100 turns are measured.
1113
1130
  [LLM_CONSTANTS.KIMI]: {
1114
- displayName: "Kimi K3",
1115
- modelApiName: "kimi-k3",
1131
+ displayName: "Kimi K3.1 Pro",
1132
+ modelApiName: "kimi-k3.1-pro",
1116
1133
  apiKeyName: API_KEY_CONSTANTS.MOONSHOT,
1117
1134
  hasThinking: true,
1118
- // Temperature is omitted from the request: kimi-k3 rejects any value other than 1.
1119
- // Speed samples: 17s (2026-08-04) and 28.9s (2026-08-05) — graded into the >25s tier.
1135
+ // Temperature is omitted from the request: K3 rejected any value other than 1.
1120
1136
  // Pinned 'high' 2026-09-22, down from Moonshot's 'max' default: K3 had no levels at
1121
1137
  // launch and the agent hardcoded max, so this is the first time the knob exists.
1122
1138
  reasoningEffort: "high",
1123
- tags: ["very-slow", "expensive"]
1139
+ tags: ["slow", "expensive"]
1140
+ },
1141
+ // Same model, Moonshot's high-speed serving tier ("roughly two to three times faster",
1142
+ // platform.kimi.ai K3.1 Pro quickstart, read 2026-10-23) at 2x the price ($4/$20 — Opus 5.5
1143
+ // money). Live the same day: schema ask 1.9-2.4s, 8-character scene (789-982 output tokens)
1144
+ // 7.9-8.4s = 100-117 tok/s, twice Pro. No speed tag: that is the unlabeled 6-13s middle.
1145
+ // Consumer policy (werewolf): paid tier only, deliberately — the estimate is 5.2¢ a turn.
1146
+ [LLM_CONSTANTS.KIMI_HIGHSPEED]: {
1147
+ displayName: "Kimi K3.1 Pro Highspeed",
1148
+ modelApiName: "kimi-k3.1-pro-highspeed",
1149
+ apiKeyName: API_KEY_CONSTANTS.MOONSHOT,
1150
+ hasThinking: true,
1151
+ reasoningEffort: "high",
1152
+ tags: ["expensive"]
1124
1153
  },
1125
1154
  // Z.AI models — thinking-only entry (non-thinking variant retired 2026-08-05)
1126
1155
  // reasoningEffort MUST be set: GLM-5.3 forces reasoning on and defaults the effort to 'max',
@@ -1412,11 +1441,18 @@ var MODEL_PRICING = {
1412
1441
  cacheHitPrice: 0.022,
1413
1442
  peakPricing: DEEPSEEK_PEAK_SCHEDULE
1414
1443
  },
1415
- // Kimi/Moonshot models
1444
+ // Kimi/Moonshot models (platform.kimi.ai/docs/pricing/chat, 2026-10-23). Cache writes
1445
+ // ($2/$4 per M for 5m/1h on Pro, $4/$8 on Highspeed) are not modelled: Moonshot caches
1446
+ // automatically and only reports hits.
1416
1447
  [SupportedAiModels[LLM_CONSTANTS.KIMI].modelApiName]: {
1417
- inputPrice: 3,
1418
- outputPrice: 15,
1419
- cacheHitPrice: 0.3
1448
+ inputPrice: 2,
1449
+ outputPrice: 10,
1450
+ cacheHitPrice: 0.2
1451
+ },
1452
+ [SupportedAiModels[LLM_CONSTANTS.KIMI_HIGHSPEED].modelApiName]: {
1453
+ inputPrice: 4,
1454
+ outputPrice: 20,
1455
+ cacheHitPrice: 0.2
1420
1456
  },
1421
1457
  // Z.AI models
1422
1458
  [SupportedAiModels[LLM_CONSTANTS.GLM].modelApiName]: {
@@ -5430,6 +5466,7 @@ var AgentFactory = class {
5430
5466
  case LLM_CONSTANTS.MISTRAL_SMALL:
5431
5467
  return new MistralAgent(name, instruction, model.modelApiName, key, shouldEnableThinking);
5432
5468
  case LLM_CONSTANTS.KIMI:
5469
+ case LLM_CONSTANTS.KIMI_HIGHSPEED:
5433
5470
  return new KimiAgent(name, instruction, model.modelApiName, key, 0, shouldEnableThinking);
5434
5471
  // Z.AI models — thinking-only since 2026-08-05
5435
5472
  case LLM_CONSTANTS.GLM: