@ykurilov/agent-chat-react 0.70.1 → 0.71.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 +20 -0
- package/dist/{chunk-Z7X5D4OF.js → chunk-WJJY2WLQ.js} +98 -46
- package/dist/chunk-WJJY2WLQ.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/panel.js +1 -1
- package/dist/types/agent-chat-extensions.d.ts +2 -0
- package/dist/types/agent-chat.d.ts +2 -0
- package/dist/types/chat-types.d.ts +1 -0
- package/dist/types/composer-options.d.ts +30 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/labels.d.ts +24 -1
- package/dist/types/skin-contract.d.ts +26 -2
- package/dist/types/work-view/work-layout.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunk-Z7X5D4OF.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-WJJY2WLQ.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";
|
|
@@ -54,6 +54,8 @@ export type CustomWidgets = Record<string, ComponentType<CustomWidgetProps<any,
|
|
|
54
54
|
* и которые слой поведения несёт вниз до частей ответа. Без них отрисовка и запросы, как в 0.15.
|
|
55
55
|
*/
|
|
56
56
|
export interface AgentChatExtensions {
|
|
57
|
+
/** Ask compatible skins to show actual response model settings. */
|
|
58
|
+
answerDetails?: boolean;
|
|
57
59
|
/** Свои виджеты: `{ pick_slot: PickSlotWidget }`. Базовые виджеты свойства не требуют. */
|
|
58
60
|
widgets?: CustomWidgets;
|
|
59
61
|
/** Схемы из блоков ```mermaid: `diagramsClient`. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComposerOptions } from "./composer-options.js";
|
|
1
2
|
import type { AgentChatMessage, ChatModelChoice } from "./chat-types.js";
|
|
2
3
|
import type { AgentChatExtensions } from "./agent-chat-extensions.js";
|
|
3
4
|
import type { AnswerEditing } from "./answer-editing/answer-editing.js";
|
|
@@ -15,6 +16,7 @@ import type { AppEventHandler } from "./app-events.js";
|
|
|
15
16
|
import type { TurnFinishedEvent } from "./turn-finished.js";
|
|
16
17
|
import type { ChatStateValues } from "./chat-state/chat-state.js";
|
|
17
18
|
export interface AgentChatProps extends AgentChatExtensions {
|
|
19
|
+
composerOptions?: ComposerOptions;
|
|
18
20
|
/** Адрес обработчика чата, например `/api/chat`. */
|
|
19
21
|
api: string;
|
|
20
22
|
/** Какой чат открыть. Нужен ровно один из `chatId` и `subject`: оба сразу или ни одного — ошибка разработчика (исключение). */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Optional, skin-independent controls. The host owns context and enabled tool configuration. */
|
|
2
|
+
export interface ComposerOptions {
|
|
3
|
+
variant?: "compact" | "standard" | "extended";
|
|
4
|
+
context?: {
|
|
5
|
+
label: string;
|
|
6
|
+
onPick?: () => void;
|
|
7
|
+
};
|
|
8
|
+
projects?: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
onPick: () => void;
|
|
12
|
+
}>;
|
|
13
|
+
contextAttachments?: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
onRemove?: () => void;
|
|
17
|
+
}>;
|
|
18
|
+
tools?: Array<{
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
onChange: (enabled: boolean) => void;
|
|
24
|
+
}>;
|
|
25
|
+
/** Display only; server capabilities still govern access to reasoning. */
|
|
26
|
+
reasoningVisibility?: {
|
|
27
|
+
value: boolean;
|
|
28
|
+
onChange: (visible: boolean) => void;
|
|
29
|
+
};
|
|
30
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { ComposerOptions } from "./composer-options.js";
|
|
1
2
|
export { AgentChat } from "./agent-chat.js";
|
|
2
3
|
export { STEP_RESET_PART_TYPE, withoutResetSteps } from "./step-reset.js";
|
|
3
4
|
export type { AttachmentsController, AttachmentsPlugin, ComposerAttachmentItem, ComposerAttachments, MessageAttachmentItem, MessageAttachmentsView, } from "./attachments-contract.js";
|
package/dist/types/labels.d.ts
CHANGED
|
@@ -200,7 +200,29 @@ export interface VoiceSpeechLabels {
|
|
|
200
200
|
* `viewer`, `voice`) и версии 14 (`videos`) необязательные: словарь приложения, написанный раньше, работает, недостающее берётся из `russianLabels`;
|
|
201
201
|
* внутри группы можно перекрыть любой один ключ.
|
|
202
202
|
*/
|
|
203
|
+
export interface ComposerSettingsLabels {
|
|
204
|
+
levels: Record<string, string>;
|
|
205
|
+
model: string;
|
|
206
|
+
reasoning: string;
|
|
207
|
+
tools: string;
|
|
208
|
+
settings: string;
|
|
209
|
+
done: string;
|
|
210
|
+
via: string;
|
|
211
|
+
search: string;
|
|
212
|
+
showReasoning: string;
|
|
213
|
+
project: string;
|
|
214
|
+
file: string;
|
|
215
|
+
image: string;
|
|
216
|
+
textModels: string;
|
|
217
|
+
imageModels: string;
|
|
218
|
+
models: string;
|
|
219
|
+
noResults: string;
|
|
220
|
+
price: string;
|
|
221
|
+
input: string;
|
|
222
|
+
output: string;
|
|
223
|
+
}
|
|
203
224
|
export interface ChatLabels {
|
|
225
|
+
composerSettings?: Partial<ComposerSettingsLabels>;
|
|
204
226
|
/**
|
|
205
227
|
* Язык словаря (BCP 47): `ru` у `russianLabels`, `en` у `englishLabels`. Скин по нему выбирает свои надписи — например,
|
|
206
228
|
* Тандем ставит словарь дизайн-системы на том же языке. Нет — скин решает сам (Тандем: русский или словарь приложения).
|
|
@@ -428,7 +450,8 @@ export interface ChatLabels {
|
|
|
428
450
|
workView?: Partial<WorkViewLabels>;
|
|
429
451
|
}
|
|
430
452
|
/** Словарь, в котором есть и необязательные надписи: их подставляет `ChatLabelsProvider`. */
|
|
431
|
-
export type ResolvedChatLabels = Omit<ChatLabels, "widgets" | "diagram" | "demo" | "images" | "videos" | "viewer" | "voice" | "helpers" | "tasks" | "notices" | "messengerStatus" | "workView"> & Required<Pick<ChatLabels, "externalImageLink" | "answerCutByLength" | "answerEdited" | "answerUndelivered" | "toolOutputEdited" | "editAnswer" | "steeringPending" | "thinkingPhrases" | "thinkingElapsed" | "spendingMessagesLeft" | "spendingMessagesExhausted" | "editMessageLimit">> & {
|
|
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">> & {
|
|
454
|
+
composerSettings: ComposerSettingsLabels;
|
|
432
455
|
widgets: WidgetLabels;
|
|
433
456
|
diagram: DiagramLabels;
|
|
434
457
|
demo: LiveDemoLabels;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComposerOptions } from "./composer-options.js";
|
|
1
2
|
import type { ComponentType, ReactElement, ReactNode, RefObject } from "react";
|
|
2
3
|
import type { ComposerAttachments, MessageAttachmentsView } from "./attachments-contract.js";
|
|
3
4
|
import type { AnswerStatus, ApprovalDecision, ErrorNoticeKind } from "./chat-types.js";
|
|
@@ -102,6 +103,13 @@ export interface ModelChoiceView {
|
|
|
102
103
|
id: string;
|
|
103
104
|
name: string;
|
|
104
105
|
acceptsImages?: boolean;
|
|
106
|
+
group?: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
tags?: string[];
|
|
109
|
+
price?: {
|
|
110
|
+
inputPerMillion: number;
|
|
111
|
+
outputPerMillion: number;
|
|
112
|
+
};
|
|
105
113
|
}>;
|
|
106
114
|
}>;
|
|
107
115
|
/** Текущий выбор: провайдер и модель. */
|
|
@@ -364,6 +372,11 @@ export interface MessageActionView {
|
|
|
364
372
|
*/
|
|
365
373
|
export type WorkStepsView = {
|
|
366
374
|
state: "live";
|
|
375
|
+
completed?: Array<{
|
|
376
|
+
phrase: string;
|
|
377
|
+
failed: boolean;
|
|
378
|
+
icon?: StepIcon;
|
|
379
|
+
}>;
|
|
367
380
|
phrase: string;
|
|
368
381
|
/** Версия 28: значок текущего шага (`StepIcon`). Нет — скин до 28 рисует строку без значка. */
|
|
369
382
|
icon?: StepIcon;
|
|
@@ -398,9 +411,10 @@ export interface StaffMessageView {
|
|
|
398
411
|
staffName?: string;
|
|
399
412
|
}
|
|
400
413
|
/**
|
|
401
|
-
* Договор скина, версия
|
|
414
|
+
* Договор скина, версия 29: необязательные Composer.options, AgentMessage.modelDetails и WorkSteps.live.completed.
|
|
415
|
+
* Скины 28 работают без правок. В версии 28 добавились только необязательные значки шагов и заголовки раздумий:
|
|
402
416
|
* `WorkStepsView.live.icon`, `WorkStepsView.done.items`, `icons`, `moreIcons` и `Reasoning.title`, docs/skin-v28.md;
|
|
403
|
-
* скин версии 27 работает без правок: шаги без значков, раздумья — «Думал N
|
|
417
|
+
* скин версии 27 работает без правок: шаги без значков, раздумья — «Думал N сек».
|
|
404
418
|
* Версия 27 (в версии 27 добавилось только необязательное `ServiceLine` — служебная строка пометки
|
|
405
419
|
* приложения, право чата `appNotices` и `noticeLines`, docs/skin-v27.md; скин версии 26 работает без правок: пометок
|
|
406
420
|
* не видно).
|
|
@@ -501,6 +515,14 @@ export interface ChatSkin {
|
|
|
501
515
|
attachments?: MessageAttachmentsView;
|
|
502
516
|
}>;
|
|
503
517
|
AgentMessage: ComponentType<{
|
|
518
|
+
/** Actual answer settings, not the current composer selection. */
|
|
519
|
+
modelDetails?: {
|
|
520
|
+
modelId: string;
|
|
521
|
+
providerId: string;
|
|
522
|
+
modelName?: string;
|
|
523
|
+
providerName?: string;
|
|
524
|
+
reasoning?: string;
|
|
525
|
+
};
|
|
504
526
|
status: AnswerStatus;
|
|
505
527
|
/** Части ответа в порядке прихода. */
|
|
506
528
|
children: ReactNode;
|
|
@@ -636,6 +658,8 @@ export interface ChatSkin {
|
|
|
636
658
|
/** Вместо всего чата, если он чужой или его нет: без ленты, поля ввода и «повторить». */
|
|
637
659
|
ChatNotFound: ComponentType;
|
|
638
660
|
Composer: ComponentType<{
|
|
661
|
+
/** Optional composer presentation and application-owned controls. */
|
|
662
|
+
options?: ComposerOptions;
|
|
639
663
|
value: string;
|
|
640
664
|
onValueChange: (value: string) => void;
|
|
641
665
|
onSubmit: () => void;
|