@ykurilov/agent-chat-react 0.73.0 → 0.75.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 +22 -0
- package/dist/{chunk-WJJY2WLQ.js → chunk-LF723Y52.js} +17 -5
- package/dist/chunk-LF723Y52.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/panel.js +1 -1
- package/dist/types/agent-chat.d.ts +6 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/labels.d.ts +10 -1
- package/dist/types/skin-contract.d.ts +12 -1
- package/package.json +1 -1
- package/dist/chunk-WJJY2WLQ.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/panel.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useChatList,
|
|
7
7
|
useChatListView,
|
|
8
8
|
useWorkspaceListSync
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LF723Y52.js";
|
|
10
10
|
|
|
11
11
|
// src/agent-panel/agent-panel-provider.tsx
|
|
12
12
|
import { useCallback as useCallback2, useMemo, useRef, useState, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ComposerOptions } from "./composer-options.js";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
2
3
|
import type { AgentChatMessage, ChatModelChoice } from "./chat-types.js";
|
|
3
4
|
import type { AgentChatExtensions } from "./agent-chat-extensions.js";
|
|
4
5
|
import type { AnswerEditing } from "./answer-editing/answer-editing.js";
|
|
5
6
|
import type { AttachmentsPlugin } from "./attachments-contract.js";
|
|
6
|
-
import type { ChatSkin } from "./skin-contract.js";
|
|
7
|
+
import type { ChatHeaderView, ChatSkin } from "./skin-contract.js";
|
|
7
8
|
import type { VoiceInput } from "./voice-input.js";
|
|
8
9
|
import type { VoiceDialogEngine } from "./voice-dialog.js";
|
|
9
10
|
import type { AppRefusal } from "./app-refusal.js";
|
|
@@ -16,6 +17,10 @@ import type { AppEventHandler } from "./app-events.js";
|
|
|
16
17
|
import type { TurnFinishedEvent } from "./turn-finished.js";
|
|
17
18
|
import type { ChatStateValues } from "./chat-state/chat-state.js";
|
|
18
19
|
export interface AgentChatProps extends AgentChatExtensions {
|
|
20
|
+
/** Optional application heading and trailing content, rendered by the selected skin. */
|
|
21
|
+
header?: ChatHeaderView;
|
|
22
|
+
/** Application-owned result. Shown after loaded history while idle; never changes server status. Null/false removes it. */
|
|
23
|
+
completion?: ReactNode;
|
|
19
24
|
composerOptions?: ComposerOptions;
|
|
20
25
|
/** Адрес обработчика чата, например `/api/chat`. */
|
|
21
26
|
api: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type { StepCall, StepPhrase, StepPhrases, StepPhraseText, WorkView } from
|
|
|
26
26
|
export { guessStepIcon, stepIconOf } from "./work-view/step-icons.js";
|
|
27
27
|
export type { StepIcon } from "./work-view/step-icons.js";
|
|
28
28
|
export type { SpendingInfo, SpendingPeriod, SpendingRefusalReason, SpendingScope, SpendingView, SpendingWindowInfo } from "./spending-status.js";
|
|
29
|
-
export type { AgentNoticeViewKind, AgentNoticeViewProps, AgentVideoView, ChatOriginView, ChatSkin, CustomWidgetProps, DiagramColors, DiagramView, FormFieldView, LiveDemoColors, LiveDemoView, GeneratedImagesView, HelperCallStatus, HelperCallView, HelperStepView, MediaViewerProps, MessageActionView, ModelChoiceView, StaffMessageView, TaskCardView, TaskStatusView, ToolApprovalView, ToolCallState, VoiceInputView, WidgetView, WorkStepsView, } from "./skin-contract.js";
|
|
29
|
+
export type { AgentNoticeViewKind, AgentNoticeViewProps, AgentVideoView, ChatOriginView, ChatSkin, ChatHeaderView, CustomWidgetProps, DiagramColors, DiagramView, FormFieldView, LiveDemoColors, LiveDemoView, GeneratedImagesView, HelperCallStatus, HelperCallView, HelperStepView, MediaViewerProps, MessageActionView, ModelChoiceView, StaffMessageView, TaskCardView, TaskStatusView, ToolApprovalView, ToolCallState, VoiceInputView, WidgetView, WorkStepsView, } from "./skin-contract.js";
|
|
30
30
|
export type { AgentAppBridge, AppDataChange, BrowserCall, BrowserCallResult, ScreenPlace } from "./app-bridge/app-bridge.js";
|
|
31
31
|
export { useAgentChat } from "./use-agent-chat.js";
|
|
32
32
|
export type { AppRefusal, AppRefusalKind } from "./app-refusal.js";
|
package/dist/types/labels.d.ts
CHANGED
|
@@ -222,6 +222,11 @@ export interface ComposerSettingsLabels {
|
|
|
222
222
|
output: string;
|
|
223
223
|
}
|
|
224
224
|
export interface ChatLabels {
|
|
225
|
+
/** Приветствие пустого чата. Скины без приветствия игнорируют. */
|
|
226
|
+
welcome?: {
|
|
227
|
+
title?: string;
|
|
228
|
+
description?: string;
|
|
229
|
+
};
|
|
225
230
|
composerSettings?: Partial<ComposerSettingsLabels>;
|
|
226
231
|
/**
|
|
227
232
|
* Язык словаря (BCP 47): `ru` у `russianLabels`, `en` у `englishLabels`. Скин по нему выбирает свои надписи — например,
|
|
@@ -450,7 +455,11 @@ export interface ChatLabels {
|
|
|
450
455
|
workView?: Partial<WorkViewLabels>;
|
|
451
456
|
}
|
|
452
457
|
/** Словарь, в котором есть и необязательные надписи: их подставляет `ChatLabelsProvider`. */
|
|
453
|
-
export type ResolvedChatLabels = Omit<ChatLabels, "widgets" | "diagram" | "demo" | "images" | "videos" | "viewer" | "voice" | "helpers" | "tasks" | "notices" | "messengerStatus" | "workView" | "composerSettings"> & Required<Pick<ChatLabels, "externalImageLink" | "answerCutByLength" | "answerEdited" | "answerUndelivered" | "toolOutputEdited" | "editAnswer" | "steeringPending" | "thinkingPhrases" | "thinkingElapsed" | "spendingMessagesLeft" | "spendingMessagesExhausted" | "editMessageLimit">> & {
|
|
458
|
+
export type ResolvedChatLabels = Omit<ChatLabels, "widgets" | "diagram" | "demo" | "images" | "videos" | "viewer" | "voice" | "helpers" | "tasks" | "notices" | "messengerStatus" | "workView" | "composerSettings" | "welcome"> & Required<Pick<ChatLabels, "externalImageLink" | "answerCutByLength" | "answerEdited" | "answerUndelivered" | "toolOutputEdited" | "editAnswer" | "steeringPending" | "thinkingPhrases" | "thinkingElapsed" | "spendingMessagesLeft" | "spendingMessagesExhausted" | "editMessageLimit">> & {
|
|
459
|
+
welcome: {
|
|
460
|
+
title: string;
|
|
461
|
+
description: string;
|
|
462
|
+
};
|
|
454
463
|
composerSettings: ComposerSettingsLabels;
|
|
455
464
|
widgets: WidgetLabels;
|
|
456
465
|
diagram: DiagramLabels;
|
|
@@ -411,7 +411,7 @@ export interface StaffMessageView {
|
|
|
411
411
|
staffName?: string;
|
|
412
412
|
}
|
|
413
413
|
/**
|
|
414
|
-
* Договор скина, версия 29: необязательные Composer.options, AgentMessage.modelDetails и WorkSteps.live.completed.
|
|
414
|
+
* Договор скина, версия 31: необязательные Layout.header и Layout.completion. Версия 30: необязательный Layout.empty. Версия 29: необязательные Composer.options, AgentMessage.modelDetails и WorkSteps.live.completed.
|
|
415
415
|
* Скины 28 работают без правок. В версии 28 добавились только необязательные значки шагов и заголовки раздумий:
|
|
416
416
|
* `WorkStepsView.live.icon`, `WorkStepsView.done.items`, `icons`, `moreIcons` и `Reasoning.title`, docs/skin-v28.md;
|
|
417
417
|
* скин версии 27 работает без правок: шаги без значков, раздумья — «Думал N сек».
|
|
@@ -465,8 +465,19 @@ export interface StaffMessageView {
|
|
|
465
465
|
* собирает ленту только из этих
|
|
466
466
|
* компонентов и ничего своего не рисует. Надписи компоненты берут из `useChatLabels()`.
|
|
467
467
|
*/
|
|
468
|
+
/** Application-owned chat heading; skins render it in their own visual system. */
|
|
469
|
+
export interface ChatHeaderView {
|
|
470
|
+
title: string;
|
|
471
|
+
aside?: ReactNode;
|
|
472
|
+
headingLevel?: 1 | 2 | 3;
|
|
473
|
+
}
|
|
468
474
|
export interface ChatSkin {
|
|
469
475
|
Layout: ComponentType<{
|
|
476
|
+
header?: ChatHeaderView;
|
|
477
|
+
/** Application-owned result, after the feed in the same scroll root. Keep composer mounted but hidden while present. */
|
|
478
|
+
completion?: ReactNode;
|
|
479
|
+
/** История успешно загружена, сообщений нет и ход не выполняется. Необязательная подсказка для приветствия. */
|
|
480
|
+
empty?: boolean;
|
|
470
481
|
feed: ReactNode;
|
|
471
482
|
composer: ReactNode;
|
|
472
483
|
notice?: ReactNode;
|