@hiper2d/ai-agents 0.31.0 → 0.32.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
@@ -902,7 +902,7 @@ var SupportedAiModels = {
902
902
  apiKeyName: API_KEY_CONSTANTS.ANTHROPIC,
903
903
  hasThinking: true,
904
904
  reasoningEffort: "high",
905
- tags: ["expensive"]
905
+ tags: ["fast", "expensive"]
906
906
  },
907
907
  // Haiku moved 4.5 → 5.5 on 2026-10-08 (`claude-haiku-5-5`, verified live with the platform
908
908
  // key). 10x cheaper ($0.10/$0.50 up to 100K-token prompts), 1M context / 128K output.
@@ -916,7 +916,7 @@ var SupportedAiModels = {
916
916
  apiKeyName: API_KEY_CONSTANTS.ANTHROPIC,
917
917
  hasThinking: true,
918
918
  reasoningEffort: "high",
919
- tags: ["cheap"]
919
+ tags: ["fast", "cheap"]
920
920
  },
921
921
  // DeepSeek V4 models — thinking-only entries (non-thinking variants retired 2026-08-05).
922
922
  // reasoningEffort pinned to 'low' 2026-08-30: at the provider default ('high', no budget
@@ -933,7 +933,7 @@ var SupportedAiModels = {
933
933
  reasoningEffort: "low",
934
934
  // Reasoning tokens share the output budget, so leave room for both CoT and answer.
935
935
  maxOutputTokens: 65536,
936
- tags: ["cheap"]
936
+ tags: ["very-fast", "cheap"]
937
937
  },
