@tanstack/ai 0.35.0 → 0.37.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
1
  import { AnyTextAdapter } from './adapter.js';
2
- import { AnyTool, ConstrainedModelMessage, InferSchemaType, ModelMessage, SchemaInput, StreamChunk, StructuredOutputStream, TextOptions, UIMessage } from '../../types.js';
2
+ import { AnyTool, ConstrainedModelMessage, InferSchemaType, LazyToolsConfig, ModelMessage, SchemaInput, StreamChunk, StructuredOutputStream, TextOptions, UIMessage } from '../../types.js';
3
3
  import { AnyChatMiddleware, ChatMiddleware } from './middleware/types.js';
4
4
  import { CheckCoverage } from './middleware/builder.js';
5
5
  import { SystemPrompt } from '../../system-prompts.js';
@@ -93,6 +93,12 @@ export interface TextActivityOptions<TAdapter extends AnyTextAdapter, TSchema ex
93
93
  abortController?: TextOptions['abortController'];
94
94
  /** Strategy for controlling the agent loop */
95
95
  agentLoopStrategy?: TextOptions['agentLoopStrategy'];
96
+ /**
97
+ * Optional configuration for lazy-tool discovery (tools marked `lazy: true`).
98
+ * Tunes how much of each lazy tool's description appears in the discovery
99
+ * catalog. Optional — defaults to `{ includeDescription: 'none' }`.
100
+ */
101
+ lazyToolsConfig?: LazyToolsConfig;
96
102
  /** Unique conversation identifier for tracking */
97
103
  conversationId?: TextOptions['conversationId'];
98
104
  /** Thread/conversation ID for AG-UI protocol. Auto-generated if not provided. */
@@ -113,7 +113,8 @@ class TextEngine {
113
113
  this.messages = convertMessagesToModelMessages(config.params.messages);
114
114
  this.lazyToolManager = new LazyToolManager(
115
115
  config.params.tools || [],
116
- this.messages
116
+ this.messages,
117
+ config.params.lazyToolsConfig
117
118
  );
118
119
  this.tools = this.lazyToolManager.getActiveTools();
119
120
  this.toolCallManager = new ToolCallManager(this.tools);