@llmnative/agentico 0.2.0 → 0.3.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 +83 -82
- package/dist/index.js +13 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +899 -716
- package/dist/index.mjs.map +1 -1
- package/dist/types/domain/agentDefinition.d.ts +34 -3
- package/dist/types/domain/entityChatStore.d.ts +5 -0
- package/dist/types/domain/messageParts.d.ts +79 -0
- package/dist/types/i18n/types.d.ts +6 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/presentation/AgentActivityLog.d.ts +16 -4
- package/dist/types/presentation/useAgent.d.ts +12 -1
- package/llms.txt +41 -39
- package/package.json +79 -79
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
import type { AIAttachment } from '@llmnative/react';
|
|
3
|
+
import type { AgentQuestion, AgentQuestionAnswer, AgentQuestionsAnswers } from './messageParts';
|
|
3
4
|
/** Rif mutabile, sempre aggiornato da useAgent.ts all'inizio di ogni turno (roundTrip 0) con
|
|
4
5
|
* gli allegati grezzi (base64) di QUESTO turno — mai un valore statico catturato una volta:
|
|
5
6
|
* un tool creato da getTools() (chiamato una sola volta per sessione) deve comunque vedere gli
|
|
@@ -108,10 +109,40 @@ export interface AgentExecutorTurn<TParams, TContext> {
|
|
|
108
109
|
signal: AbortSignal;
|
|
109
110
|
/** The model the person picked among `AgentExecutor.models`, if the executor offers any. */
|
|
110
111
|
model?: string;
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
/** Present when the person answered questions of an earlier turn (CR-004): the turn carries
|
|
113
|
+
* them, structured, with `text` empty. The executor decides how to forward them (e.g. to the
|
|
114
|
+
* `question` tool of its session). Questions answered while their own turn is still running
|
|
115
|
+
* resolve the promise of `onQuestions` instead. */
|
|
116
|
+
answers?: AgentQuestionsAnswers;
|
|
117
|
+
/** The reply so far, whole (not a delta): shown as it grows, as Markdown. Without `part.id` it
|
|
118
|
+
* is the one reply of the turn (CR-003), kept below the steps and the reasoning; with an id it is
|
|
119
|
+
* a text part of its own, in the order it first arrived (CR-004). `part.done` ends its streaming. */
|
|
120
|
+
onText(text: string, part?: AgentExecutorPartOptions): void;
|
|
121
|
+
/** The reasoning of the model so far, whole (not a delta), as Markdown: shown closed behind
|
|
122
|
+
* "Reasoned for 12 s" (CR-004). Without `part.id` it is one reasoning part per turn. It ends with
|
|
123
|
+
* `part.done`, when another kind of part arrives, or with the turn; `part.duration` (seconds)
|
|
124
|
+
* replaces the time Agentico measures. */
|
|
125
|
+
onReasoning(text: string, part?: AgentExecutorPartOptions & {
|
|
126
|
+
duration?: number;
|
|
127
|
+
}): void;
|
|
128
|
+
/** A step of the agent: added the first time its id is seen, updated after. Consecutive steps
|
|
129
|
+
* are shown as one collapsible group. */
|
|
114
130
|
onStep(step: AgentExecutorStep): void;
|
|
131
|
+
/** Questions to the person, answered with a click (CR-004). The promise resolves with the
|
|
132
|
+
* answers if they come while this turn is still running (e.g. the session waits for them);
|
|
133
|
+
* once the turn has ended (or the chat was reloaded), the answers arrive as a new turn with
|
|
134
|
+
* `answers` instead. It rejects when the person stops the turn. `part.id` names the set
|
|
135
|
+
* (default: made up by Agentico) and is the `answers.id` of that later turn. */
|
|
136
|
+
onQuestions(questions: AgentQuestion[], part?: {
|
|
137
|
+
id?: string;
|
|
138
|
+
}): Promise<AgentQuestionAnswer[]>;
|
|
139
|
+
}
|
|
140
|
+
/** Which part an `onText`/`onReasoning` call updates, and whether it is complete. */
|
|
141
|
+
export interface AgentExecutorPartOptions {
|
|
142
|
+
/** The part to update: created the first time it is seen. */
|
|
143
|
+
id?: string;
|
|
144
|
+
/** The part is complete: no longer streaming. */
|
|
145
|
+
done?: boolean;
|
|
115
146
|
}
|
|
116
147
|
/** The host side of a remote agent: one call per turn, resolved when its reply is complete. */
|
|
117
148
|
export interface AgentExecutor<TParams, TContext, TResult> {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AIConversationTurn } from '@llmnative/react';
|
|
2
|
+
import type { AgentMessagePart } from './messageParts';
|
|
2
3
|
/** Stessa forma di AgentActivityEntry (agentico/presentation/useAgent.ts) — ridefinita qui invece
|
|
3
4
|
* di importata: il domain layer non dipende dal presentation layer, e questi campi sono
|
|
4
5
|
* semplici dati (mai funzioni), quindi TypeScript accetta un AgentActivityEntry[] ovunque sia
|
|
@@ -10,6 +11,10 @@ export interface EntityChatActivityEntry {
|
|
|
10
11
|
status: 'running' | 'done' | 'error' | 'stopped';
|
|
11
12
|
detail?: string;
|
|
12
13
|
toolNames?: string[];
|
|
14
|
+
attachmentNames?: string[];
|
|
15
|
+
/** The message in parts (CR-004): saved and reloaded as they are. Absent in chats saved before
|
|
16
|
+
* 0.3.0, which show `detail` as before. */
|
|
17
|
+
parts?: AgentMessagePart[];
|
|
13
18
|
}
|
|
14
19
|
export interface EntityChatSnapshot {
|
|
15
20
|
/** Host scope (tenant, company…) the chat belongs to — see AgenticoScope. */
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** A choice of a question (the shape of the `question` tool of opencode and of MCP elicitation). */
|
|
2
|
+
export interface AgentQuestionOption {
|
|
3
|
+
/** What the answer says: it is the value returned when chosen. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** A line under the label. */
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A question of the agent to the person. */
|
|
9
|
+
export interface AgentQuestion {
|
|
10
|
+
/** Returned with the answer, to match it to the question. */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Short title: the label of its tab. */
|
|
13
|
+
header?: string;
|
|
14
|
+
question: string;
|
|
15
|
+
/** The choices. Without them the question takes a free-text answer. */
|
|
16
|
+
options?: AgentQuestionOption[];
|
|
17
|
+
/** More than one choice. */
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
/** The choice the agent recommends: its index (from 0) or its label. */
|
|
20
|
+
recommended?: number | string;
|
|
21
|
+
/** Offers "Other" with a free-text answer (default: yes). */
|
|
22
|
+
custom?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** The answer to one question: the chosen labels and/or the free text, in the order of the questions. */
|
|
25
|
+
export interface AgentQuestionAnswer {
|
|
26
|
+
id?: string;
|
|
27
|
+
header?: string;
|
|
28
|
+
values: string[];
|
|
29
|
+
}
|
|
30
|
+
/** The answers to a set of questions, as a turn gives them to the executor. `id` is the id of the
|
|
31
|
+
* questions part (the one given to `onQuestions`, or the one Agentico made up). */
|
|
32
|
+
export interface AgentQuestionsAnswers {
|
|
33
|
+
id: string;
|
|
34
|
+
answers: AgentQuestionAnswer[];
|
|
35
|
+
}
|
|
36
|
+
/** Text of the reply, as Markdown. `streaming` while it is still arriving. */
|
|
37
|
+
export interface AgentTextPart {
|
|
38
|
+
type: 'text';
|
|
39
|
+
id: string;
|
|
40
|
+
text: string;
|
|
41
|
+
streaming?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** The reasoning of the model, as Markdown, shown closed behind "Reasoned for 12 s". */
|
|
44
|
+
export interface AgentReasoningPart {
|
|
45
|
+
type: 'reasoning';
|
|
46
|
+
id: string;
|
|
47
|
+
text: string;
|
|
48
|
+
streaming?: boolean;
|
|
49
|
+
/** Seconds the model reasoned: given by the executor, or measured by Agentico. */
|
|
50
|
+
duration?: number;
|
|
51
|
+
}
|
|
52
|
+
/** A step of the agent (a tool it ran, a file it wrote). Consecutive steps are shown as one group. */
|
|
53
|
+
export interface AgentToolPart {
|
|
54
|
+
type: 'tool';
|
|
55
|
+
id: string;
|
|
56
|
+
label: string;
|
|
57
|
+
status: 'running' | 'done' | 'error' | 'stopped';
|
|
58
|
+
}
|
|
59
|
+
/** Questions to the person, answered with a click. `answers` once answered (shown read-only). */
|
|
60
|
+
export interface AgentQuestionsPart {
|
|
61
|
+
type: 'questions';
|
|
62
|
+
id: string;
|
|
63
|
+
questions: AgentQuestion[];
|
|
64
|
+
answers?: AgentQuestionAnswer[];
|
|
65
|
+
}
|
|
66
|
+
export type AgentMessagePart = AgentTextPart | AgentReasoningPart | AgentToolPart | AgentQuestionsPart;
|
|
67
|
+
/** The id of the text part of an executor that calls `onText` without an id (the reply of CR-003). */
|
|
68
|
+
export declare const DEFAULT_TEXT_PART_ID = "text";
|
|
69
|
+
/** The id of the reasoning part of an executor that calls `onReasoning` without an id. */
|
|
70
|
+
export declare const DEFAULT_REASONING_PART_ID = "reasoning";
|
|
71
|
+
/** Adds `part`, or replaces the part of the same type and id. A new step or reasoning goes above the
|
|
72
|
+
* default text part, so the reply (as in CR-003) stays below the work that led to it; anything else
|
|
73
|
+
* is appended. `closeReasoning` closes the reasoning still streaming when a part of another type
|
|
74
|
+
* arrives (the model moved on), with its duration. */
|
|
75
|
+
export declare function upsertMessagePart(parts: AgentMessagePart[], part: AgentMessagePart, closeReasoning?: (part: AgentReasoningPart) => AgentReasoningPart): AgentMessagePart[];
|
|
76
|
+
/** The text of a message: its text parts, one paragraph each (what `AgentActivityEntry.detail` holds). */
|
|
77
|
+
export declare function messagePartsText(parts: readonly AgentMessagePart[]): string;
|
|
78
|
+
/** The answers as one line per question ("Database: Postgres"), for the history of the chat. */
|
|
79
|
+
export declare function formatQuestionAnswers(questions: readonly AgentQuestion[], answers: readonly AgentQuestionAnswer[]): string;
|
|
@@ -31,6 +31,12 @@ export interface AgenticoDict {
|
|
|
31
31
|
tooManyToolTurns: string;
|
|
32
32
|
aiDisabledFallback: string;
|
|
33
33
|
continueWithoutAiFallback: string;
|
|
34
|
+
/** The group of the steps of the agent, when it holds one step. */
|
|
35
|
+
oneStep: string;
|
|
36
|
+
/** The group of the steps of the agent. `{count}` = number of steps */
|
|
37
|
+
steps: string;
|
|
38
|
+
/** Accessible name of the group of the steps. */
|
|
39
|
+
stepsLabel: string;
|
|
34
40
|
/** `{label}` = subagent label */
|
|
35
41
|
newInstance: string;
|
|
36
42
|
chatHistory: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './i18n/types';
|
|
2
|
-
export type { AgentDefinition, AgentTool, LatestAttachmentsRef, AgentExecutor, AgentExecutorTurn, AgentExecutorStep } from './domain/agentDefinition';
|
|
2
|
+
export type { AgentDefinition, AgentTool, LatestAttachmentsRef, AgentExecutor, AgentExecutorTurn, AgentExecutorStep, AgentExecutorPartOptions } from './domain/agentDefinition';
|
|
3
|
+
export { DEFAULT_TEXT_PART_ID, DEFAULT_REASONING_PART_ID, upsertMessagePart, messagePartsText, formatQuestionAnswers, type AgentMessagePart, type AgentTextPart, type AgentReasoningPart, type AgentToolPart, type AgentQuestionsPart, type AgentQuestion, type AgentQuestionOption, type AgentQuestionAnswer, type AgentQuestionsAnswers, } from './domain/messageParts';
|
|
3
4
|
export type { SubagentCommand, SubagentManifest, SubagentComponentContext } from './domain/subagentManifest';
|
|
4
5
|
export { defineSubagent } from './domain/defineSubagent';
|
|
5
6
|
export { registerSubagents, getSubagentRegistry, findSubagentManifest } from './domain/subagentRegistry';
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { AgentActivityEntry } from './useAgent';
|
|
2
|
+
import type { AgentQuestionAnswer } from '../domain/messageParts';
|
|
3
|
+
/** What the log needs to let the person answer questions (CR-004): the entries of the live
|
|
4
|
+
* conversation (`canAnswer`) and where the answers go. Without it, unanswered questions are shown
|
|
5
|
+
* disabled. */
|
|
6
|
+
export interface AgentActivityLogQuestions {
|
|
7
|
+
canAnswer: (entryId: string) => boolean;
|
|
8
|
+
onAnswer: (entryId: string, partId: string, answers: AgentQuestionAnswer[]) => Promise<unknown>;
|
|
9
|
+
}
|
|
3
10
|
/** Il log di attività di un agente, usato dal pannello globale (Agentico) — ogni agente ora
|
|
4
11
|
* ci passa attraverso, il pannello embedded legacy (AgentFollowUp) è stato ritirato una volta
|
|
5
12
|
* migrato anche l'ultimo consumer (import HTML/JSX, vedi ComponentEditPage.tsx). Un solo posto
|
|
6
|
-
* per l'icon-system e la logica "sto pensando" transitorio/collassabile.
|
|
7
|
-
|
|
13
|
+
* per l'icon-system e la logica "sto pensando" transitorio/collassabile.
|
|
14
|
+
*
|
|
15
|
+
* One `<li>` per turn (CR-004): the message of the person, sticky at the top while its turn
|
|
16
|
+
* scrolls, then what the agent did and said. Entries before the first message of the person
|
|
17
|
+
* (an opening without text) form a turn of their own, without a bubble. */
|
|
18
|
+
export declare function AgentActivityLog({ activity, questions }: {
|
|
8
19
|
activity: AgentActivityEntry[];
|
|
9
|
-
|
|
20
|
+
questions?: AgentActivityLogQuestions;
|
|
21
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AIConversationTurn, AIModelDescriptor } from '@llmnative/react';
|
|
2
2
|
import type { AgentDefinition } from '../domain/agentDefinition';
|
|
3
|
+
import { type AgentMessagePart, type AgentQuestionAnswer } from '../domain/messageParts';
|
|
3
4
|
/** Una voce del log di attività — o un messaggio dell'utente (il testo di sendMessage(),
|
|
4
5
|
* mostrato subito com'è, mai "sto pensando" perché non è il modello a scriverlo), o una tool
|
|
5
6
|
* call (etichetta SEMPRE deterministica/locale, vedi AgentTool.describeInvocation: mai testo
|
|
@@ -36,6 +37,10 @@ export interface AgentActivityEntry {
|
|
|
36
37
|
* doveva fidarsi a memoria (bug osservato: un allegato sembrava "sparito" perché non
|
|
37
38
|
* c'era traccia visiva che fosse mai arrivato). */
|
|
38
39
|
attachmentNames?: string[];
|
|
40
|
+
/** On the turns of a remote agent (CR-004): the message in parts (text, reasoning, steps,
|
|
41
|
+
* questions), in the order they arrived. `detail` still holds its text. Absent on the turns of
|
|
42
|
+
* the AI provider and on chats saved before 0.3.0, shown from `detail` as before. */
|
|
43
|
+
parts?: AgentMessagePart[];
|
|
39
44
|
}
|
|
40
45
|
/** Stato di gating/selezione — non generico, condiviso dal componente <AgentControls />
|
|
41
46
|
* (che non ha bisogno di conoscere TParams/TResult, solo di disegnare switch + select). */
|
|
@@ -139,11 +144,17 @@ export interface UseAgentResult<TParams, TResult> extends AgentControlState {
|
|
|
139
144
|
history: AIConversationTurn[];
|
|
140
145
|
activity: AgentActivityEntry[];
|
|
141
146
|
} | null;
|
|
147
|
+
/** Answers the questions part `partId` of the entry `entryId` (CR-004). If the turn that asked
|
|
148
|
+
* is still waiting, its `onQuestions` promise resolves; otherwise a new turn of the executor
|
|
149
|
+
* carries them (`AgentExecutorTurn.answers`, with empty `text`). Either way the part keeps the
|
|
150
|
+
* answers and shows them read-only. Resolves with the result of that new turn, if any; rejects
|
|
151
|
+
* (leaving the form open) when another turn is running or the entry is not of this conversation. */
|
|
152
|
+
answerQuestions: (entryId: string, partId: string, answers: AgentQuestionAnswer[]) => Promise<TResult | null>;
|
|
142
153
|
}
|
|
143
154
|
/** Solo la fetta di UseAgentResult che serve a un consumer del pannello globale (Agentico.tsx)
|
|
144
155
|
* per continuare una conversazione già avviata da run() — TParams non compare in nessuno dei
|
|
145
156
|
* membri qui sotto, quindi `never` è innocuo. */
|
|
146
|
-
export type AgentConversation<TResult> = Pick<UseAgentResult<never, TResult>, 'canContinue' | 'remote' | 'remoteModels' | 'running' | 'error' | 'activity' | 'sendMessage' | 'stop' | 'runFallback' | 'snapshot'>;
|
|
157
|
+
export type AgentConversation<TResult> = Pick<UseAgentResult<never, TResult>, 'canContinue' | 'remote' | 'remoteModels' | 'running' | 'error' | 'activity' | 'sendMessage' | 'stop' | 'runFallback' | 'snapshot' | 'answerQuestions'>;
|
|
147
158
|
export declare function useAgent<TParams, TContext, TResult>(definition: AgentDefinition<TParams, TContext, TResult>, options?: {
|
|
148
159
|
defaultEnabled?: boolean;
|
|
149
160
|
}): UseAgentResult<TParams, TResult>;
|
package/llms.txt
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
# @llmnative/agentico
|
|
2
|
-
|
|
3
|
-
> Agentic chat orchestrator for @llmnative/react apps. A persistent panel: the orchestrator
|
|
4
|
-
> collects parameters in conversation and hands the work to host-registered subagents. Every
|
|
5
|
-
> subagent has a deterministic fallback. Agentico knows nothing concrete about the host.
|
|
6
|
-
|
|
7
|
-
## Host responsibilities (startup)
|
|
8
|
-
|
|
9
|
-
- `registerSubagents(manifests)` — SubagentManifest: id, label, icon, description, indexPath, commands (name, summary, Zod inputSchema, describeOutput), definition (AgentDefinition), toParams, destinationIds, optional crossAgentToolIds, withCollected, manualEntry, componentContexts, chatEntityId (chat saved at every turn under that entity), onlyWhenAnchored (offered by the orchestrator only when scoped to it).
|
|
10
|
-
- `registerDestinations({ id: ResultDestination })` — apply(result, { scopeId, dataProvider, storageProvider, proxyFetch }, meta).
|
|
11
|
-
- `registerSubagentReports({ subagentId: SubagentReportModule })`.
|
|
12
|
-
- `registerSubagentControls({ subagentId: useControls })` — a hook of the host per task (props: params, taskId, running, close) returning `{ actions?: ChatbotAction[] (with onClick), content?: ReactNode }`, memoized: actions in the prompt, content above it.
|
|
13
|
-
- `SubagentManifest.onArchive(entityId, params)` / `confirmArchive(entityId, params)` — archiving a chat from the history (hover icon).
|
|
14
|
-
- `registerCrossAgentTools((ctx) => AgentTool[])` — ctx: attachmentsRef, collected (per-conversation scratchpad), proxyFetch.
|
|
15
|
-
- `configureAgenticoPrompts(partial)` — model-facing pack; `agenticoPromptsEn` (default) / `agenticoPromptsIt`.
|
|
16
|
-
- `configureEntityChatStore({ storageKey })`.
|
|
17
|
-
- i18n: merge `agenticoTranslations.<locale>` into `<App i18n={{ translations }}>`; override any `agentico.*` key.
|
|
18
|
-
|
|
19
|
-
## Mount
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
<AgenticoProvider scope={{ id, dataProvider, storageProvider } | null}>
|
|
23
|
-
<AgenticoToggle />
|
|
24
|
-
<Agentico />
|
|
25
|
-
</AgenticoProvider>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Hooks
|
|
29
|
-
|
|
30
|
-
- `useAgentico()` — panel state, `startOrchestrator(goal, opts)`, `startSubagent(subagentId, params, { taskId?, openingMessage? })` (use `entityChatTaskId(subagentId, entityId)` as taskId), `resumeEntityChat`, `commitEntityChat(subagentId, entityId, taskId, scopeId, params, title)`, `scope`.
|
|
31
|
-
- `useAgenticoPageContext(text, card?)` — what the user is looking at.
|
|
32
|
-
- `useSubagentComponentContext(subagentId, componentKey)` — anchor a component to a subagent.
|
|
33
|
-
- `useAgent(definition)` — run an AgentDefinition directly.
|
|
34
|
-
|
|
35
|
-
## AgentDefinition
|
|
36
|
-
|
|
37
|
-
buildContext (always runs) · buildPrompt · buildFollowUpPrompt · parseResponse (null → fallback) · fallback (required) · describeFallback? · getTools? · microPromptIds? · executor?
|
|
38
|
-
|
|
39
|
-
`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`.
|
|
1
|
+
# @llmnative/agentico
|
|
2
|
+
|
|
3
|
+
> Agentic chat orchestrator for @llmnative/react apps. A persistent panel: the orchestrator
|
|
4
|
+
> collects parameters in conversation and hands the work to host-registered subagents. Every
|
|
5
|
+
> subagent has a deterministic fallback. Agentico knows nothing concrete about the host.
|
|
6
|
+
|
|
7
|
+
## Host responsibilities (startup)
|
|
8
|
+
|
|
9
|
+
- `registerSubagents(manifests)` — SubagentManifest: id, label, icon, description, indexPath, commands (name, summary, Zod inputSchema, describeOutput), definition (AgentDefinition), toParams, destinationIds, optional crossAgentToolIds, withCollected, manualEntry, componentContexts, chatEntityId (chat saved at every turn under that entity), onlyWhenAnchored (offered by the orchestrator only when scoped to it).
|
|
10
|
+
- `registerDestinations({ id: ResultDestination })` — apply(result, { scopeId, dataProvider, storageProvider, proxyFetch }, meta).
|
|
11
|
+
- `registerSubagentReports({ subagentId: SubagentReportModule })`.
|
|
12
|
+
- `registerSubagentControls({ subagentId: useControls })` — a hook of the host per task (props: params, taskId, running, close) returning `{ actions?: ChatbotAction[] (with onClick), content?: ReactNode }`, memoized: actions in the prompt, content above it.
|
|
13
|
+
- `SubagentManifest.onArchive(entityId, params)` / `confirmArchive(entityId, params)` — archiving a chat from the history (hover icon).
|
|
14
|
+
- `registerCrossAgentTools((ctx) => AgentTool[])` — ctx: attachmentsRef, collected (per-conversation scratchpad), proxyFetch.
|
|
15
|
+
- `configureAgenticoPrompts(partial)` — model-facing pack; `agenticoPromptsEn` (default) / `agenticoPromptsIt`.
|
|
16
|
+
- `configureEntityChatStore({ storageKey })`.
|
|
17
|
+
- i18n: merge `agenticoTranslations.<locale>` into `<App i18n={{ translations }}>`; override any `agentico.*` key.
|
|
18
|
+
|
|
19
|
+
## Mount
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
<AgenticoProvider scope={{ id, dataProvider, storageProvider } | null}>
|
|
23
|
+
<AgenticoToggle />
|
|
24
|
+
<Agentico />
|
|
25
|
+
</AgenticoProvider>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Hooks
|
|
29
|
+
|
|
30
|
+
- `useAgentico()` — panel state, `startOrchestrator(goal, opts)`, `startSubagent(subagentId, params, { taskId?, openingMessage? })` (use `entityChatTaskId(subagentId, entityId)` as taskId), `resumeEntityChat`, `commitEntityChat(subagentId, entityId, taskId, scopeId, params, title)`, `scope`.
|
|
31
|
+
- `useAgenticoPageContext(text, card?)` — what the user is looking at.
|
|
32
|
+
- `useSubagentComponentContext(subagentId, componentKey)` — anchor a component to a subagent.
|
|
33
|
+
- `useAgent(definition)` — run an AgentDefinition directly.
|
|
34
|
+
|
|
35
|
+
## AgentDefinition
|
|
36
|
+
|
|
37
|
+
buildContext (always runs) · buildPrompt · buildFollowUpPrompt · parseResponse (null → fallback) · fallback (required) · describeFallback? · getTools? · microPromptIds? · executor?
|
|
38
|
+
|
|
39
|
+
`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`.
|
|
40
|
+
|
|
41
|
+
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,79 +1,79 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@llmnative/agentico",
|
|
3
|
-
"version": "0.
|
|
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
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"types": "dist/types/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/types/index.d.ts",
|
|
11
|
-
"import": "./dist/index.mjs",
|
|
12
|
-
"require": "./dist/index.js"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist",
|
|
17
|
-
"llms.txt"
|
|
18
|
-
],
|
|
19
|
-
"sideEffects": false,
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "vite build && tsc -p tsconfig.build.json",
|
|
22
|
-
"typecheck": "tsc --noEmit",
|
|
23
|
-
"test": "vitest run",
|
|
24
|
-
"test:watch": "vitest",
|
|
25
|
-
"prepublishOnly": "npm run build",
|
|
26
|
-
"release:check": "node scripts/release/check-release.mjs"
|
|
27
|
-
},
|
|
28
|
-
"repository": {
|
|
29
|
-
"type": "git",
|
|
30
|
-
"url": "git+https://github.com/sherpadvisorylab/llmnative-agentico.git"
|
|
31
|
-
},
|
|
32
|
-
"bugs": {
|
|
33
|
-
"url": "https://github.com/sherpadvisorylab/llmnative-agentico/issues"
|
|
34
|
-
},
|
|
35
|
-
"homepage": "https://github.com/sherpadvisorylab/llmnative-agentico#readme",
|
|
36
|
-
"keywords": [
|
|
37
|
-
"llmnative",
|
|
38
|
-
"agent",
|
|
39
|
-
"orchestrator",
|
|
40
|
-
"subagent",
|
|
41
|
-
"ai",
|
|
42
|
-
"react"
|
|
43
|
-
],
|
|
44
|
-
"author": "wolfgan",
|
|
45
|
-
"license": "Apache-2.0",
|
|
46
|
-
"engines": {
|
|
47
|
-
"node": ">=24.18.0 <25"
|
|
48
|
-
},
|
|
49
|
-
"packageManager": "npm@11.11.0",
|
|
50
|
-
"peerDependencies": {
|
|
51
|
-
"@llmnative/react": "^1.
|
|
52
|
-
"react": "^19.2.0",
|
|
53
|
-
"react-dom": "^19.2.0",
|
|
54
|
-
"zod": "^3.24.1"
|
|
55
|
-
},
|
|
56
|
-
"dependencies": {
|
|
57
|
-
"zod-to-json-schema": "^3.24.1"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"@llmnative/react": "^1.
|
|
61
|
-
"@phosphor-icons/react": "^2.1.10",
|
|
62
|
-
"@testing-library/jest-dom": "^7.0.1",
|
|
63
|
-
"@testing-library/react": "^16.3.3",
|
|
64
|
-
"@types/react": "^19.3.0",
|
|
65
|
-
"@types/react-dom": "^19.3.0",
|
|
66
|
-
"happy-dom": "^20.14.5",
|
|
67
|
-
"lucide-react": "^1.52.0",
|
|
68
|
-
"react": "^19.3.0",
|
|
69
|
-
"react-dom": "^19.3.0",
|
|
70
|
-
"react-router-dom": "^7.18.4",
|
|
71
|
-
"typescript": "^7.0.2",
|
|
72
|
-
"vite": "^8.3.2",
|
|
73
|
-
"vitest": "^5.0.3",
|
|
74
|
-
"zod": "^3.24.1"
|
|
75
|
-
},
|
|
76
|
-
"publishConfig": {
|
|
77
|
-
"access": "public"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@llmnative/agentico",
|
|
3
|
+
"version": "0.3.0",
|
|
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
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/types/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"llms.txt"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"test:watch": "vitest",
|
|
25
|
+
"prepublishOnly": "npm run build",
|
|
26
|
+
"release:check": "node scripts/release/check-release.mjs"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/sherpadvisorylab/llmnative-agentico.git"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/sherpadvisorylab/llmnative-agentico/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/sherpadvisorylab/llmnative-agentico#readme",
|
|
36
|
+
"keywords": [
|
|
37
|
+
"llmnative",
|
|
38
|
+
"agent",
|
|
39
|
+
"orchestrator",
|
|
40
|
+
"subagent",
|
|
41
|
+
"ai",
|
|
42
|
+
"react"
|
|
43
|
+
],
|
|
44
|
+
"author": "wolfgan",
|
|
45
|
+
"license": "Apache-2.0",
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=24.18.0 <25"
|
|
48
|
+
},
|
|
49
|
+
"packageManager": "npm@11.11.0",
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@llmnative/react": "^1.34.0",
|
|
52
|
+
"react": "^19.2.0",
|
|
53
|
+
"react-dom": "^19.2.0",
|
|
54
|
+
"zod": "^3.24.1"
|
|
55
|
+
},
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"zod-to-json-schema": "^3.24.1"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@llmnative/react": "^1.34.0",
|
|
61
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
62
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
63
|
+
"@testing-library/react": "^16.3.3",
|
|
64
|
+
"@types/react": "^19.3.0",
|
|
65
|
+
"@types/react-dom": "^19.3.0",
|
|
66
|
+
"happy-dom": "^20.14.5",
|
|
67
|
+
"lucide-react": "^1.52.0",
|
|
68
|
+
"react": "^19.3.0",
|
|
69
|
+
"react-dom": "^19.3.0",
|
|
70
|
+
"react-router-dom": "^7.18.4",
|
|
71
|
+
"typescript": "^7.0.2",
|
|
72
|
+
"vite": "^8.3.2",
|
|
73
|
+
"vitest": "^5.0.3",
|
|
74
|
+
"zod": "^3.24.1"
|
|
75
|
+
},
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"access": "public"
|
|
78
|
+
}
|
|
79
|
+
}
|