@ykurilov/agent-chat-react 0.73.0 → 0.74.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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @ykurilov/agent-chat-react
2
2
 
3
+ ## 0.74.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3140c17: Одуванчик получил композицию «Студия» и отдельный вход /sandbox с оформлением песочницы по умолчанию. Чат и журнал прокручиваются независимо; приветствие появляется только в загруженном пустом чате. В договорах скинов добавлены необязательные empty и busy, прежние скины совместимы. История песочницы сохраняет признаки транспорта, поэтому чат без фона не опрашивает несуществующий /tasks.
8
+
9
+ ### Как обновить приложение
10
+
11
+ Обновить все пакеты SDK одной версией. Для песочницы импортировать AgentSandbox из @ykurilov/agent-chat-skin-oduvanchik/sandbox, убрать прежние явные скины Тандема и подключить один CSS Одуванчика. У контейнера задать высоту и min-height: 0 у flex/grid-предков. Для сохранения Тандема оставить его импорты, явные скины и CSS. Сервер, доступ и данные не меняются. Подробности: https://github.com/ykurilov/agent-chat-sdk/blob/main/skins/oduvanchik/README.md
12
+
3
13
  ## 0.73.0
4
14
 
5
15
  No changes in this release.
@@ -362,6 +362,7 @@ var englishWorkLabels = {
362
362
  };
363
363
  var russianLabels = {
364
364
  locale: "ru",
365
+ welcome: { title: "\u0421 \u0447\u0435\u0433\u043E \u043D\u0430\u0447\u043D\u0451\u043C?", description: "\u0417\u0430\u0434\u0430\u0439\u0442\u0435 \u0432\u043E\u043F\u0440\u043E\u0441 \u0438\u043B\u0438 \u043E\u043F\u0438\u0448\u0438\u0442\u0435 \u0437\u0430\u0434\u0430\u0447\u0443." },
365
366
  helpers: russianHelpers,
366
367
  tasks: russianTasks,
367
368
  notices: russianNotices,
@@ -682,6 +683,7 @@ var englishCount = (count, one, many) => `${count} ${count === 1 ? one : many}`;
682
683
  var englishMergeDate = new Intl.DateTimeFormat("en-US", { day: "numeric", month: "long", hour: "2-digit", minute: "2-digit" });
683
684
  var englishLabels = {
684
685
  locale: "en",
686
+ welcome: { title: "Where shall we start?", description: "Ask a question or describe a task." },
685
687
  ...englishWorkLabels,
686
688
  workView: englishWorkViewLabels,
687
689
  composerSettings: { levels: { off: "Off", on: "On", minimal: "Minimal", low: "Low", medium: "Medium", high: "High", max: "Max" }, model: "Model", reasoning: "Reasoning", tools: "Tools", settings: "Response settings", done: "Done", via: "Via", search: "Find model", showReasoning: "Show reasoning", project: "Project", file: "File", image: "Image", textModels: "Text tasks", imageModels: "Text and images", models: "Models", noResults: "No results", price: "USD per million tokens", input: "input", output: "output" },
@@ -963,6 +965,7 @@ function ChatLabelsProvider({ labels, children }) {
963
965
  const resolved = useMemo(
964
966
  () => ({
965
967
  ...labels,
968
+ welcome: { ...(labels.locale?.startsWith("en") ? englishLabels : russianLabels).welcome, ...labels.welcome },
966
969
  composerSettings: { ...(labels.locale?.startsWith("en") ? englishLabels : russianLabels).composerSettings, ...labels.composerSettings },
967
970
  externalImageLink: labels.externalImageLink ?? russianLabels.externalImageLink,
968
971
  answerCutByLength: labels.answerCutByLength ?? russianLabels.answerCutByLength,
@@ -2348,7 +2351,8 @@ function useAgentChat({
2348
2351
  const [accessRefusal, setAccessRefusal] = useState3(null);
2349
2352
  const [capabilities, setCapabilities] = useState3(ALL_CAPABILITIES);
2350
2353
  const [closed, setClosed] = useState3(null);
2351
- const [backgroundTasksAvailable, setBackgroundTasksAvailable] = useState3(true);
2354
+ const [backgroundCapability, setBackgroundCapability] = useState3(null);
2355
+ const backgroundTasksAvailable = backgroundCapability?.chatUrl === chatUrl2 ? backgroundCapability.available : true;
2352
2356
  const [modelAcceptsImages, setModelAcceptsImages] = useState3(void 0);
2353
2357
  const [externalContent, setExternalContent] = useState3(false);
2354
2358
  const showClosure = useCallback4((next) => {
@@ -2359,11 +2363,14 @@ function useAgentChat({
2359
2363
  const next = capabilitiesOf(history2.capabilities);
2360
2364
  setCapabilities((current) => sameCapabilities(current, next) ? current : next);
2361
2365
  showClosure(closureOf(history2.chat?.closed));
2362
- setBackgroundTasksAvailable(history2.backgroundTasks !== false);
2366
+ if (typeof history2.backgroundTasks === "boolean") {
2367
+ const available = history2.backgroundTasks;
2368
+ setBackgroundCapability((current) => current?.chatUrl === chatUrl2 && current.available === available ? current : { chatUrl: chatUrl2, available });
2369
+ }
2363
2370
  setModelAcceptsImages(typeof history2.modelAcceptsImages === "boolean" ? history2.modelAcceptsImages : void 0);
2364
2371
  if (history2.externalContent === true) setExternalContent(true);
2365
2372
  },
2366
- [showClosure]
2373
+ [chatUrl2, showClosure]
2367
2374
  );
2368
2375
  const onTurnRefusedRef = useRef5(onTurnRefused);
2369
2376
  onTurnRefusedRef.current = onTurnRefused;
@@ -6342,6 +6349,7 @@ ${text}` : text),
6342
6349
  const layout = /* @__PURE__ */ jsx9(
6343
6350
  skin.Layout,
6344
6351
  {
6352
+ empty: chat.loaded && !chat.loadFailed && !chat.sendFailed && !chat.serverRefusal && !chat.refusal && chat.connection === "online" && !chatClosed && !busy && feedMessages.length === 0,
6345
6353
  feed,
6346
6354
  scrollRef,
6347
6355
  announcement: announced,
@@ -7224,4 +7232,4 @@ export {
7224
7232
  activeChatTitle,
7225
7233
  useWorkspaceListSync
7226
7234
  };
7227
- //# sourceMappingURL=chunk-WJJY2WLQ.js.map
7235
+ //# sourceMappingURL=chunk-I764HZRF.js.map