@toolpack-sdk/agents 3.3.0 → 3.5.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.
@@ -1,5 +1,5 @@
1
- import { B as BaseAgentOptions, A as AgentInput, a as AgentResult } from './types-BcZq2AiE.js';
2
- import { B as BaseAgent } from './base-agent-BBZtoYAH.js';
1
+ import { B as BaseAgentOptions, A as AgentInput, a as AgentResult } from './types-DEXlIfZP.js';
2
+ import { B as BaseAgent } from './base-agent-Cge0xlL7.js';
3
3
  import { ModeConfig } from 'toolpack-sdk';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { B as BaseAgentOptions, A as AgentInput, a as AgentResult } from './types-BcZq2AiE.cjs';
2
- import { B as BaseAgent } from './base-agent-Bo42v_Sd.cjs';
1
+ import { B as BaseAgentOptions, A as AgentInput, a as AgentResult } from './types-DEXlIfZP.cjs';
2
+ import { B as BaseAgent } from './base-agent-BfQbqIqI.cjs';
3
3
  import { ModeConfig } from 'toolpack-sdk';
4
4
 
5
5
  /**
@@ -1,9 +1,9 @@
1
- import { A as AgentInput, k as InterceptorResult, I as Interceptor, g as AgentInstance, C as ChannelInterface, d as IAgentRegistry, i as InterceptorChainConfig, a as AgentResult } from '../types-BcZq2AiE.cjs';
2
- export { j as InterceptorContext, N as NextFunction, S as SKIP_SENTINEL, l as isSkipSentinel, s as skip } from '../types-BcZq2AiE.cjs';
1
+ import { A as AgentInput, k as InterceptorResult, I as Interceptor, g as AgentInstance, C as ChannelInterface, d as IAgentRegistry, i as InterceptorChainConfig, a as AgentResult } from '../types-DEXlIfZP.cjs';
2
+ export { j as InterceptorContext, N as NextFunction, S as SKIP_SENTINEL, l as isSkipSentinel, s as skip } from '../types-DEXlIfZP.cjs';
3
3
  import { Participant, ConversationStore, ConversationScope, StoredMessage } from 'toolpack-sdk';
4
- import { I as IntentClassification } from '../intent-classifier-agent-BYgOzICA.cjs';
4
+ import { I as IntentClassification } from '../intent-classifier-agent-CURERNsv.cjs';
5
5
  import 'events';
6
- import '../base-agent-Bo42v_Sd.cjs';
6
+ import '../base-agent-BfQbqIqI.cjs';
7
7
  import '@toolpack-sdk/knowledge';
8
8
 
9
9
  /**
@@ -1,9 +1,9 @@
1
- import { A as AgentInput, k as InterceptorResult, I as Interceptor, g as AgentInstance, C as ChannelInterface, d as IAgentRegistry, i as InterceptorChainConfig, a as AgentResult } from '../types-BcZq2AiE.js';
2
- export { j as InterceptorContext, N as NextFunction, S as SKIP_SENTINEL, l as isSkipSentinel, s as skip } from '../types-BcZq2AiE.js';
1
+ import { A as AgentInput, k as InterceptorResult, I as Interceptor, g as AgentInstance, C as ChannelInterface, d as IAgentRegistry, i as InterceptorChainConfig, a as AgentResult } from '../types-DEXlIfZP.js';
2
+ export { j as InterceptorContext, N as NextFunction, S as SKIP_SENTINEL, l as isSkipSentinel, s as skip } from '../types-DEXlIfZP.js';
3
3
  import { Participant, ConversationStore, ConversationScope, StoredMessage } from 'toolpack-sdk';
4
- import { I as IntentClassification } from '../intent-classifier-agent-Cj1v2BbA.js';
4
+ import { I as IntentClassification } from '../intent-classifier-agent-CRRAjM4Y.js';
5
5
  import 'events';
6
- import '../base-agent-BBZtoYAH.js';
6
+ import '../base-agent-Cge0xlL7.js';
7
7
  import '@toolpack-sdk/knowledge';
8
8
 
9
9
  /**
@@ -1,8 +1,8 @@
1
- import { C as ChannelInterface, f as AgentOutput, A as AgentInput, B as BaseAgentOptions } from '../types-BcZq2AiE.cjs';
1
+ import { C as ChannelInterface, f as AgentOutput, A as AgentInput, B as BaseAgentOptions } from '../types-DEXlIfZP.cjs';
2
2
  import { Chunk, QueryOptions, QueryResult, Knowledge } from '@toolpack-sdk/knowledge';
3
3
  import { Toolpack } from 'toolpack-sdk';
4
- import { B as BaseAgent } from '../base-agent-Bo42v_Sd.cjs';
5
- export { C as ContainsScorer, a as CustomScorer, E as EvalCase, b as EvalCaseResult, c as EvalDataset, d as EvalImprovement, e as EvalRegression, f as EvalReport, g as EvalRun, h as EvalRunner, i as EvalRunnerOptions, j as EvalScoredResult, k as EvalScoredRun, l as EvalScorer, m as EvalVerdict, n as ExactMatchScorer, L as LLMJudgeScorer, o as LLMJudgeScorerOptions, p as compareEvalRuns, q as formatEvalReport } from '../eval-report-BYi3JStQ.cjs';
4
+ import { B as BaseAgent } from '../base-agent-BfQbqIqI.cjs';
5
+ export { C as ContainsScorer, a as CustomScorer, E as EvalCase, b as EvalCaseResult, c as EvalDataset, d as EvalImprovement, e as EvalRegression, f as EvalReport, g as EvalRun, h as EvalRunner, i as EvalRunnerOptions, j as EvalScoredResult, k as EvalScoredRun, l as EvalScorer, m as EvalVerdict, n as ExactMatchScorer, L as LLMJudgeScorer, o as LLMJudgeScorerOptions, p as compareEvalRuns, q as formatEvalReport } from '../eval-report-DjWw37Y1.cjs';
6
6
  import 'events';
7
7
 
8
8
  /**
@@ -1,8 +1,8 @@
1
- import { C as ChannelInterface, f as AgentOutput, A as AgentInput, B as BaseAgentOptions } from '../types-BcZq2AiE.js';
1
+ import { C as ChannelInterface, f as AgentOutput, A as AgentInput, B as BaseAgentOptions } from '../types-DEXlIfZP.js';
2
2
  import { Chunk, QueryOptions, QueryResult, Knowledge } from '@toolpack-sdk/knowledge';
3
3
  import { Toolpack } from 'toolpack-sdk';
4
- import { B as BaseAgent } from '../base-agent-BBZtoYAH.js';
5
- export { C as ContainsScorer, a as CustomScorer, E as EvalCase, b as EvalCaseResult, c as EvalDataset, d as EvalImprovement, e as EvalRegression, f as EvalReport, g as EvalRun, h as EvalRunner, i as EvalRunnerOptions, j as EvalScoredResult, k as EvalScoredRun, l as EvalScorer, m as EvalVerdict, n as ExactMatchScorer, L as LLMJudgeScorer, o as LLMJudgeScorerOptions, p as compareEvalRuns, q as formatEvalReport } from '../eval-report-Dl0Oyhut.js';
4
+ import { B as BaseAgent } from '../base-agent-Cge0xlL7.js';
5
+ export { C as ContainsScorer, a as CustomScorer, E as EvalCase, b as EvalCaseResult, c as EvalDataset, d as EvalImprovement, e as EvalRegression, f as EvalReport, g as EvalRun, h as EvalRunner, i as EvalRunnerOptions, j as EvalScoredResult, k as EvalScoredRun, l as EvalScorer, m as EvalVerdict, n as ExactMatchScorer, L as LLMJudgeScorer, o as LLMJudgeScorerOptions, p as compareEvalRuns, q as formatEvalReport } from '../eval-report-CmRgZW2r.js';
6
6
  import 'events';
7
7
 
8
8
  /**
@@ -220,8 +220,10 @@ interface AgentInput<TIntent extends string = string> {
220
220
  * Interceptors such as `participant-resolver` read and/or enrich this.
221
221
  */
