@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.
- package/dist/esm/activities/chat/index.d.ts +7 -1
- package/dist/esm/activities/chat/index.js +2 -1
- package/dist/esm/activities/chat/index.js.map +1 -1
- package/dist/esm/activities/chat/tools/lazy-tool-manager.d.ts +3 -2
- package/dist/esm/activities/chat/tools/lazy-tool-manager.js +9 -3
- package/dist/esm/activities/chat/tools/lazy-tool-manager.js.map +1 -1
- package/dist/esm/activities/chat/tools/lazy-tools.d.ts +15 -0
- package/dist/esm/activities/chat/tools/lazy-tools.js +16 -0
- package/dist/esm/activities/chat/tools/lazy-tools.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types.d.ts +22 -1
- package/package.json +3 -3
- package/skills/ai-core/tool-calling/SKILL.md +26 -1
- package/src/activities/chat/index.ts +8 -0
- package/src/activities/chat/tools/lazy-tool-manager.ts +12 -4
- package/src/activities/chat/tools/lazy-tools.ts +33 -0
- package/src/index.ts +5 -0
- package/src/types.ts +23 -1
|
@@ -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);
|