938
938
  [LLM_CONSTANTS.DEEPSEEK_PRO]: {
939
939
  displayName: "DeepSeek V4 Pro",
@@ -1052,8 +1052,7 @@ var SupportedAiModels = {
1052
1052
  modelApiName: "gemini-3.8-flash",
1053
1053
  apiKeyName: API_KEY_CONSTANTS.GOOGLE,
1054
1054
  hasThinking: true,
1055
- reasoningEffort: "medium",
1056
- tags: ["fast"]
1055
+ reasoningEffort: "medium"
1057
1056
  },
1058
1057
  [LLM_CONSTANTS.GEMINI_LITE]: {
1059
1058
  displayName: "Gemini 3.5 Flash Lite",
@@ -1063,7 +1062,7 @@ var SupportedAiModels = {
1063
1062
  reasoningEffort: "minimal",
1064
1063
  // Pre-3.6, same as Pro: keeps the 0.2 it always had.
1065
1064
  temperature: 0.2,
1066
- tags: ["fast", "cheap"]
1065
+ tags: ["very-fast", "cheap"]
1067
1066
  },
1068
1067
  // Always-on reasoning — no non-thinking sibling. Bumped 4.6 → 4.7 on 2026-09-22 (id verified
1069
1068
  // against GET /v1/models). Same price, same 200K extended-context boundary; the context
@@ -1118,7 +1117,7 @@ var SupportedAiModels = {
1118
1117
  // model reasons when the field is omitted. The API now takes low|medium|high on Large 4
1119
1118
  // (the 400 for `none` lists exactly those; Small still takes only high|none); the level
1120
1119
  // barely moved latency or trace size (4-12k chars at every level), so it stays on the
1121
- // documented 'high' default. Model list: 1M context. Tagged `slow`: the 15-25s band.
1120
+ // documented 'high' default. Model list: 1M context. Tagged `slow`: prod p90 27.8s (2026-11-03).
1122
1121
  [LLM_CONSTANTS.MISTRAL_LARGE]: {
1123
1122
  displayName: "Mistral Large 4",
1124
1123
  // `mistral-large-latest` still points at Large 3 (no reasoning); use the explicit id.
@@ -1135,7 +1134,7 @@ var SupportedAiModels = {
1135
1134
  apiKeyName: API_KEY_CONSTANTS.MISTRAL,
1136
1135
  hasThinking: true,
1137
1136
  reasoningEffort: "high",
1138
- tags: ["very-fast", "cheap"]
1137
+ tags: ["fast", "cheap"]
1139
1138
  },
1140
1139
  // Kimi models. Always-reasoning entries: K3-series models reason by default and the only way
1141
1140
  // to stop it is the undocumented K2-era `thinking: disabled` toggle, which we no longer rely on.
@@ -1146,7 +1145,7 @@ var SupportedAiModels = {
1146
1145
  // 15-character story pipeline) to Kimi K3.1 Pro ($2/$10, 1M context, same low|high|max
1147
1146
  // effort levels, default max). Live at high effort 2026-10-23: 3-sentence schema ask
1148
1147
  // 4.2-4.5s, 8-character scene (476-845 output tokens) 9.7-14.9s = 49-57 tok/s — the same
1149
- // output speed as K3, so a full bot turn still lands in the 15-25s `slow` band.
1148
+ // output speed as K3. Prod 2026-11-03: p90 34.1s, so `very-slow`.
1150
1149
  // Consumer policy (werewolf): 1 bot per free game (opt-in) until 100 turns are measured.
1151
1150
  [LLM_CONSTANTS.KIMI]: {
1152
1151
  displayName: "Kimi K3.1 Pro",
@@ -1157,7 +1156,7 @@ var SupportedAiModels = {
1157
1156
  // Pinned 'high' 2026-09-22, down from Moonshot's 'max' default: K3 had no levels at
1158
1157
  // launch and the agent hardcoded max, so this is the first time the knob exists.
1159
1158
  reasoningEffort: "high",
1160
- tags: ["slow", "expensive"]
1159
+ tags: ["very-slow", "expensive"]
1161
1160
  },
1162
1161
  // Same model, Moonshot's high-speed serving tier ("roughly two to three times faster",
1163
1162
  // platform.kimi.ai K3.1 Pro quickstart, read 2026-10-23) at 2x the price ($4/$20 — Opus 5.5
@@ -1187,8 +1186,7 @@ var SupportedAiModels = {
1187
1186
  reasoningEffort: "high",
1188
1187
  // Headroom for the shared reasoning+answer budget (like the DeepSeek entries), sized
1189
1188
  // at 2x default rather than DeepSeek's 65536 to bound worst-case latency on a slow model.
1190
- maxOutputTokens: 16384,
1191
- tags: ["slow"]
1189
+ maxOutputTokens: 16384
1192
1190
  },
1193
1191
  // GLM-5.3-Flash (added 2026-08-30): the cheap sibling. Same API contract as GLM-5.3 —
1194
1192
  // thinking cannot be disabled and reasoning_effort takes low|high|max only
@@ -1269,7 +1267,7 @@ var SupportedAiModels = {
1269
1267
  // the 3.7 models (verified live) — add it to their entries if they ever need taming.
1270
1268
  thinkingBudgetTokens: 1024,
1271
1269
  // Capped it measures 25-26s → the >25s tier.
1272
- tags: ["very-slow"]
1270
+ tags: ["slow"]
1273
1271
  },
1274
1272
  // qwen3.8-flash replaced qwen3.7-flash on 2026-08-30 (same 1M context, 128k max output);
1275
1273
  // qwen3.7-plus was retired the same day — persisted 'qwen-plus' ids resolve to this entry
@@ -1297,8 +1295,8 @@ var SupportedAiModels = {
1297
1295
  // 1.7s and the 8-character scene (363 output tokens) in 2.4s — ~150 tok/s, the fastest
1298
1296
  // provider in the sweep that day (Kimi Highspeed's scene takes 8s); a 3.2k-token game
1299
1297
  // prompt with a two-sentence JSON reply took 1.9-2.1s at every effort level vs 3.5s for M3.
1300
- // Tagged `fast` rather than `very-fast`: the sweep straddles the 3s line and production
1301
- // turns carry 10k+ tokens of context. Launched 2026-09-27 as Token-Plan-only (the
1298
+ // Production 2026-11-03 (1,271 bot turns): p50 4.8s but p90 16.0s, so no speed tag (see
1299
+ // the grading above; it was `fast` on the sweep). Launched 2026-09-27 as Token-Plan-only (the
1302
1300
  // 2026-10-02 probe got `unknown model` on the pay-as-you-go key); on the key since at
1303
1301
  // least 2026-10-27.
1304
1302
  [LLM_CONSTANTS.MINIMAX]: {
@@ -1307,7 +1305,7 @@ var SupportedAiModels = {
1307
1305
  apiKeyName: API_KEY_CONSTANTS.MINIMAX,
1308
1306
  hasThinking: true,
1309
1307
  reasoningEffort: "medium",
1310
- tags: ["fast", "cheap"]
1308
+ tags: ["cheap"]
1311
1309
  },
1312
1310
  // Meta Muse Spark 1.3 (added 2026-09-12) on Meta's own Model API — Standard tier, i.e.
1313
1311
  // the private model id (the `-contributor` id is a quarter of the price but Meta trains
@@ -1317,8 +1315,8 @@ var SupportedAiModels = {
1317
1315
  // game default: turns are short and every reasoning token bills as output.
1318
1316
  // Temperature: Meta documents the model as tuned to its 1.0 default.
1319
1317
  // Speed: measured 2026-09-12 at medium effort — 9.6s on a full-context day-2 vote, 4-8s on
1320
- // short turns (reasoning ≈ 90% of output tokens). That is the untagged middle band by the
1321
- // grading above; tagged 'slow' anyway by decision so players expect a wait. Price-wise it
1318
+ // short turns (reasoning ≈ 90% of output tokens). Prod 2026-11-03: p50 10.5s, p90 24.6s,
1319
+ // which is `slow` by the grading above. Price-wise it
1322
1320
  // is neither cheap nor expensive.
1323
1321
  [LLM_CONSTANTS.MUSE_SPARK]: {
1324
1322
  displayName: "Muse Spark 1.3",
@@ -3975,9 +3973,8 @@ ${updatedMessages[0].content}`
3975
3973
  * New method using Zod with DeepSeek API
3976
3974
  * This provides better schema handling and runtime validation
3977
3975
  *
3978
- * DeepSeek V4 uses thinking toggle via extra_body. JSON mode (response_format
3979
- * json_object) is supported with or without thinking, so we always request it.
3980
- * Thinking additionally surfaces reasoning via reasoning_content.
3976
+ * DeepSeek V4 uses thinking toggle via extra_body; reasoning comes back in
3977
+ * reasoning_content. No JSON mode (response_format json_object), see below.
3981
3978
  */
3982
3979
  async doAskWithZodSchema(zodSchema, messages) {
3983
3980
  try {
@@ -4003,9 +4000,6 @@ ${schemaDescription}`
4003
4000
  };
4004
4001
  requestParams.messages = this.addSystemInstruction(modifiedInput);
4005
4002
  }
4006
- requestParams.response_format = {
4007
- type: "json_object"
4008
- };
4009
4003
  Object.assign(requestParams, this.thinkingParams());
4010
4004
  let response;
4011
4005
  try {