@ykurilov/agent-chat-core 0.83.0 → 0.83.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ykurilov/agent-chat-core
2
2
 
3
+ ## 0.83.2
4
+
5
+ ### Patch Changes
6
+
7
+ - f63dea9: DeepSeek Flash1017 предлагает low/high/max с default high и сохраняет off. Старый on в сохранённом чате и defaultChoice принимается как high без смены маршрута. На точных id OpenRouter/Fireworks/Together максимальная ступень передаётся как max, не понижается через xhigh; остальные модели сохраняют прежнее преобразование.
8
+
9
+ Как обновить приложение: обновите все пакеты одной версией, стандартному каталогу override не нужен. Уберите статический providerOptions effort, если он перекрывает выбор пользователя. Новых env и SQL-миграций нет; подробнее docs/deepseek-flash-effort.md.
10
+
11
+ ## 0.83.1
12
+
13
+ No changes in this release.
14
+
3
15
  ## 0.83.0
4
16
 
5
17
  ### Minor Changes
@@ -9067,6 +9067,11 @@ var deepseekProvider = createDeepSeekProvider();
9067
9067
  // src/models/providers/fireworks.ts
9068
9068
  import { createFireworks } from "@ai-sdk/fireworks";
9069
9069
 
9070
+ // src/models/providers/deepseek-effort.ts
9071
+ function isDeepSeekFlash1017(providerModelId) {
9072
+ return providerModelId === "deepseek/deepseek-v4.1-flash-1017" || providerModelId === "accounts/fireworks/models/deepseek-v4p1-flash-1017" || providerModelId === "deepseek-ai/DeepSeek-V4.1-Flash-1017";
9073
+ }
9074
+
9070
9075
  // src/models/providers/sdk-reasoning.ts
