@llmnative/react 1.46.0 → 1.47.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/dist/index.css +1 -1
- package/dist/index.js +13 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +609 -482
- package/dist/index.mjs.map +1 -1
- package/dist/types/src/I18n.d.ts +10 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/widgets/chat/ChatActivity.d.ts +51 -0
- package/llms-full.txt +15 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
package/dist/types/src/I18n.d.ts
CHANGED
|
@@ -355,6 +355,16 @@ export interface I18nDict {
|
|
|
355
355
|
submit: string;
|
|
356
356
|
noAnswer: string;
|
|
357
357
|
answered: string;
|
|
358
|
+
/** CR-123 — ChatActivity: the work of an agent (`{count}` in activityCount, activityFailed, activityFiles). */
|
|
359
|
+
activityCount: string;
|
|
360
|
+
activityFailed: string;
|
|
361
|
+
activityCommands: string;
|
|
362
|
+
activityHide: string;
|
|
363
|
+
activityLog: string;
|
|
364
|
+
activitySteps: string;
|
|
365
|
+
activityFiles: string;
|
|
366
|
+
activityChanges: string;
|
|
367
|
+
activityEmpty: string;
|
|
358
368
|
};
|
|
359
369
|
/** CR-112 — the charts: empty state, totals, the scale of the heatmaps, the data table. */
|
|
360
370
|
charts: {
|
|
@@ -83,6 +83,8 @@ export { default as ChatReasoning } from './widgets/chat/ChatReasoning';
|
|
|
83
83
|
export type { ChatReasoningProps, ChatReasoningClassNames } from './widgets/chat/ChatReasoning';
|
|
84
84
|
export { default as ChatQuestions } from './widgets/chat/ChatQuestions';
|
|
85
85
|
export type { ChatQuestion, ChatQuestionOption, ChatQuestionAnswer, ChatQuestionsNumbering, ChatQuestionsProps, ChatQuestionsClassNames } from './widgets/chat/ChatQuestions';
|
|
86
|
+
export { default as ChatActivity } from './widgets/chat/ChatActivity';
|
|
87
|
+
export type { ChatActivityItem, ChatActivitySteps, ChatActivityProps, ChatActivityClassNames } from './widgets/chat/ChatActivity';
|
|
86
88
|
export { repairStreamingMarkdown } from '../libs/streamingMarkdown';
|
|
87
89
|
export { default as TabDynamic } from './widgets/TabDynamic';
|
|
88
90
|
export { default as Component } from './Component';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** One group of steps of an agent: what it did, how many times, what it touched; the lines under it on request. */
|
|
3
|
+
export interface ChatActivitySteps {
|
|
4
|
+
type: 'steps';
|
|
5
|
+
/** Icon name of the icon provider. Default `terminal`. */
|
|
6
|
+
icon?: string;
|
|
7
|
+
/** What the agent did, in a few words ("Reads files", "Runs the tests"). */
|
|
8
|
+
label: string;
|
|
9
|
+
/** How many steps the group has: shown from 2 on. */
|
|
10
|
+
count?: number;
|
|
11
|
+
/** Short details next to the label: the queries, the files, the commands. The first four, the rest on hover. */
|
|
12
|
+
detail?: readonly string[];
|
|
13
|
+
/** How many steps of the group failed: a warning badge. */
|
|
14
|
+
failed?: number;
|
|
15
|
+
/** The lines under the group (its commands, their errors), shown in a block opened by its button. */
|
|
16
|
+
lines?: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
/** An item of the work of an agent: a group of steps, its own words (Markdown), or how it ended. */
|
|
19
|
+
export type ChatActivityItem = ChatActivitySteps | {
|
|
20
|
+
type: 'text';
|
|
21
|
+
text: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'end';
|
|
24
|
+
ok: boolean;
|
|
25
|
+
text: string;
|
|
26
|
+
};
|
|
27
|
+
/** Classes for the parts of a `ChatActivity`, added to the defaults. */
|
|
28
|
+
export interface ChatActivityClassNames {
|
|
29
|
+
root?: string;
|
|
30
|
+
step?: string;
|
|
31
|
+
text?: string;
|
|
32
|
+
files?: string;
|
|
33
|
+
log?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ChatActivityProps {
|
|
36
|
+
items: readonly ChatActivityItem[];
|
|
37
|
+
/** The files the agent changed: listed at the end. */
|
|
38
|
+
files?: readonly string[];
|
|
39
|
+
/** Opens the changes of the files (a diff, a page of the repository): its button next to the list. */
|
|
40
|
+
onShowChanges?: () => void;
|
|
41
|
+
/** The whole raw log: with it, a switch to read it and back. */
|
|
42
|
+
log?: readonly string[];
|
|
43
|
+
className?: string;
|
|
44
|
+
classNames?: ChatActivityClassNames;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* CR-123 — The work of an agent in a chat, as AI assistants show it: what it did, grouped (an icon, a label, how many
|
|
48
|
+
* steps, the queries or the files), its commands on request, its own words in between, how it ended, the files it
|
|
49
|
+
* changed with their changes on request; the whole raw log one click away. The consumer maps its own log to the items.
|
|
50
|
+
*/
|
|
51
|
+
export default function ChatActivity({ items, files, onShowChanges, log, className, classNames }: ChatActivityProps): React.JSX.Element;
|
package/llms-full.txt
CHANGED
|
@@ -1078,7 +1078,7 @@ moveItem(['a', 'b', 'c'], 0, 2) // ['b', 'c', 'a']
|
|
|
1078
1078
|
/>
|
|
1079
1079
|
```
|
|
1080
1080
|
|
|
1081
|
-
### Messaggi di chat: ChatMarkdown, ChatReasoning, ChatQuestions (CR-109)
|
|
1081
|
+
### Messaggi di chat: ChatMarkdown, ChatReasoning, ChatQuestions (CR-109), ChatActivity (CR-123)
|
|
1082
1082
|
|
|
1083
1083
|
Parti di un messaggio di un modello, da comporre nel proprio thread (anche accanto a `Chatbot`).
|
|
1084
1084
|
|
|
@@ -1122,6 +1122,20 @@ Parti di un messaggio di un modello, da comporre nel proprio thread (anche accan
|
|
|
1122
1122
|
// Scelta singola: il click sceglie e passa alla domanda dopo. onSubmit che rifiuta lascia il form.
|
|
1123
1123
|
// answers={[…]} mostra un insieme già risposto (sola lettura); disabled, autoFocus, submitLabel,
|
|
1124
1124
|
// classNames={{ root, tabs, tab, panel, question, option, optionSelected, footer, summary }}
|
|
1125
|
+
|
|
1126
|
+
// Il lavoro di un agente (CR-123), come negli assistenti AI: gruppi di passi (icona, label, quanti,
|
|
1127
|
+
// dettagli brevi: query, file, comandi; quanti falliti) con le righe sotto aperte da "Comandi";
|
|
1128
|
+
// le parole dell'agente in Markdown; come è finito; i file cambiati con "Vedi le modifiche";
|
|
1129
|
+
// il registro grezzo a un clic. Il consumer traduce il suo log negli item.
|
|
1130
|
+
<ChatActivity
|
|
1131
|
+
items={[
|
|
1132
|
+
{ type: 'steps', icon: 'search', label: 'Esplora il repository', count: 3, detail: ['git status'], lines: ['git status --short'] },
|
|
1133
|
+
{ type: 'text', text: 'Aggiungo il comando e il suo test.' },
|
|
1134
|
+
{ type: 'end', ok: true, text: 'success · 9 steps' },
|
|
1135
|
+
]}
|
|
1136
|
+
files={['functions/src/catalog/index.js']} onShowChanges={() => openDiff()} log={rawLines}
|
|
1137
|
+
/>
|
|
1138
|
+
// className, classNames={{ root, step, text, files, log }}
|
|
1125
1139
|
```
|
|
1126
1140
|
|
|
1127
1141
|
### ImageEditor
|
package/llms.txt
CHANGED
|
@@ -66,7 +66,7 @@ import '@llmnative/react/dist/index.css' // necessario una volta sola
|
|
|
66
66
|
ui/ → primitivi stateless: Alert, Badge, Button, Card, DescriptionList, Image, Modal, Table, Gallery, Tab, Repeat, Icon, LocaleSwitcher, ThemeSwitcher, ProviderSwitcher, LayoutBuilder, ContextMenu
|
|
67
67
|
ui/fields/ → campi form: Input, Select, UploadImage, UploadDocument, UploadCSV, CodeEditor, ImageField, RichText, Prompt, Crop, ContextMenu
|
|
68
68
|
blocks/ → composizioni: Menu, Breadcrumbs, Notifications, Search, Carousel, Dropdown, Toolbar, SideNav, ListCard, AuthButton
|
|
69
|
-
widgets/ → smart (hanno stato e provider): Grid, Form, MarkdownReader, ImageEditor, TabDynamic, Chatbot, ChatMarkdown, ChatReasoning, ChatQuestions
|
|
69
|
+
widgets/ → smart (hanno stato e provider): Grid, Form, MarkdownReader, ImageEditor, TabDynamic, Chatbot, ChatMarkdown, ChatReasoning, ChatQuestions, ChatActivity
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
Tutti gli import da `'@llmnative/react'` — mai da sottodirectory.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llmnative/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"description": "LLM-native React framework for deterministic UI generation. Data-driven by default, schema-driven optional. Ultra-low token consumption — built for AI agents, not just humans.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|