@copilotkitnext/agent 0.0.0-0.0.0-max-changeset-10101010101010-20260109191632

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.
@@ -0,0 +1,23 @@
1
+
2
+ 
3
+ > @copilotkitnext/agent@0.0.33 build /Users/mk/Developer/work/CopilotKit/src/v2.x/packages/agent
4
+ > tsup
5
+
6
+ CLI Building entry: src/index.ts
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.5.0
9
+ CLI Using tsup config: /Users/mk/Developer/work/CopilotKit/src/v2.x/packages/agent/tsup.config.ts
10
+ CLI Target: es2022
11
+ CLI Cleaning output folder
12
+ CJS Build start
13
+ ESM Build start
14
+ CJS dist/index.js 23.69 KB
15
+ CJS dist/index.js.map 45.80 KB
16
+ CJS ⚡️ Build success in 19ms
17
+ ESM dist/index.mjs 21.85 KB
18
+ ESM dist/index.mjs.map 45.75 KB
19
+ ESM ⚡️ Build success in 19ms
20
+ DTS Build start
21
+ DTS ⚡️ Build success in 1184ms
22
+ DTS dist/index.d.ts 6.34 KB
23
+ DTS dist/index.d.mts 6.34 KB
@@ -0,0 +1,276 @@
1
+
2
+ 
3
+ > @copilotkitnext/agent@0.0.33 test /Users/mk/Developer/work/CopilotKit/src/v2.x/packages/agent
4
+ > vitest run
5
+
6
+ [?25l
7
+  RUN  v3.2.4 /Users/mk/Developer/work/CopilotKit/src/v2.x/packages/agent
8
+
9
+ [?2026h
10
+  ❯ src/__tests__/basic-agent.test.ts [queued]
11
+
12
+  Test Files 0 passed (5)
13
+  Tests 0 passed (0)
14
+  Start at 13:35:31
15
+  Duration 201ms
16
+ [?2026l[?2026h
17
+  ❯ src/__tests__/basic-agent.test.ts [queued]
18
+  ❯ src/__tests__/config-tools-execution.test.ts [queued]
19
+  ❯ src/__tests__/property-overrides.test.ts [queued]
20
+  ❯ src/__tests__/state-tools.test.ts [queued]
21
+
22
+  Test Files 0 passed (5)
23
+  Tests 0 passed (0)
24
+  Start at 13:35:31
25
+  Duration 350ms
26
+ [?2026l[?2026h
27
+  ❯ src/__tests__/basic-agent.test.ts [queued]
28
+  ❯ src/__tests__/config-tools-execution.test.ts [queued]
29
+  ❯ src/__tests__/property-overrides.test.ts [queued]
30
+  ❯ src/__tests__/state-tools.test.ts [queued]
31
+  ❯ src/__tests__/utils.test.ts [queued]
32
+
33
+  Test Files 0 passed (5)
34
+  Tests 0 passed (0)
35
+  Start at 13:35:31
36
+  Duration 901ms
37
+ [?2026l[?2026h
38
+  ❯ src/__tests__/basic-agent.test.ts [queued]
39
+  ❯ src/__tests__/config-tools-execution.test.ts [queued]
40
+  ❯ src/__tests__/property-overrides.test.ts 0/21
41
+  ❯ src/__tests__/state-tools.test.ts [queued]
42
+  ❯ src/__tests__/utils.test.ts [queued]
43
+
44
+  Test Files 0 passed (5)
45
+  Tests 0 passed (21)
46
+  Start at 13:35:31
47
+  Duration 1.32s
48
+ [?2026l[?2026hstderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > Model Override > should override model when allowed
49
+ BasicAgent is deprecated, use BuiltInAgent instead
50
+
51
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > Model Override > should accept LanguageModel instance for override
52
+ BasicAgent is deprecated, use BuiltInAgent instead
53
+
54
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > Model Override > should ignore invalid model override types
55
+ BasicAgent is deprecated, use BuiltInAgent instead
56
+
57
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > ToolChoice Override > should override with 'auto'
58
+ BasicAgent is deprecated, use BuiltInAgent instead
59
+
60
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > ToolChoice Override > should override with 'required'
61
+ BasicAgent is deprecated, use BuiltInAgent instead
62
+
63
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > ToolChoice Override > should override with 'none'
64
+ BasicAgent is deprecated, use BuiltInAgent instead
65
+
66
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > ToolChoice Override > should override with specific tool selection
67
+ BasicAgent is deprecated, use BuiltInAgent instead
68
+
69
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > ToolChoice Override > should ignore invalid toolChoice values
70
+ BasicAgent is deprecated, use BuiltInAgent instead
71
+
72
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > StopSequences Override > should override stopSequences with valid array
73
+ BasicAgent is deprecated, use BuiltInAgent instead
74
+
75
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > StopSequences Override > should ignore stopSequences with non-string elements
76
+ BasicAgent is deprecated, use BuiltInAgent instead
77
+
78
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > StopSequences Override > should ignore non-array stopSequences
79
+ BasicAgent is deprecated, use BuiltInAgent instead
80
+
81
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > Numeric Property Overrides > should override all numeric properties when allowed
82
+ BasicAgent is deprecated, use BuiltInAgent instead
83
+
84
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > Numeric Property Overrides > should ignore non-numeric values for numeric properties
85
+ BasicAgent is deprecated, use BuiltInAgent instead
86
+
87
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > Multiple Property Overrides > should only override allowed properties
88
+ BasicAgent is deprecated, use BuiltInAgent instead
89
+
90
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > Multiple Property Overrides > should handle undefined forwardedProps
91
+ BasicAgent is deprecated, use BuiltInAgent instead
92
+
93
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > Multiple Property Overrides > should handle non-object forwardedProps
94
+ BasicAgent is deprecated, use BuiltInAgent instead
95
+
96
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > Multiple Property Overrides > should handle undefined property values in forwardedProps
97
+ BasicAgent is deprecated, use BuiltInAgent instead
98
+
99
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > canOverride method > should return true for overridable properties
100
+ BasicAgent is deprecated, use BuiltInAgent instead
101
+
102
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > canOverride method > should return false for non-overridable properties
103
+ BasicAgent is deprecated, use BuiltInAgent instead
104
+
105
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > canOverride method > should return false when overridableProperties is undefined
106
+ BasicAgent is deprecated, use BuiltInAgent instead
107
+
108
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Basic Event Emission > should emit RUN_STARTED and RUN_FINISHED events
109
+ BasicAgent is deprecated, use BuiltInAgent instead
110
+
111
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Basic Event Emission > should emit TEXT_MESSAGE_CHUNK events for text deltas
112
+ BasicAgent is deprecated, use BuiltInAgent instead
113
+
114
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Tool Call Events > should emit tool call lifecycle events
115
+ BasicAgent is deprecated, use BuiltInAgent instead
116
+
117
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Prompt Building > should not add system message when no prompt, context, or state
118
+ BasicAgent is deprecated, use BuiltInAgent instead
119
+
120
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Prompt Building > should prepend system message with config prompt
121
+ BasicAgent is deprecated, use BuiltInAgent instead
122
+
123
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Prompt Building > should include context in system message
124
+ BasicAgent is deprecated, use BuiltInAgent instead
125
+
126
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Prompt Building > should include state in system message
127
+ BasicAgent is deprecated, use BuiltInAgent instead
128
+
129
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Prompt Building > should combine prompt, context, and state
130
+ BasicAgent is deprecated, use BuiltInAgent instead
131
+
132
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Tool Configuration > should include tools from config
133
+ BasicAgent is deprecated, use BuiltInAgent instead
134
+
135
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Tool Configuration > should merge config tools with input tools
136
+ BasicAgent is deprecated, use BuiltInAgent instead
137
+
138
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Tool Configuration > should always include state update tools
139
+ BasicAgent is deprecated, use BuiltInAgent instead
140
+
141
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Property Overrides > should respect overridable properties
142
+ BasicAgent is deprecated, use BuiltInAgent instead
143
+
144
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Property Overrides > should ignore non-overridable properties
145
+ BasicAgent is deprecated, use BuiltInAgent instead
146
+
147
+ stderr | src/__tests__/basic-agent.test.ts > BasicAgent > Error Handling > should emit RUN_ERROR event on failure
148
+ BasicAgent is deprecated, use BuiltInAgent instead
149
+
150
+ stderr | src/__tests__/property-overrides.test.ts > Property Overrides - Edge Cases > canOverride method > should return false when overridableProperties is empty array
151
+ BasicAgent is deprecated, use BuiltInAgent instead
152
+
153
+
154
+  ❯ src/__tests__/basic-agent.test.ts 0/14
155
+  ❯ src/__tests__/config-tools-execution.test.ts [queued]
156
+  ❯ src/__tests__/state-tools.test.ts 0/10
157
+  ❯ src/__tests__/utils.test.ts [queued]
158
+
159
+  Test Files 1 passed (5)
160
+  Tests 21 passed (45)
161
+  Start at 13:35:31
162
+  Duration 1.42s
163
+ [?2026l[?2026h ✓ src/__tests__/property-overrides.test.ts (21 tests) 77ms
164
+
165
+  ❯ src/__tests__/basic-agent.test.ts 0/14
166
+  ❯ src/__tests__/config-tools-execution.test.ts [queued]
167
+  ❯ src/__tests__/state-tools.test.ts 0/10
168
+  ❯ src/__tests__/utils.test.ts [queued]
169
+
170
+  Test Files 1 passed (5)
171
+  Tests 21 passed (45)
172
+  Start at 13:35:31
173
+  Duration 1.42s
174
+ [?2026l[?2026hstderr | src/__tests__/state-tools.test.ts > State Update Tools > AGUISendStateSnapshot > should emit STATE_SNAPSHOT event when tool is called
175
+ BasicAgent is deprecated, use BuiltInAgent instead
176
+
177
+
178
+
179
+  ❯ src/__tests__/config-tools-execution.test.ts 0/11
180
+
181
+  Test Files 4 passed (5)
182
+  Tests 72 passed (83)
183
+  Start at 13:35:31
184
+  Duration 1.63s
185
+ [?2026l[?2026h ✓ src/__tests__/basic-agent.test.ts (14 tests) 11ms
186
+
187
+  ❯ src/__tests__/config-tools-execution.test.ts 0/11
188
+
189
+  Test Files 4 passed (5)
190
+  Tests 72 passed (83)
191
+  Start at 13:35:31
192
+  Duration 1.63s
193
+ [?2026l[?2026hstderr | src/__tests__/state-tools.test.ts > State Update Tools > AGUISendStateSnapshot > should still emit TOOL_CALL_RESULT for the LLM
194
+ BasicAgent is deprecated, use BuiltInAgent instead
195
+
196
+ stderr | src/__tests__/state-tools.test.ts > State Update Tools > AGUISendStateDelta > should emit STATE_DELTA event when tool is called
197
+ BasicAgent is deprecated, use BuiltInAgent instead
198
+
199
+ stderr | src/__tests__/state-tools.test.ts > State Update Tools > AGUISendStateDelta > should handle add operations
200
+ BasicAgent is deprecated, use BuiltInAgent instead
201
+
202
+ stderr | src/__tests__/state-tools.test.ts > State Update Tools > AGUISendStateDelta > should handle replace operations
203
+ BasicAgent is deprecated, use BuiltInAgent instead
204
+
205
+ stderr | src/__tests__/state-tools.test.ts > State Update Tools > AGUISendStateDelta > should handle remove operations
206
+ BasicAgent is deprecated, use BuiltInAgent instead
207
+
208
+ stderr | src/__tests__/state-tools.test.ts > State Update Tools > AGUISendStateDelta > should handle multiple operations in a single delta
209
+ BasicAgent is deprecated, use BuiltInAgent instead
210
+
211
+ stderr | src/__tests__/state-tools.test.ts > State Update Tools > AGUISendStateDelta > should still emit TOOL_CALL_RESULT for the LLM
212
+ BasicAgent is deprecated, use BuiltInAgent instead
213
+
214
+ stderr | src/__tests__/state-tools.test.ts > State Update Tools > State Tools Integration > should handle both snapshot and delta in same run
215
+ BasicAgent is deprecated, use BuiltInAgent instead
216
+
217
+ stderr | src/__tests__/state-tools.test.ts > State Update Tools > State Tools Integration > should not emit state events for non-state tools
218
+ BasicAgent is deprecated, use BuiltInAgent instead
219
+
220
+
221
+  ❯ src/__tests__/config-tools-execution.test.ts 0/11
222
+
223
+  Test Files 4 passed (5)
224
+  Tests 72 passed (83)
225
+  Start at 13:35:31
226
+  Duration 1.63s
227
+ [?2026l[?2026h ✓ src/__tests__/state-tools.test.ts (10 tests) 17ms
228
+ ✓ src/__tests__/utils.test.ts (27 tests) 7ms
229
+
230
+  ❯ src/__tests__/config-tools-execution.test.ts 0/11
231
+
232
+  Test Files 4 passed (5)
233
+  Tests 72 passed (83)
234
+  Start at 13:35:31
235
+  Duration 1.63s
236
+ [?2026lstderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Tool Definition with Execute > should pass execute function to streamText tools
237
+ BasicAgent is deprecated, use BuiltInAgent instead
238
+
239
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Tool Definition with Execute > should include all tool properties in the Vercel AI SDK tool
240
+ BasicAgent is deprecated, use BuiltInAgent instead
241
+
242
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Tool Definition with Execute > should handle multiple config tools with execute functions
243
+ BasicAgent is deprecated, use BuiltInAgent instead
244
+
245
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Config Tools vs Input Tools > config tools should have execute, input tools should not
246
+ BasicAgent is deprecated, use BuiltInAgent instead
247
+
248
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Execute Function Invocation > execute function can be called with correct arguments
249
+ BasicAgent is deprecated, use BuiltInAgent instead
250
+
251
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Execute Function Invocation > execute function errors are propagated
252
+ BasicAgent is deprecated, use BuiltInAgent instead
253
+
254
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Built-in State Tools Still Work > AGUISendStateSnapshot should have execute alongside config tools
255
+ BasicAgent is deprecated, use BuiltInAgent instead
256
+
257
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Message ID Generation > should use messageId from text-start event
258
+ BasicAgent is deprecated, use BuiltInAgent instead
259
+
260
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Multi-Step Execution (maxSteps) > should pass stopWhen with stepCountIs when maxSteps is configured
261
+ BasicAgent is deprecated, use BuiltInAgent instead
262
+
263
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Multi-Step Execution (maxSteps) > should not set stopWhen when maxSteps is not configured
264
+ BasicAgent is deprecated, use BuiltInAgent instead
265
+
266
+ stderr | src/__tests__/config-tools-execution.test.ts > Config Tools Server-Side Execution > Multi-Step Execution (maxSteps) > should allow high maxSteps for complex tool chains
267
+ BasicAgent is deprecated, use BuiltInAgent instead
268
+
269
+ ✓ src/__tests__/config-tools-execution.test.ts (11 tests) 15ms
270
+
271
+  Test Files  5 passed (5)
272
+  Tests  83 passed (83)
273
+  Start at  13:35:31
274
+  Duration  1.91s (transform 775ms, setup 0ms, collect 5.94s, tests 127ms, environment 1ms, prepare 571ms)
275
+
276
+ [?25h
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @copilotkitnext/agent
2
+
3
+ ## 0.0.0-0.0.0-max-changeset-10101010101010-20260109191632
4
+
5
+ ### Patch Changes
6
+
7
+ - 6da0e74: Update versioning strategy
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) Atai Barkai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,199 @@
1
+ import { Message, RunAgentInput, AbstractAgent, BaseEvent } from '@ag-ui/client';
2
+ import { LanguageModel, ModelMessage, ToolSet, ToolChoice } from 'ai';
3
+ import { Observable } from 'rxjs';
4
+ import { z } from 'zod';
5
+ import { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
6
+
7
+ /**
8
+ * Properties that can be overridden by forwardedProps
9
+ * These match the exact parameter names in streamText
10
+ */
11
+ type OverridableProperty = "model" | "toolChoice" | "maxOutputTokens" | "temperature" | "topP" | "topK" | "presencePenalty" | "frequencyPenalty" | "stopSequences" | "seed" | "maxRetries" | "prompt";
12
+ /**
13
+ * Supported model identifiers for BuiltInAgent
14
+ */
15
+ type BuiltInAgentModel = "openai/gpt-5" | "openai/gpt-5-mini" | "openai/gpt-4.1" | "openai/gpt-4.1-mini" | "openai/gpt-4.1-nano" | "openai/gpt-4o" | "openai/gpt-4o-mini" | "openai/o3" | "openai/o3-mini" | "openai/o4-mini" | "anthropic/claude-sonnet-4.5" | "anthropic/claude-sonnet-4" | "anthropic/claude-3.7-sonnet" | "anthropic/claude-opus-4.1" | "anthropic/claude-opus-4" | "anthropic/claude-3.5-haiku" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | (string & {});
16
+ /**
17
+ * Model specifier - can be a string like "openai/gpt-4o" or a LanguageModel instance
18
+ */
19
+ type ModelSpecifier = string | LanguageModel;
20
+ /**
21
+ * MCP Client configuration for HTTP transport
22
+ */
23
+ interface MCPClientConfigHTTP {
24
+ /**
25
+ * Type of MCP client
26
+ */
27
+ type: "http";
28
+ /**
29
+ * URL of the MCP server
30
+ */
31
+ url: string;
32
+ /**
33
+ * Optional transport options for HTTP client
34
+ */
35
+ options?: StreamableHTTPClientTransportOptions;
36
+ }
37
+ /**
38
+ * MCP Client configuration for SSE transport
39
+ */
40
+ interface MCPClientConfigSSE {
41
+ /**
42
+ * Type of MCP client
43
+ */
44
+ type: "sse";
45
+ /**
46
+ * URL of the MCP server
47
+ */
48
+ url: string;
49
+ /**
50
+ * Optional HTTP headers (e.g., for authentication)
51
+ */
52
+ headers?: Record<string, string>;
53
+ }
54
+ /**
55
+ * MCP Client configuration
56
+ */
57
+ type MCPClientConfig = MCPClientConfigHTTP | MCPClientConfigSSE;
58
+ /**
59
+ * Resolves a model specifier to a LanguageModel instance
60
+ * @param spec - Model string (e.g., "openai/gpt-4o") or LanguageModel instance
61
+ * @returns LanguageModel instance
62
+ */
63
+ declare function resolveModel(spec: ModelSpecifier): LanguageModel;
64
+ /**
65
+ * Tool definition for BuiltInAgent
66
+ */
67
+ interface ToolDefinition<TParameters extends z.ZodTypeAny = z.ZodTypeAny> {
68
+ name: string;
69
+ description: string;
70
+ parameters: TParameters;
71
+ execute: (args: z.infer<TParameters>) => Promise<unknown>;
72
+ }
73
+ /**
74
+ * Define a tool for use with BuiltInAgent
75
+ * @param name - The name of the tool
76
+ * @param description - Description of what the tool does
77
+ * @param parameters - Zod schema for the tool's input parameters
78
+ * @param execute - Function to execute the tool server-side
79
+ * @returns Tool definition
80
+ */
81
+ declare function defineTool<TParameters extends z.ZodTypeAny>(config: {
82
+ name: string;
83
+ description: string;
84
+ parameters: TParameters;
85
+ execute: (args: z.infer<TParameters>) => Promise<unknown>;
86
+ }): ToolDefinition<TParameters>;
87
+ /**
88
+ * Converts AG-UI messages to Vercel AI SDK ModelMessage format
89
+ */
90
+ declare function convertMessagesToVercelAISDKMessages(messages: Message[]): ModelMessage[];
91
+ /**
92
+ * JSON Schema type definition
93
+ */
94
+ interface JsonSchema {
95
+ type: "object" | "string" | "number" | "boolean" | "array";
96
+ description?: string;
97
+ properties?: Record<string, JsonSchema>;
98
+ required?: string[];
99
+ items?: JsonSchema;
100
+ }
101
+ /**
102
+ * Converts JSON Schema to Zod schema
103
+ */
104
+ declare function convertJsonSchemaToZodSchema(jsonSchema: JsonSchema, required: boolean): z.ZodSchema;
105
+ declare function convertToolsToVercelAITools(tools: RunAgentInput["tools"]): ToolSet;
106
+ /**
107
+ * Converts ToolDefinition array to Vercel AI SDK ToolSet
108
+ */
109
+ declare function convertToolDefinitionsToVercelAITools(tools: ToolDefinition[]): ToolSet;
110
+ /**
111
+ * Configuration for BuiltInAgent
112
+ */
113
+ interface BuiltInAgentConfiguration {
114
+ /**
115
+ * The model to use
116
+ */
117
+ model: BuiltInAgentModel | LanguageModel;
118
+ /**
119
+ * Maximum number of steps/iterations for tool calling (default: 1)
120
+ */
121
+ maxSteps?: number;
122
+ /**
123
+ * Tool choice setting - how tools are selected for execution (default: "auto")
124
+ */
125
+ toolChoice?: ToolChoice<Record<string, unknown>>;
126
+ /**
127
+ * Maximum number of tokens to generate
128
+ */
129
+ maxOutputTokens?: number;
130
+ /**
131
+ * Temperature setting (range depends on provider)
132
+ */
133
+ temperature?: number;
134
+ /**
135
+ * Nucleus sampling (topP)
136
+ */
137
+ topP?: number;
138
+ /**
139
+ * Top K sampling
140
+ */
141
+ topK?: number;
142
+ /**
143
+ * Presence penalty
144
+ */
145
+ presencePenalty?: number;
146
+ /**
147
+ * Frequency penalty
148
+ */
149
+ frequencyPenalty?: number;
150
+ /**
151
+ * Sequences that will stop the generation
152
+ */
153
+ stopSequences?: string[];
154
+ /**
155
+ * Seed for deterministic results
156
+ */
157
+ seed?: number;
158
+ /**
159
+ * Maximum number of retries
160
+ */
161
+ maxRetries?: number;
162
+ /**
163
+ * Prompt for the agent
164
+ */
165
+ prompt?: string;
166
+ /**
167
+ * List of properties that can be overridden by forwardedProps.
168
+ */
169
+ overridableProperties?: OverridableProperty[];
170
+ /**
171
+ * Optional list of MCP server configurations
172
+ */
173
+ mcpServers?: MCPClientConfig[];
174
+ /**
175
+ * Optional tools available to the agent
176
+ */
177
+ tools?: ToolDefinition[];
178
+ }
179
+ declare class BuiltInAgent extends AbstractAgent {
180
+ private config;
181
+ private abortController?;
182
+ constructor(config: BuiltInAgentConfiguration);
183
+ /**
184
+ * Check if a property can be overridden by forwardedProps
185
+ */
186
+ canOverride(property: OverridableProperty): boolean;
187
+ run(input: RunAgentInput): Observable<BaseEvent>;
188
+ clone(): BuiltInAgent;
189
+ abortRun(): void;
190
+ }
191
+ /**
192
+ * @deprecated Use BuiltInAgent instead
193
+ */
194
+ declare class BasicAgent extends BuiltInAgent {
195
+ constructor(config: BuiltInAgentConfiguration);
196
+ }
197
+ type BasicAgentConfiguration = BuiltInAgentConfiguration;
198
+
199
+ export { BasicAgent, type BasicAgentConfiguration, BuiltInAgent, type BuiltInAgentConfiguration, type BuiltInAgentModel, type MCPClientConfig, type MCPClientConfigHTTP, type MCPClientConfigSSE, type ModelSpecifier, type OverridableProperty, type ToolDefinition, convertJsonSchemaToZodSchema, convertMessagesToVercelAISDKMessages, convertToolDefinitionsToVercelAITools, convertToolsToVercelAITools, defineTool, resolveModel };