@llmnative/agentico 0.5.0 → 0.7.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.
@@ -39,6 +39,13 @@ export interface AgentTool {
39
39
  * scritta due volte una sopra l'altra. Assente = ripiega su describeInvocation (meglio
40
40
  * di niente, ma con la ripetizione). */
41
41
  describeIntent?: string;
42
+ /** true (or true for this input) = the tool runs only once the person approves it (CR-008): the turn
43
+ * stops on a question docked at the bottom of the chat, Approve / Reject with a reason. Rejected,
44
+ * the tool does not run and the model is told why. For what stops work, spends or cannot be undone. */
45
+ needsApproval?: boolean | ((input: Record<string, unknown>) => boolean);
46
+ /** What the tool is about to do, said to the person in the approval (e.g. "Close #141: duplicate of
47
+ * #139"). Absent = `describeInvocation`, else the name of the tool. */
48
+ describeApproval?: (input: Record<string, unknown>) => string;
42
49
  }
43
50
  export interface AgentDefinition<TParams, TContext, TResult> {
44
51
  /** Gira sempre, con o senza AI — estrazione/parsing deterministico dei dati grezzi. */
@@ -81,6 +88,11 @@ export interface AgentDefinition<TParams, TContext, TResult> {
81
88
  * agente: qui si dichiara solo QUALI si vogliono, mai il loro testo. Assente o [] =
82
89
  * nessuno. */
83
90
  microPromptIds?: string[];
91
+ /** true = the replies of the model are messages of a chat (CR-007): each is a text part of its
92
+ * turn (Markdown), and the subagent keeps no result to apply (no preview, no destinations).
93
+ * For an agent that talks and uses tools, with nothing to save at the end. `parseResponse`
94
+ * still runs on each reply (what `run` and `sendMessage` resolve to). */
95
+ conversational?: boolean;
84
96
  /** Present = the turns of this agent are answered by the host, not by the AI provider of
85
97
  * Agentico (CR-003): a remote agent with its own memory, for example an opencode session on
86
98
  * a server. `useAgent` then builds no prompt, needs no model and never falls back: it gives
@@ -0,0 +1,13 @@
1
+ import type { AgentTool } from './agentDefinition';
2
+ import type { AgentQuestionAnswer } from './messageParts';
3
+ /** The id of the questions part of an approval, in its own message. */
4
+ export declare const APPROVAL_PART_ID = "approval";
5
+ /** What the person decided, and what they wrote besides the choice. */
6
+ export interface ApprovalDecision {
7
+ approved: boolean;
8
+ reason?: string;
9
+ }
10
+ /** Whether this call of the tool waits for the person. */
11
+ export declare function needsApproval(tool: AgentTool, input: Record<string, unknown>): boolean;
12
+ /** The decision in the answer: approved only when Approve was chosen; any free text is the reason. */
13
+ export declare function approvalOf(answers: readonly AgentQuestionAnswer[], approve: string, reject: string): ApprovalDecision;
@@ -12,6 +12,8 @@ export interface AgenticoPrompts {
12
12
  noToolsAvailable: string;
13
13
  /** Sent to the model when it keeps calling tools past the round-trip limit. */
14
14
  stopCallingTools: string;
15
+ /** Returned to the model for a tool the person rejected (CR-008). `{reason}` = their reason, or empty. */
16
+ toolRejected: string;
15
17
  /** Returned to the model by a handoff tool: the work is queued, not done. `{label}` = subagent. */
16
18
  handoffQueued: string;
17
19
  /** Closing-summary micro-prompt (see microPrompts.ts). */
@@ -24,6 +24,10 @@ export interface AgenticoDict {
24
24
  modelRequestError: string;
25
25
  noProviderResponse: string;
26
26
  noActiveSession: string;
27
+ approvalHeader: string;
28
+ approve: string;
29
+ reject: string;
30
+ approveQuestion: string;
27
31
  requestInProgress: string;
28
32
  invalidResponse: string;
29
33
  responseReceived: string;
package/llms.txt CHANGED
@@ -36,7 +36,11 @@
36
36
 
37
37
  ## AgentDefinition
38
38
 
39
- buildContext (always runs) · buildPrompt · buildFollowUpPrompt · parseResponse (null → fallback) · fallback (required) · describeFallback? · getTools? · microPromptIds? · executor?
39
+ buildContext (always runs) · buildPrompt · buildFollowUpPrompt · parseResponse (null → fallback) · fallback (required) · describeFallback? · getTools? · microPromptIds? · conversational? · executor?
40
+
41
+ `conversational: true` (0.6.0): each text reply of the model is a text part of its turn (a message of the chat), and the subagent keeps no result: no preview, no destinations under the chat. For a chat with tools and nothing to apply.
42
+
43
+ `AgentTool.needsApproval: true | (input) => boolean` (0.7.0): the call waits for the person on a docked question "Approve? <describeApproval(input)>" (Approve / Reject + reason); rejected, the tool does not run and the model reads the prompt `toolRejected` with the reason.
40
44
 
41
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`.
42
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmnative/agentico",
3
- "version": "0.5.0",
3
+ "version": "0.7.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",