@ykurilov/agent-chat-core 0.69.0 → 0.69.1

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,11 @@
1
1
  # @ykurilov/agent-chat-core
2
2
 
3
+ ## 0.69.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 857777b: Ряд значков шагов в Тандеме — по настоящей ширине строки, «+N» всегда помещается, не вылезает за край узкой колонки; модели заголовков раздумий уходит не больше 1200 знаков раздумья (начало и конец) — длинный заголовок вдвое дешевле.
8
+
3
9
  ## 0.69.0
4
10
 
5
11
  ### Minor Changes
@@ -9936,7 +9936,7 @@ function resolveReplyChecks(setting) {
9936
9936
  import { generateText as generateText3 } from "ai";
9937
9937
  var THOUGHT_TITLE_USAGE_SOURCE = "thought_title";
9938
9938
  var MAX_TITLE_TOKENS = 40;
9939
- var MAX_THOUGHT_CHARS = 4e3;
9939
+ var MAX_THOUGHT_CHARS = 1200;
9940
9940
  var THOUGHT_TITLE_INSTRUCTIONS = [
9941
9941
  "You write a short title for a fragment of an AI assistant's private reasoning, shown to the user as a step label.",
9942
9942
  "Rules:",
@@ -9973,11 +9973,21 @@ function languageName(language) {
9973
9973
  const code = language.toLowerCase().split(/[-_]/)[0] ?? language;
9974
9974
  return LANGUAGE_NAMES[code] ?? language;
9975
9975
  }
9976
+ function headOf(text, max) {
9977
+ const head = text.slice(0, max);
9978
+ const cut = head.search(/\s\S*$/);
9979
+ return (cut > 0 ? head.slice(0, cut) : head).trimEnd();
9980
+ }
9981
+ function tailOf(text, max) {
9982
+ const tail = text.slice(-max);
9983
+ const cut = tail.search(/\s/);
9984
+ return (cut >= 0 ? tail.slice(cut) : tail).trimStart();
9985
+ }
9976
9986
  function thoughtTitlePrompt(text, language) {
9977
9987
  const clean = text.replace(/<\/?thought>/gi, "");
9978
- const shown = clean.length > MAX_THOUGHT_CHARS ? `${clean.slice(0, MAX_THOUGHT_CHARS / 2)}
9988
+ const shown = clean.length > MAX_THOUGHT_CHARS ? `${headOf(clean, MAX_THOUGHT_CHARS / 2)}
9979
9989
  \u2026
9980
- ${clean.slice(-MAX_THOUGHT_CHARS / 2)}` : clean;
9990
+ ${tailOf(clean, MAX_THOUGHT_CHARS / 2)}` : clean;
9981
9991
  return `<thought>
9982
9992
  ${shown}
9983
9993
  </thought>
@@ -15065,4 +15075,4 @@ export {
15065
15075
  InvalidWidgetAnswerError,
15066
15076
  createChatService
15067
15077
  };
15068
- //# sourceMappingURL=chunk-BJTHXNB6.js.map
15078
+ //# sourceMappingURL=chunk-7G63YBL5.js.map