222
222
  participant?: Participant;
223
- /** Optional abort signal — when aborted, the running LLM stream stops at the next round boundary. */
223
+ /** Optional abort signal: when aborted, the running LLM call stops at once and tools not yet started are not run. */
224
224
  signal?: AbortSignal;
225
+ /** Called with each text delta as it is generated. When provided, the run uses streaming mode. */
226
+ onChunk?: (delta: string) => void;
225
227
  }
226
228
  /**
227
229
  * Represents a step in a workflow execution.
@@ -251,7 +253,12 @@ interface AgentResult {
251
253
  output: string;
252
254
  /** Workflow steps taken during execution (populated by run()) */
253
255
  steps?: WorkflowStep[];
254
- /** Optional metadata for routing decisions or post-processing */
256
+ /**
257
+ * Optional metadata for routing decisions or post-processing.
258
+ * `mindSaveError` is set by run() when the reply was produced but what the agent learned in
259
+ * the run could not be saved to its mind (the message of the failure).
260
+ * `aborted` is true when a streaming run was stopped by its signal: `output` is what had arrived.
261
+ */
255
262
  metadata?: Record<string, unknown>;
256
263
  }
257
264
  /**
@@ -278,6 +285,8 @@ interface AgentRunOptions {
278
285
  maxTokens?: number;
279
286
  /** Optional abort signal — propagated to the underlying AIClient stream/generate call. */