9071
9076
  function sdkReasoningRequest(level) {
9072
9077
  switch (level) {
@@ -9160,7 +9165,7 @@ function createFireworksProvider(connectionOptions = {}) {
9160
9165
  displayName: "Fireworks",
9161
9166
  apiKeyEnv: "FIREWORKS_API_KEY",
9162
9167
  createLanguageModel: (providerModelId, apiKey, options2) => createFireworks({ apiKey, fetch: withToolResultImages2(options2?.fetch), ...connection })(providerModelId),
9163
- reasoningRequest: (level) => sdkReasoningRequest(level),
9168
+ reasoningRequest: (level, { providerModelId }) => level === "max" && isDeepSeekFlash1017(providerModelId) ? { providerOptions: { fireworks: { reasoningEffort: "max" } } } : sdkReasoningRequest(level),
9164
9169
  requestOptions: ({ chatId }) => ({
9165
9170
  providerOptions: {
9166
9171
  fireworks: { promptCacheKey: chatId, reasoningHistory: "preserved" }
@@ -9486,10 +9491,13 @@ function maxPriceField(maxPrice) {
9486
9491
  }
9487
9492
  var openrouterBase = {
9488
9493
  apiKeyEnv: "OPENROUTER_API_KEY",
9489
- reasoningRequest: (level, { profile, maxOutputTokens }) => {
9494
+ reasoningRequest: (level, { profile, providerModelId, maxOutputTokens }) => {
9490
9495
  const summary = profile.reasoning.encrypted ? { summary: "concise" } : {};
9491
9496
  if (level === "off") return { providerOptions: { openrouter: { reasoning: { enabled: false } } } };
9492
9497
  if (level === "on") return { providerOptions: { openrouter: { reasoning: { enabled: true, ...summary } } } };
9498
+ if (level === "max" && isDeepSeekFlash1017(providerModelId)) {
9499
+ return { providerOptions: { openrouter: { reasoning: { effort: "max", ...summary } } } };
9500
+ }
9493
9501
  const budget = profile.reasoning.tokenBudget && maxOutputTokens !== void 0 ? reasoningBudgetTokens(level, maxOutputTokens) : void 0;
9494
9502
  if (budget !== void 0) return { providerOptions: { openrouter: { reasoning: { max_tokens: budget, ...summary } } } };
9495
9503
  const effort = profile.reasoning.effortShareOfOutput && maxOutputTokens !== void 0 ? effortWithAnswerReserve(level, maxOutputTokens) : plainEffort(level);
@@ -9534,7 +9542,7 @@ function createTogetherProvider(connectionOptions = {}) {
9534
9542
  displayName: "Together AI",
9535
9543
  apiKeyEnv: "TOGETHER_API_KEY",
9536
9544
  createLanguageModel: (providerModelId, apiKey, options2) => createTogetherAI({ apiKey, fetch: withToolResultImages2(options2?.fetch), ...connection })(providerModelId),
9537
- reasoningRequest: (level) => sdkReasoningRequest(level),
9545
+ reasoningRequest: (level, { providerModelId }) => level === "max" && isDeepSeekFlash1017(providerModelId) ? { providerOptions: { togetherai: { reasoningEffort: "max" } } } : sdkReasoningRequest(level),
9538
9546
  samplingRequest: ({ minP }) => minP === void 0 ? {} : { togetherai: { min_p: minP } },
9539
9547
  requestOptions: () => ({}),
9540
9548
  toolResultImages: true,
@@ -9599,7 +9607,7 @@ var deepseek41FlashProfile = {
9599
9607
  // Запрет хозяев ниже сохранён по ранним замерам (specs/research-openrouter-tool-images.md);
9600
9608
  // проверка обычного маршрута 1017 не заменяет отдельного замера каждого хозяина.
9601
9609
  toolResultImageProviders: ["deepseek", "together", "fireworks", "openrouter"],
9602
- reasoning: { replayPastTurns: true, levels: ["off", "on"], defaultLevel: "on" },
9610
+ reasoning: { replayPastTurns: true, levels: ["off", "low", "high", "max"], defaultLevel: "high" },
9603
9611
  // Запрет стоит всегда, а не только при картинке: запрос одинаков в каждом ходе, кэш и выбранный хозяин не теряются.
9604
9612
  providerOptions: { openrouter: { provider: { ignore: ["deepinfra", "open-inference", "phala", "sail-research", "venice"] } } },
9605
9613
  // В словаре модели есть склеенный токен «?\n\n». Together по умолчанию хвост не режет и изредка (≈1 ответ из 1400)
@@ -10984,10 +10992,11 @@ function validateModelChoice(catalog, env, choice, { requireKey = true, allowHid
10984
10992
  if (choice.reasoning !== void 0) throw new InvalidModelChoiceError(`\u0423 \u043C\u043E\u0434\u0435\u043B\u0438 \xAB${profile.id}\xBB \u043D\u0435\u0442 \u0443\u0440\u043E\u0432\u043D\u0435\u0439 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439`);
10985
10993
  return { modelId: profile.id, providerId: provider.id };
10986
10994
  }
10987
- if (choice.reasoning !== void 0 && !levels.some((level) => level === choice.reasoning)) {
10995
+ const reasoning = choice.reasoning === "on" && profile.id === "deepseek-4.1-flash" && !levels.includes("on") && levels.includes("high") ? "high" : choice.reasoning;
10996
+ if (reasoning !== void 0 && !levels.some((level) => level === reasoning)) {
10988
10997
  throw new InvalidModelChoiceError(`\u0423 \u043C\u043E\u0434\u0435\u043B\u0438 \xAB${profile.id}\xBB \u043D\u0435\u0442 \u0443\u0440\u043E\u0432\u043D\u044F \xAB${choice.reasoning}\xBB`);
10989
10998
  }
10990
- return { modelId: profile.id, providerId: provider.id, reasoning: effectiveReasoningLevel(profile, choice.reasoning) };
10999
+ return { modelId: profile.id, providerId: provider.id, reasoning: effectiveReasoningLevel(profile, reasoning) };
10991
11000
  }
10992
11001
  function resolveDefaultChoice(catalog, env, configured, logError) {
10993
11002
  if (configured) {
@@ -15606,4 +15615,4 @@ export {
15606
15615
  InvalidWidgetAnswerError,
15607
15616
  createChatService
15608
15617
  };
15609
- //# sourceMappingURL=chunk-GXJNYXC5.js.map
15618
+ //# sourceMappingURL=chunk-MXJ2YLCP.js.map