@green-on-grey/ui-kit 1.10.3 → 1.11.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/dist/chat/ContextMeter.d.ts +3 -1
- package/dist/chat/MessageView.d.ts +12 -2
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/types.d.ts +25 -2
- package/dist/chat.js +341 -183
- package/dist/chat.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/index.d.ts +120 -0
- package/dist/locales.js +130 -10
- package/dist/locales.js.map +1 -1
- package/dist/manifest.json +20 -1
- package/dist/styles.css +20 -0
- package/dist/{ui-sV5t0cp1.js → ui-BrAaLui6.js} +2 -2
- package/dist/ui-BrAaLui6.js.map +1 -0
- package/package.json +1 -1
- package/dist/ui-sV5t0cp1.js.map +0 -1
|
@@ -4,10 +4,12 @@ export declare function tokens(n: number, lng: string): string;
|
|
|
4
4
|
/** The fill of the context window by a ring next to the send button
|
|
5
5
|
* (FTR.NAB.CHAT-0001 R3, design §3.1): grey, amber from 70 %, red from 90 %.
|
|
6
6
|
* A click shows the numbers; a full context (from 90 %) offers to compact or to reset, off while the agent answers. */
|
|
7
|
-
export declare function ContextMeter({ context, onCompact, onReset, busy }: {
|
|
7
|
+
export declare function ContextMeter({ context, onCompact, onReset, busy, queued }: {
|
|
8
8
|
context: ChatContext;
|
|
9
9
|
onCompact?: () => void;
|
|
10
10
|
onReset?: () => void;
|
|
11
11
|
/** A turn is being written: the actions wait for it. */
|
|
12
12
|
busy?: boolean;
|
|
13
|
+
/** FTR.NAB.CHAT-0004 R5: messages wait in the queue — the actions wait for their answers too. */
|
|
14
|
+
queued?: boolean;
|
|
13
15
|
}): import("react").JSX.Element;
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import { type LoadAttachment, type LoadOfficePreview } from "./Attachments";
|
|
2
|
-
import type { ChatAttachment, ChatMessage, ChatStep } from "./types";
|
|
2
|
+
import type { ChatAttachment, ChatMessage, ChatStep, ChatSubagent } from "./types";
|
|
3
3
|
/** The time of a caption: hours and minutes in the language of the interface. */
|
|
4
4
|
export declare function markTime(iso: string, language: string): string;
|
|
5
5
|
/** More than three steps are folded to the last two (design §6.4). */
|
|
6
6
|
export declare function visibleSteps(steps: ChatStep[], open: boolean): ChatStep[];
|
|
7
7
|
/** One message of the conversation (design §6.4). */
|
|
8
|
-
export declare function MessageView({ m, busy, onRetry, loadAttachment, loadPreview, onOpenAttachment }: {
|
|
8
|
+
export declare function MessageView({ m, busy, onRetry, loadAttachment, loadPreview, onOpenAttachment, queuePosition, onCancelQueued, stopping }: {
|
|
9
9
|
m: ChatMessage;
|
|
10
10
|
busy: boolean;
|
|
11
11
|
onRetry?: () => void;
|
|
12
|
+
/** FTR.NAB.CHAT-0004 R1, R3: the number of a queued message and its cancellation. */
|
|
13
|
+
queuePosition?: number;
|
|
14
|
+
onCancelQueued?: () => void;
|
|
15
|
+
/** R8: the user asked to stop this answer; it ends within seconds. */
|
|
16
|
+
stopping?: boolean;
|
|
12
17
|
/** R34: the preview of the files; without it they are links. */
|
|
13
18
|
loadAttachment?: LoadAttachment;
|
|
14
19
|
onOpenAttachment?: (a: ChatAttachment) => void;
|
|
15
20
|
/** FTR.NAB.CHAT-0003: documents and spreadsheets open in the preview too. */
|
|
16
21
|
loadPreview?: LoadOfficePreview;
|
|
17
22
|
}): import("react").JSX.Element;
|
|
23
|
+
/** The step «Subagents · N» (FTR.NAB.CMN-0009 design §3): open while a task runs, then one line with the outcome;
|
|
24
|
+
* a click opens the rows, a click on a row its result. */
|
|
25
|
+
export declare function SubagentStep({ tasks }: {
|
|
26
|
+
tasks: ChatSubagent[];
|
|
27
|
+
}): import("react").JSX.Element;
|
|
18
28
|
/** A notice longer than this many lines is folded (FTR.NAB.CHAT-0002 design §3.1). */
|
|
19
29
|
export declare const NOTICE_LINES = 12;
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export { AgentButton, AgentMenu, type AgentModelOption, type AgentModels, type A
|
|
|
5
5
|
export { AgentSettingsMenu, agentModelKey, agentModelOptions, type AgentModel, type AgentModelChoice, type AgentModelState, } from "./AgentSettingsMenu";
|
|
6
6
|
export { CommandPalette } from "./CommandPalette";
|
|
7
7
|
export { ContextMeter, tokens } from "./ContextMeter";
|
|
8
|
-
export { MessageView, NOTICE_LINES } from "./MessageView";
|
|
8
|
+
export { MessageView, NOTICE_LINES, SubagentStep } from "./MessageView";
|
|
9
9
|
export { useRecorder } from "./useRecorder";
|
|
10
|
-
export type { ChatAttachment, ChatCommand, ChatConfirmation, ChatContext, ChatConversation, ChatEvent, ChatMark, ChatMessage, ChatProps, ChatStep, ChatUpload, ChatWait, ConversationListProps, OfficePreview, Sheet, SheetCell, } from "./types";
|
|
10
|
+
export type { ChatAttachment, ChatCommand, ChatConfirmation, ChatContext, ChatConversation, ChatEvent, ChatMark, ChatMessage, ChatProps, ChatStep, ChatSubagent, ChatUpload, ChatWait, ConversationListProps, OfficePreview, Sheet, SheetCell, } from "./types";
|
package/dist/chat/types.d.ts
CHANGED
|
@@ -26,6 +26,18 @@ export interface ChatStep {
|
|
|
26
26
|
text: string;
|
|
27
27
|
title?: string;
|
|
28
28
|
status: "running" | "done" | "error";
|
|
29
|
+
/** The tasks of a call of subagents (FTR.NAB.CMN-0009 R8): the step is drawn as «Subagents · N» with a row per task. */
|
|
30
|
+
subagents?: ChatSubagent[];
|
|
31
|
+
}
|
|
32
|
+
/** A task of a subagent: `result` is its beginning, cut by the product with «…», only when done or timed out;
|
|
33
|
+
* `error` is why it failed or was stopped — an aborted task without one was stopped with the turn. */
|
|
34
|
+
export interface ChatSubagent {
|
|
35
|
+
task: number;
|
|
36
|
+
description: string;
|
|
37
|
+
state: "running" | "done" | "failed" | "timeout" | "aborted";
|
|
38
|
+
tools: number;
|
|
39
|
+
error?: string;
|
|
40
|
+
result?: string;
|
|
29
41
|
}
|
|
30
42
|
/** The caption over a message: the channel it came from or the context of the product. */
|
|
31
43
|
export interface ChatMark {
|
|
@@ -55,7 +67,12 @@ export interface ChatMessage {
|
|
|
55
67
|
text: string;
|
|
56
68
|
/** ISO time. */
|
|
57
69
|
createdAt: string;
|
|
58
|
-
|
|
70
|
+
/** `stopped`: the user stopped the answer (FTR.NAB.CHAT-0004 R9) — what was written stays, with «Retry». */
|
|
71
|
+
status: "pending" | "streaming" | "done" | "failed" | "stopped";
|
|
72
|
+
/** A user message waiting in the queue for its answer (FTR.NAB.CHAT-0004 R1); the chat numbers them. */
|
|
73
|
+
queued?: boolean;
|
|
74
|
+
/** A failed or stopped answer whose retry waits in the queue (FTR.NAB.CHAT-0004 design §3 p. 8). */
|
|
75
|
+
retryQueued?: boolean;
|
|
59
76
|
mark?: ChatMark;
|
|
60
77
|
attachments?: ChatAttachment[];
|
|
61
78
|
steps?: ChatStep[];
|
|
@@ -111,8 +128,10 @@ export interface ChatProps {
|
|
|
111
128
|
historyError?: ReactNode;
|
|
112
129
|
hasOlder?: boolean;
|
|
113
130
|
loadingOlder?: boolean;
|
|
114
|
-
/** A turn is being sent or answered: sending and retrying wait. */
|
|
131
|
+
/** A turn is being sent or answered: sending and retrying wait. With `allowQueue` — only while a message is sent. */
|
|
115
132
|
busy?: boolean;
|
|
133
|
+
/** FTR.NAB.CHAT-0004 R1: a message may be sent while the agent answers; it waits in the queue. */
|
|
134
|
+
allowQueue?: boolean;
|
|
116
135
|
/** Shown instead of the composer: why one cannot write here and what to do. */
|
|
117
136
|
readOnly?: ReactNode;
|
|
118
137
|
confirmations?: ChatConfirmation[];
|
|
@@ -138,6 +157,10 @@ export interface ChatProps {
|
|
|
138
157
|
onLoadOlder?(): void;
|
|
139
158
|
onRetry?(messageId: string): void;
|
|
140
159
|
onCancel?(): void;
|
|
160
|
+
/** FTR.NAB.CHAT-0004 R3: cancels a message waiting in the queue; the product tells the user of a failure. */
|
|
161
|
+
onCancelQueued?(messageId: string): Promise<void>;
|
|
162
|
+
/** FTR.NAB.CHAT-0004 R8: stops the answer being written. «Stop» takes the place of «Send» while the field is empty. */
|
|
163
|
+
onStop?(answerId: string): Promise<void>;
|
|
141
164
|
onConfirm?(id: string, approve: boolean): void;
|
|
142
165
|
/** `null`: the upload failed and the product has told the user. */
|
|
143
166
|
onUpload?(file: File): Promise<ChatUpload | null>;
|