@llmnative/agentico 0.17.2 → 0.18.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/README.md +1 -0
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1125 -929
- package/dist/index.mjs.map +1 -1
- package/dist/types/domain/entityChatStore.d.ts +2 -0
- package/dist/types/domain/threadEvents.d.ts +32 -0
- package/dist/types/i18n/types.d.ts +8 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/presentation/AgentActivityLog.d.ts +9 -5
- package/dist/types/presentation/AgenticoContext.d.ts +7 -1
- package/dist/types/presentation/EarlierSessions.d.ts +3 -1
- package/dist/types/presentation/ThreadEvents.d.ts +12 -0
- package/dist/types/presentation/useAgent.d.ts +2 -0
- package/llms.txt +1 -0
- package/package.json +1 -1
|
@@ -16,6 +16,8 @@ export interface EntityChatActivityEntry {
|
|
|
16
16
|
retry?: boolean;
|
|
17
17
|
/** CR-018: who wrote this message of the person (AgenticoProvider `person`). */
|
|
18
18
|
author?: ChatAuthor;
|
|
19
|
+
/** CR-019: when it was born (ms). Absent on entries saved before 0.18.0. */
|
|
20
|
+
at?: number;
|
|
19
21
|
/** CR-016: the length of the history of the model when this message of the person was sent. */
|
|
20
22
|
historyAt?: number;
|
|
21
23
|
/** The message in parts (CR-004): saved and reloaded as they are. Absent in chats saved before
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ChatAuthor } from './entityChatStore';
|
|
2
|
+
/** Something that happened in the chat of a `thread` (SubagentManifest.thread), told by the host. */
|
|
3
|
+
export interface ThreadEvent {
|
|
4
|
+
/** Stable: the same event read again has the same id. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** When it happened (ms). */
|
|
7
|
+
at: number;
|
|
8
|
+
/** Who did it: an agent, a person. */
|
|
9
|
+
author: ChatAuthor;
|
|
10
|
+
/** One line: what happened. */
|
|
11
|
+
title: string;
|
|
12
|
+
/** Markdown, short: what it said (shown when the card is opened). */
|
|
13
|
+
body?: string;
|
|
14
|
+
badge?: {
|
|
15
|
+
label: string;
|
|
16
|
+
variant?: 'info' | 'light' | 'success' | 'warning' | 'danger';
|
|
17
|
+
};
|
|
18
|
+
/** Where to read it whole (opened in a new tab). */
|
|
19
|
+
href?: string;
|
|
20
|
+
/** Framework icon of what it was (default: none). */
|
|
21
|
+
icon?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Where the panel reads the events of a chat (`<AgenticoProvider threadEvents>`). */
|
|
24
|
+
export interface ThreadEventsSource {
|
|
25
|
+
/** The events of `thread` from `from` (inclusive) to `to` (exclusive, Infinity = up to now). */
|
|
26
|
+
load(thread: string, from: number, to: number): ThreadEvent[] | Promise<ThreadEvent[]>;
|
|
27
|
+
/** Called when the events of `thread` may have changed: the panel reads them again. Returns the unsubscribe. */
|
|
28
|
+
subscribe?(thread: string, onChange: () => void): () => void;
|
|
29
|
+
}
|
|
30
|
+
/** Each of the events among the turns of a log, by time: before the turn it came before. Turns without a time
|
|
31
|
+
* take the one of the turn before them; events after the last turn go at the end (index = turns). */
|
|
32
|
+
export declare function placeEvents(turnTimes: ReadonlyArray<number | undefined>, events: readonly ThreadEvent[]): ThreadEvent[][];
|
|
@@ -60,6 +60,14 @@ export interface AgenticoDict {
|
|
|
60
60
|
continueSession: string;
|
|
61
61
|
/** CR-018: the separator of an earlier session without a title; `{at}` its start. */
|
|
62
62
|
sessionOf: string;
|
|
63
|
+
/** CR-019: opens and closes what an event of the host said. */
|
|
64
|
+
eventMore: string;
|
|
65
|
+
eventLess: string;
|
|
66
|
+
/** CR-019: opens the event where the host keeps it. */
|
|
67
|
+
eventOpen: string;
|
|
68
|
+
/** CR-019: the filter in the header: show the events of the host, or the conversation only. */
|
|
69
|
+
showEvents: string;
|
|
70
|
+
hideEvents: string;
|
|
63
71
|
/** CR-011: renaming a saved chat. */
|
|
64
72
|
/** CR-014: the whole text of a card, and closing it. */
|
|
65
73
|
cardView: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { jsonExportDestination, JSON_EXPORT_DESTINATION_ID } from './domain/json
|
|
|
17
17
|
export { registerDestinations, getDestinationRegistry } from './domain/destinationRegistry';
|
|
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
|
+
export { placeEvents, type ThreadEvent, type ThreadEventsSource } from './domain/threadEvents';
|
|
20
21
|
export { agenticoTranslations, agenticoEn, agenticoIt, agenticoDe, useAgenticoI18n, type AgenticoDict } from './i18n';
|
|
21
22
|
export { Agentico, AGENTICO_WIDTH, type AgenticoProps } from './presentation/Agentico';
|
|
22
23
|
export { AGENTICO_MIN_WIDTH, AGENTICO_MAX_WIDTH, AGENTICO_WIDTH_STORAGE_KEY, type AgenticoPanelSize } from './presentation/panelWidth';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { ChatAuthor } from '../domain/entityChatStore';
|
|
3
|
+
import { type ThreadEvent } from '../domain/threadEvents';
|
|
2
4
|
import type { AgentActivityEntry } from './useAgent';
|
|
3
5
|
import type { AgentCardPart, AgentQuestionAnswer, AgentQuestionsPart } from '../domain/messageParts';
|
|
4
6
|
/** Bolla utente — collassabile SOLO se il testo eccede l'altezza di soglia (misurato via ref,
|
|
@@ -27,7 +29,7 @@ export interface UserMessageActions {
|
|
|
27
29
|
export declare function ChatAvatar({ author, size }: {
|
|
28
30
|
author: ChatAuthor;
|
|
29
31
|
size?: number;
|
|
30
|
-
}):
|
|
32
|
+
}): React.JSX.Element;
|
|
31
33
|
/** What the log needs to let the person answer questions (CR-004): the entries of the live
|
|
32
34
|
* conversation (`canAnswer`) and where the answers go. Without it, unanswered questions are shown
|
|
33
35
|
* disabled. */
|
|
@@ -45,7 +47,7 @@ export declare function CardPart({ entry, part, questions }: {
|
|
|
45
47
|
entry: AgentActivityEntry;
|
|
46
48
|
part: AgentCardPart;
|
|
47
49
|
questions?: AgentActivityLogQuestions;
|
|
48
|
-
}):
|
|
50
|
+
}): React.JSX.Element;
|
|
49
51
|
/** The questions part shown docked at the bottom of the panel instead of in the thread (CR-005). */
|
|
50
52
|
export interface DockedQuestions {
|
|
51
53
|
entry: AgentActivityEntry;
|
|
@@ -64,7 +66,7 @@ export declare function QuestionsPart({ entry, part, questions, autoFocus, class
|
|
|
64
66
|
questions?: AgentActivityLogQuestions;
|
|
65
67
|
autoFocus?: boolean;
|
|
66
68
|
className?: string;
|
|
67
|
-
}):
|
|
69
|
+
}): React.JSX.Element;
|
|
68
70
|
/** Il log di attività di un agente, usato dal pannello globale (Agentico) — ogni agente ora
|
|
69
71
|
* ci passa attraverso, il pannello embedded legacy (AgentFollowUp) è stato ritirato una volta
|
|
70
72
|
* migrato anche l'ultimo consumer (import HTML/JSX, vedi ComponentEditPage.tsx). Un solo posto
|
|
@@ -73,7 +75,7 @@ export declare function QuestionsPart({ entry, part, questions, autoFocus, class
|
|
|
73
75
|
* One `<li>` per turn (CR-004): the message of the person, sticky at the top while its turn
|
|
74
76
|
* scrolls, then what the agent did and said. Entries before the first message of the person
|
|
75
77
|
* (an opening without text) form a turn of their own, without a bubble. */
|
|
76
|
-
export declare function AgentActivityLog({ activity, questions, docked, pinUserMessages, messageActions, speaker, showAuthors }: {
|
|
78
|
+
export declare function AgentActivityLog({ activity, questions, docked, pinUserMessages, messageActions, speaker, showAuthors, events }: {
|
|
77
79
|
activity: AgentActivityEntry[];
|
|
78
80
|
/** CR-018: who answers, shown at the start of each turn of the agent. */
|
|
79
81
|
speaker?: ChatAuthor;
|
|
@@ -88,4 +90,6 @@ export declare function AgentActivityLog({ activity, questions, docked, pinUserM
|
|
|
88
90
|
/** The message of the person sticks at the top while its turn scrolls (default). Off while
|
|
89
91
|
* questions are docked, so the thread has more room. */
|
|
90
92
|
pinUserMessages?: boolean;
|
|
91
|
-
|
|
93
|
+
/** CR-019: what happened around this chat, placed among its turns by time. */
|
|
94
|
+
events?: readonly ThreadEvent[];
|
|
95
|
+
}): React.JSX.Element | null;
|
|
@@ -4,6 +4,7 @@ import type { AgentActivityEntry, AgentConversation } from './useAgent';
|
|
|
4
4
|
import type { ResultDestination } from '../domain/resultDestination';
|
|
5
5
|
import type { SubagentUsageCard } from '../domain/subagentUsageCard';
|
|
6
6
|
import { type ChatAuthor, type EntityChatSnapshot } from '../domain/entityChatStore';
|
|
7
|
+
import type { ThreadEventsSource } from '../domain/threadEvents';
|
|
7
8
|
/** Where results are saved and chats are kept: the host's current tenant, company, workspace…
|
|
8
9
|
* `null` while the host has none selected — destinations then refuse to save. */
|
|
9
10
|
export interface AgenticoScope {
|
|
@@ -150,6 +151,8 @@ interface AgenticoContextValue {
|
|
|
150
151
|
scope: AgenticoScope | null;
|
|
151
152
|
/** CR-018: the person using the panel (<AgenticoProvider person>): the author of their messages. */
|
|
152
153
|
person: ChatAuthor | null;
|
|
154
|
+
/** CR-019: where the panel reads what happened around a chat (<AgenticoProvider threadEvents>). */
|
|
155
|
+
threadEvents: ThreadEventsSource | null;
|
|
153
156
|
task: AgenticoTask | null;
|
|
154
157
|
/** Visibilità del pannello — completamente indipendente dal task (vedi AgenticoToggle:
|
|
155
158
|
* icona persistente stile "estensione del browser"). Nessuna chiamata a `openTask` la forza
|
|
@@ -327,11 +330,14 @@ interface AgenticoContextValue {
|
|
|
327
330
|
/** Changes at every startSubagent() — React `key` of that SubagentRunner. */
|
|
328
331
|
startRunId: string | null;
|
|
329
332
|
}
|
|
330
|
-
export declare function AgenticoProvider({ children, scope, person }: {
|
|
333
|
+
export declare function AgenticoProvider({ children, scope, person, threadEvents }: {
|
|
331
334
|
children: React.ReactNode;
|
|
332
335
|
scope?: AgenticoScope | null;
|
|
333
336
|
/** CR-018: who uses the panel: their messages carry their name and picture, kept with the chat. */
|
|
334
337
|
person?: ChatAuthor | null;
|
|
338
|
+
/** CR-019: what happened around a chat with a `thread` (the work of other agents…), shown among its messages
|
|
339
|
+
* in order of time, each with who did it. The model never reads it. Keep it stable (memoized). */
|
|
340
|
+
threadEvents?: ThreadEventsSource | null;
|
|
335
341
|
}): React.JSX.Element;
|
|
336
342
|
export declare function useAgentico(): AgenticoContextValue;
|
|
337
343
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type EntityChatSnapshot } from '../domain/entityChatStore';
|
|
3
|
-
export declare function EarlierSessions({ scopeId, thread, taskId, scrollRef, onLoad, onContinue, busy }: {
|
|
3
|
+
export declare function EarlierSessions({ scopeId, thread, taskId, scrollRef, onLoad, onContinue, busy, showEvents }: {
|
|
4
4
|
scopeId: string;
|
|
5
5
|
/** The chat the open one is a session of. */
|
|
6
6
|
thread: string;
|
|
@@ -14,4 +14,6 @@ export declare function EarlierSessions({ scopeId, thread, taskId, scrollRef, on
|
|
|
14
14
|
onContinue: (chat: EntityChatSnapshot) => void;
|
|
15
15
|
/** A turn of the open session runs: it is not left meanwhile. */
|
|
16
16
|
busy?: boolean;
|
|
17
|
+
/** CR-019: the events of the host among the messages (the filter of the header). */
|
|
18
|
+
showEvents?: boolean;
|
|
17
19
|
}): React.JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ThreadEvent } from '../domain/threadEvents';
|
|
3
|
+
/** Where the person's choice to see the events or not is kept (this browser only). */
|
|
4
|
+
export declare const THREAD_EVENTS_STORAGE_KEY = "llmnative.agentico.threadEvents";
|
|
5
|
+
/** Whether the events are shown (the filter in the header of the panel): on unless the person turned them off. */
|
|
6
|
+
export declare function useShowThreadEvents(): [boolean, (show: boolean) => void];
|
|
7
|
+
/** The events of `thread` from `from` to `to`, as the host has them; none without a source or a thread. */
|
|
8
|
+
export declare function useThreadEvents(thread: string | undefined, from: number, to: number, enabled?: boolean): ThreadEvent[];
|
|
9
|
+
/** One event: who did it in the column on the left, what happened next to their name, its time; opened, what it said. */
|
|
10
|
+
export declare function ThreadEventCard({ event }: {
|
|
11
|
+
event: ThreadEvent;
|
|
12
|
+
}): React.JSX.Element;
|
|
@@ -42,6 +42,8 @@ export interface AgentActivityEntry {
|
|
|
42
42
|
retry?: boolean;
|
|
43
43
|
/** CR-018: on a message of the person, who wrote it (the `author` of useAgent). */
|
|
44
44
|
author?: ChatAuthor;
|
|
45
|
+
/** CR-019: when it was born (ms). Absent on entries saved before 0.18.0. */
|
|
46
|
+
at?: number;
|
|
45
47
|
/** CR-016: on a message of the person, how many turns the history of the model had when it was sent:
|
|
46
48
|
* where the chat goes back to when the person retries or edits it. Absent on messages sent before
|
|
47
49
|
* 0.15.0 (no Retry from here on them). */
|
package/llms.txt
CHANGED
|
@@ -52,6 +52,7 @@ CR-014: cards in messages — part `{ type: 'card', id, title, badge?, body?, de
|
|
|
52
52
|
CR-013: `configureEntityChatStore({ storageKey, backend })` — `EntityChatBackend { load(scopeId), save(snapshot), remove(scopeId, subagentId, entityId) }`: the browser copy stays (sync reads), writes also go to the backend; `syncEntityChats(scopeId)` (AgenticoProvider on scope change) merges by `changedAt`, drops chats gone remotely, sends never-sent ones; a refused removal comes back.
|
|
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
|
+
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.
|
|
55
56
|
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.
|
|
56
57
|
|
|
57
58
|
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.
|
|
3
|
+
"version": "0.18.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",
|