280
287
  signal?: AbortSignal;
288
+ /** Called with each text delta as it is generated. When provided, the run uses streaming mode. */
289
+ onChunk?: (delta: string) => void;
281
290
  }
282
291
  /**
283
292
  * Agent instance interface - shape of a BaseAgent instance.
@@ -220,8 +220,10 @@ interface AgentInput<TIntent extends string = string> {
220
220
  * Interceptors such as `participant-resolver` read and/or enrich this.
221
221
  */
222
222
  participant?: Participant;
223
- /** Optional abort signal — when aborted, the running LLM stream stops at the next round boundary. */
223
+ /** Optional abort signal: when aborted, the running LLM call stops at once and tools not yet started are not run. */
224
224
  signal?: AbortSignal;
225
+ /** Called with each text delta as it is generated. When provided, the run uses streaming mode. */
226
+ onChunk?: (delta: string) => void;
225
227
  }
226
228
  /**
227
229
  * Represents a step in a workflow execution.
@@ -251,7 +253,12 @@ interface AgentResult {
251
253
  output: string;
252
254
  /** Workflow steps taken during execution (populated by run()) */
253
255
  steps?: WorkflowStep[];
254
- /** Optional metadata for routing decisions or post-processing */
256
+ /**
257
+ * Optional metadata for routing decisions or post-processing.
258
+ * `mindSaveError` is set by run() when the reply was produced but what the agent learned in
259
+ * the run could not be saved to its mind (the message of the failure).
260
+ * `aborted` is true when a streaming run was stopped by its signal: `output` is what had arrived.
261
+ */
255
262
  metadata?: Record<string, unknown>;
256
263
  }
257
264
  /**
@@ -278,6 +285,8 @@ interface AgentRunOptions {
278
285
  maxTokens?: number;
279
286
  /** Optional abort signal — propagated to the underlying AIClient stream/generate call. */
280
287
  signal?: AbortSignal;
288
+ /** Called with each text delta as it is generated. When provided, the run uses streaming mode. */
289
+ onChunk?: (delta: string) => void;
281
290
  }
282
291
  /**
283
292
  * Agent instance interface - shape of a BaseAgent instance.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolpack-sdk/agents",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "Production AI agents for Toolpack SDK — 8 channel integrations (Slack, Discord, Telegram, SMS, Email, Webhook, Scheduled, MCP), AgentMind persistent cognitive layer (goals, beliefs, reflections), interceptors, evals, and multi-agent coordination",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -89,11 +89,11 @@
89
89
  },
90
90
  "peerDependencies": {
91
91
  "@opentelemetry/api": "^1.x",
92
- "@toolpack-sdk/knowledge": "^3.3.0",
92
+ "@toolpack-sdk/knowledge": "^3.5.0",
93
93
  "better-sqlite3": "^12.6.2",
94
94
  "discord.js": "^14.x",
95
95
  "nodemailer": "^6.x",
96
- "toolpack-sdk": "^3.3.0",
96
+ "toolpack-sdk": "^3.5.0",
97
97
  "twilio": "^5.x"
98
98
  },
99
99
  "peerDependenciesMeta": {