@llmnative/agentico 0.18.0 → 0.19.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.
@@ -18,6 +18,11 @@ export interface EntityChatActivityEntry {
18
18
  author?: ChatAuthor;
19
19
  /** CR-019: when it was born (ms). Absent on entries saved before 0.18.0. */
20
20
  at?: number;
21
+ /** CR-020: on a message of the person, small previews (data URLs) of the images attached to it. */
22
+ attachmentPreviews?: Array<{
23
+ name: string;
24
+ src: string;
25
+ }>;
21
26
  /** CR-016: the length of the history of the model when this message of the person was sent. */
22
27
  historyAt?: number;
23
28
  /** The message in parts (CR-004): saved and reloaded as they are. Absent in chats saved before
@@ -19,6 +19,8 @@ export interface ThreadEvent {
19
19
  href?: string;
20
20
  /** Framework icon of what it was (default: none). */
21
21
  icon?: string;
22
+ /** CR-020: still going on (an agent at work on it): a spinner in place of its icon. */
23
+ running?: boolean;
22
24
  }
23
25
  /** Where the panel reads the events of a chat (`<AgenticoProvider threadEvents>`). */
24
26
  export interface ThreadEventsSource {
@@ -65,6 +65,8 @@ export interface AgenticoDict {
65
65
  eventLess: string;
66
66
  /** CR-019: opens the event where the host keeps it. */
67
67
  eventOpen: string;
68
+ /** CR-020: an event still going on (its spinner). */
69
+ eventRunning: string;
68
70
  /** CR-019: the filter in the header: show the events of the host, or the conversation only. */
69
71
  showEvents: string;
70
72
  hideEvents: string;
@@ -18,6 +18,7 @@ export { registerDestinations, getDestinationRegistry } from './domain/destinati
18
18
  export { configureEntityChatStore, saveEntityChat, chatStartedAt, chatTitle, chatHasPersonMessage, renameEntityChat, onEntityChatsChange, syncEntityChats, hasEntityChatBackend, type EntityChatBackend, getEntityChat, listEntityChats, removeEntityChat, entityChatTaskId, type EntityChatSnapshot, type ChatAuthor, } from './domain/entityChatStore';
19
19
  export { chatThreadOf, earlierSessions } from './domain/chatThread';
20
20
  export { placeEvents, type ThreadEvent, type ThreadEventsSource } from './domain/threadEvents';
21
+ export { imagePreviews, PREVIEW_MAX, PREVIEW_LIMIT, type AttachmentPreview } from './presentation/imagePreview';
21
22
  export { agenticoTranslations, agenticoEn, agenticoIt, agenticoDe, useAgenticoI18n, type AgenticoDict } from './i18n';
22
23
  export { Agentico, AGENTICO_WIDTH, type AgenticoProps } from './presentation/Agentico';
23
24
  export { AGENTICO_MIN_WIDTH, AGENTICO_MAX_WIDTH, AGENTICO_WIDTH_STORAGE_KEY, type AgenticoPanelSize } from './presentation/panelWidth';
@@ -0,0 +1,11 @@
1
+ /** The longest side of a preview, in px. */
2
+ export declare const PREVIEW_MAX = 480;
3
+ /** The previews of one message at most: the chat stays small. */
4
+ export declare const PREVIEW_LIMIT = 4;
5
+ /** A preview of an image attached to a message: its name and a data URL. */
6
+ export interface AttachmentPreview {
7
+ name: string;
8
+ src: string;
9
+ }
10
+ /** The previews of the images among `files` (the first PREVIEW_LIMIT), none where the browser cannot draw one. */
11
+ export declare function imagePreviews(files: readonly File[], max?: number, limit?: number): Promise<AttachmentPreview[]>;
@@ -2,6 +2,7 @@ import type { AIConversationTurn, AIModelDescriptor } from '@llmnative/react';
2
2
  import type { AgentDefinition, AgentExecutorModel, AgentModelGroupBadge } from '../domain/agentDefinition';
3
3
  import { type AgentMessagePart, type AgentQuestionAnswer } from '../domain/messageParts';
4
4
  import type { ChatAuthor } from '../domain/entityChatStore';
5
+ import { type AttachmentPreview } from './imagePreview';
5
6
  /** Una voce del log di attività — o un messaggio dell'utente (il testo di sendMessage(),
6
7
  * mostrato subito com'è, mai "sto pensando" perché non è il modello a scriverlo), o una tool
7
8
  * call (etichetta SEMPRE deterministica/locale, vedi AgentTool.describeInvocation: mai testo
@@ -44,6 +45,8 @@ export interface AgentActivityEntry {
44
45
  author?: ChatAuthor;
45
46
  /** CR-019: when it was born (ms). Absent on entries saved before 0.18.0. */
46
47
  at?: number;
48
+ /** CR-020: on a message of the person, small previews of the images attached to it, kept with the chat. */
49
+ attachmentPreviews?: AttachmentPreview[];
47
50
  /** CR-016: on a message of the person, how many turns the history of the model had when it was sent:
48
51
  * where the chat goes back to when the person retries or edits it. Absent on messages sent before
49
52
  * 0.15.0 (no Retry from here on them). */
package/llms.txt CHANGED
@@ -53,6 +53,7 @@ CR-013: `configureEntityChatStore({ storageKey, backend })` — `EntityChatBacke
53
53
  CR-012: `executor.catalogReasoning(params, provider) → 'low' | 'medium' | 'high' | 'max' | undefined`: the turns of the chat on that provider of the catalog send `reasoning` on each request (@llmnative/react 1.46 maps it per provider).
54
54
  CR-018: `SubagentManifest.thread(params)` makes the saved chats of the scope with the same key sessions of one chat: the panel shows the earlier ones above the open one, read-only (no questions, Retry or Edit), one more each time the person scrolls to the top or presses "Earlier session", each opened by a separator (title, start, "Continue this session" resumes it) and "This session" above the open one; the model reads only the open session. `SubagentManifest.speaker(params)` → `{ name, avatarUrl? }` puts the picture of the agent in a column on the left, its name next to it with a closed summary of the reasoning and steps before its text ("Reasoned for 4 s · 1 step", opened with a click), the text under them; `<AgenticoProvider person={{ name, avatarUrl? }}>` writes `author` on each message of the person (kept in the snapshot): their picture in the same column, Edit and Retry under it, the name above the full-width message; without a picture an `Identicon` of the name. `chatThreadOf(snapshot)`, `earlierSessions(scopeId, thread, openTaskId)`.
55
55
  CR-019: `<AgenticoProvider threadEvents={source}>` (keep it memoized): `source.load(thread, from, to)` → `ThreadEvent[]` (`id`, `at` ms, `author` ChatAuthor, `title`, optional `body` Markdown, `badge`, `href`, `icon`), optional `source.subscribe(thread, onChange)` → unsubscribe. In a chat with a `thread` the panel shows them among the turns by time (`placeEvents`), as compact cards with the author's picture in the left column (opened: the body; a link to `href`); the open session from the last message of the session before it, each earlier one up to its last message. Header filter "Conversation only" (kept in this browser, `llmnative.agentico.threadEvents`). The model never reads them. Every entry of a chat now keeps `at` (when it was born); entries saved before 0.18.0 have none.
56
+ CR-020: the images attached to a message of the person stay in sight as previews (`entry.attachmentPreviews`: JPEG data URLs of at most 480 px a side, the first 4 images, drawn in the browser by `imagePreviews(files)` and kept with the chat); a click opens one larger; files without a preview stay as their names. `ThreadEvent.running: true` shows a spinner in place of its icon (an agent still at work on it).
56
57
  CR-011: `SubagentManifest.autoTitle: true` gives its saved chats a title from the model (after a turn; once per session for older ones; a model of the catalog the chat may use), drops conversational chats where the person never wrote; `snapshot.name`/`namedBy`, `chatTitle(snapshot)`, `renameEntityChat(scopeId, subagentId, entityId, title, 'person' | 'model')` (the person's wins; empty resets), `onEntityChatsChange(listener)`; the history has Rename.
57
58
 
58
59
  Message parts (0.3.0): the turn also has `onText(text, { id?, done? })` (without id: the one reply, kept below steps and reasoning; with id: a text part of its own), `onReasoning(text, { id?, done?, duration? })` (whole text so far; shown closed, "Reasoned for N s", duration measured if not given), `onQuestions(questions, { id? }) → Promise<answers>` (questions `{ id?, header?, question, options?: [{ label, description? }], multiple?, recommended?, custom? }`; answers `[{ id?, header?, values: string[] }]`). Answers given while the turn runs resolve that promise; given later (or after a reload) they start a new turn with `text: ''` and `answers: { id, answers }` (id = the questions part id, default `questions-N`). Parts are kept in `AgentActivityEntry.parts` (`text` | `reasoning` | `tool` | `questions`, `detail` = the text) and saved with the chat; old chats without parts show `detail`. Rendered with `ChatMarkdown`, `ChatReasoning`, steps grouped in a `Tree`, `ChatQuestions` (needs `@llmnative/react` 1.34). `useAgent().answerQuestions(entryId, partId, answers)`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmnative/agentico",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "description": "Agentic chat orchestrator for @llmnative/react apps: a persistent panel that talks with the user and hands the work to host-registered subagents.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",