@llmnative/agentico 0.11.0 → 0.12.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.
@@ -40,15 +40,40 @@ export interface EntityChatSnapshot {
40
40
  name?: string;
41
41
  /** Who wrote `name`: a title of the person is never replaced by one of the model. */
42
42
  namedBy?: 'model' | 'person';
43
+ /** CR-013: when it last changed (a save, a rename): of two copies, the later one wins. */
44
+ changedAt?: number;
45
+ /** CR-013: the backend of the host has had it (kept in this browser only, never sent). */
46
+ synced?: boolean;
43
47
  /** Etichetta human-friendly dell'entità (es. il nome del tema) — usata dallo storico chat
44
48
  * di Agentico (vedi Agentico.tsx) per mostrare "cosa" senza dover rileggere l'entità stessa
45
49
  * dal suo DataProviderAdapter (che questo store, domain-side, non possiede). */
46
50
  title: string;
47
51
  }
48
- /** Sets the localStorage key of the chat store — call once at startup, before any read. */
52
+ /**
53
+ * CR-013: where the host keeps the chats besides this browser (its server): the other people of the scope
54
+ * see them, and they survive a change of browser. Calls are made in the background; a failure leaves the
55
+ * local copy as it is, sent again by the next sync.
56
+ */
57
+ export interface EntityChatBackend {
58
+ /** Every chat of a scope the host keeps. */
59
+ load(scopeId: string): Promise<EntityChatSnapshot[]>;
60
+ save(snapshot: EntityChatSnapshot): Promise<void> | void;
61
+ /** A rejection keeps the chat there (e.g. the host does not let go a chat that gave work): it comes back with the next sync. */
62
+ remove(scopeId: string, subagentId: string, entityId: string): Promise<void> | void;
63
+ }
64
+ /** Sets the localStorage key of the chat store, and the backend of the host (CR-013) — call once at startup, before any read. */
49
65
  export declare function configureEntityChatStore(options: {
50
66
  storageKey: string;
67
+ backend?: EntityChatBackend;
51
68
  }): void;
69
+ /** CR-013: whether the host keeps the chats too. */
70
+ export declare const hasEntityChatBackend: () => boolean;
71
+ /**
72
+ * CR-013: the chats of a scope as the backend has them: a copy there newer than the one here replaces it; a
73
+ * chat that was there and is gone is removed here; a chat never sent is sent (those of this browser from
74
+ * before the backend). Nothing without a backend.
75
+ */
76
+ export declare function syncEntityChats(scopeId: string): Promise<void>;
52
77
  /** CR-011: called when a chat is saved, renamed or removed (e.g. a list of the host reads them again). */
53
78
  export declare function onEntityChatsChange(listener: () => void): () => void;
54
79
  /** La chat attualmente associata a un'entità — `null` se non ne è mai stata salvata una (o è
@@ -15,7 +15,7 @@ export { extractJsonBlock } from './domain/extractJsonBlock';
15
15
  export type { ResultDestination, DestinationContext, ResultDestinationOutcome } from './domain/resultDestination';
16
16
  export { jsonExportDestination, JSON_EXPORT_DESTINATION_ID } from './domain/jsonExportDestination';
17
17
  export { registerDestinations, getDestinationRegistry } from './domain/destinationRegistry';
18
- export { configureEntityChatStore, saveEntityChat, chatStartedAt, chatTitle, chatHasPersonMessage, renameEntityChat, onEntityChatsChange, getEntityChat, listEntityChats, removeEntityChat, entityChatTaskId, type EntityChatSnapshot, } from './domain/entityChatStore';
18
+ export { configureEntityChatStore, saveEntityChat, chatStartedAt, chatTitle, chatHasPersonMessage, renameEntityChat, onEntityChatsChange, syncEntityChats, hasEntityChatBackend, type EntityChatBackend, getEntityChat, listEntityChats, removeEntityChat, entityChatTaskId, type EntityChatSnapshot, } from './domain/entityChatStore';
19
19
  export { agenticoTranslations, agenticoEn, agenticoIt, agenticoDe, useAgenticoI18n, type AgenticoDict } from './i18n';
20
20
  export { Agentico, AGENTICO_WIDTH, type AgenticoProps } from './presentation/Agentico';
21
21
  export { AGENTICO_MIN_WIDTH, AGENTICO_MAX_WIDTH, AGENTICO_WIDTH_STORAGE_KEY, type AgenticoPanelSize } from './presentation/panelWidth';
package/llms.txt CHANGED
@@ -45,6 +45,7 @@ buildContext (always runs) · buildPrompt · buildFollowUpPrompt · parseRespons
45
45
  `executor.turn({ params, context, text, first, signal, model?, onText(whole reply so far), onStep({ id, label, status }) }) → { text, result? }`; `executor.models(params)` / `defaultModel(params)` put the models of the executor in the composer: the turns go to the host instead of the AI provider; `text` is what the person typed (opening message on the first turn). The conversation is `remote: true`: no attachments, no fallback; the picker shows `remoteModels`.
46
46
  CR-009: `executor.alongside: true` keeps the agent on the AI catalog (prompts, tools, approvals): only the turns whose model is one of `executor.models` go to `executor.turn` (`first` on its first one); the picker shows the executor's models (`{ label, value, group?, groupBadge?: { label, variant? } }`) then the catalog's, grouped by `executor.catalogGroup(provider, label) → { group, badge? }`; `useAgent` gives `alongside`, `catalogGroup`.
47
47
  CR-010: `executor.catalogProviders(params) → string[] | undefined` limits the AI catalog of a chat to those providers (composer and turns; a model of another provider is never used: the executor's first model, else the first allowed one). A saved chat keeps `startedAt` (first save; `chatStartedAt(snapshot)` falls back to `savedAt`); `listEntityChats` lists the last started first and the history shows the start.
48
+ 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.
48
49
  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).
49
50
  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.
50
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmnative/agentico",
3
- "version": "0.11.0",
3
+ "version": "0.12.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",