@polka-codes/core 0.9.46 → 0.9.47

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,238 +1,12 @@
1
1
  import type { FilePart } from 'ai';
2
2
  import type { ImagePart } from 'ai';
3
3
  import type { JSONValue } from '@ai-sdk/provider';
4
- import { LanguageModelUsage } from 'ai';
5
4
  import type { LanguageModelV2 } from '@ai-sdk/provider';
6
5
  import type { LanguageModelV2ToolResultOutput } from '@ai-sdk/provider';
7
6
  import type { LanguageModelV2Usage } from '@ai-sdk/provider';
8
- import type { ModelMessage } from '@ai-sdk/provider-utils';
9
- import type { ModelMessage as ModelMessage_2 } from 'ai';
10
7
  import type { TextPart } from 'ai';
11
- import type { ToolModelMessage } from '@ai-sdk/provider-utils';
12
- import type { UserContent } from '@ai-sdk/provider-utils';
13
- import type { UserContent as UserContent_2 } from 'ai';
14
- import type { UserModelMessage } from '@ai-sdk/provider-utils';
15
8
  import { z } from 'zod';
16
9
 
17
- declare abstract class AgentBase {
18
- #private;
19
- readonly ai: LanguageModelV2;
20
- protected readonly config: Readonly<AgentBaseConfig>;
21
- protected readonly handlers: Record<string, FullToolInfoV2>;
22
- constructor(name: string, ai: LanguageModelV2, config: AgentBaseConfig);
23
- abort(): void;
24
- get parameters(): Readonly<Record<string, any>>;
25
- get messages(): Readonly<ModelMessage[]>;
26
- setMessages(messages: Readonly<ModelMessage[]>): void;
27
- start(prompt: UserContent): Promise<ExitReason>;
28
- step(message: (UserModelMessage | ToolModelMessage)[]): Promise<AssistantMessageContent[]>;
29
- handleStepResponse(response: AssistantMessageContent[]): Promise<{
30
- type: "reply";
31
- message: (UserModelMessage | ToolModelMessage)[];
32
- } | {
33
- type: "exit";
34
- reason: ExitReason;
35
- }>;
36
- continueTask(userMessage: UserContent): Promise<ExitReason>;
37
- protected abstract onBeforeInvokeTool(name: string, args: Record<string, string>): Promise<ToolResponse | undefined>;
38
- get model(): string;
39
- get usage(): {
40
- input: number;
41
- output: number;
42
- cachedRead: number;
43
- cost: number;
44
- messageCount: number;
45
- };
46
- }
47
- export { AgentBase }
48
- export { AgentBase as AgentBase_alias_1 }
49
- export { AgentBase as AgentBase_alias_2 }
50
-
51
- declare type AgentBaseConfig = {
52
- systemPrompt: string;
53
- tools: FullToolInfoV2[];
54
- toolNamePrefix: string;
55
- provider: ToolProvider;
56
- agents?: Readonly<AgentInfo[]>;
57
- scripts?: Record<string, string | {
58
- command: string;
59
- description: string;
60
- }>;
61
- callback?: TaskEventCallback;
62
- policies: AgentPolicy[];
63
- retryCount?: number;
64
- requestTimeoutSeconds?: number;
65
- toolFormat: ToolFormat;
66
- parameters: Record<string, any>;
67
- usageMeter: UsageMeter;
68
- requireToolUse: boolean;
69
- };
70
- export { AgentBaseConfig }
71
- export { AgentBaseConfig as AgentBaseConfig_alias_1 }
72
- export { AgentBaseConfig as AgentBaseConfig_alias_2 }
73
-
74
- declare type AgentInfo = {
75
- name: string;
76
- responsibilities: string[];
77
- };
78
- export { AgentInfo }
79
- export { AgentInfo as AgentInfo_alias_1 }
80
- export { AgentInfo as AgentInfo_alias_2 }
81
-
82
- declare type AgentNameType = (typeof allAgents)[number]['name'];
83
- export { AgentNameType }
84
- export { AgentNameType as AgentNameType_alias_1 }
85
-
86
- declare type AgentPolicy = (tools: Record<string, FullToolInfoV2>, parameters: Record<string, any>) => AgentPolicyInstance | undefined;
87
- export { AgentPolicy }
88
- export { AgentPolicy as AgentPolicy_alias_1 }
89
- export { AgentPolicy as AgentPolicy_alias_2 }
90
-
91
- declare type AgentPolicyInstance = {
92
- name: string;
93
- tools?: FullToolInfoV2[];
94
- prompt?: string;
95
- onBeforeInvokeTool?: (name: string, args: Record<string, string>) => Promise<ToolResponse | undefined>;
96
- onBeforeRequest?: (agent: AgentBase) => Promise<void>;
97
- prepareMessages?: (agent: AgentBase, messages: ModelMessage_2[]) => Promise<ModelMessage_2[]>;
98
- };
99
- export { AgentPolicyInstance }
100
- export { AgentPolicyInstance as AgentPolicyInstance_alias_1 }
101
- export { AgentPolicyInstance as AgentPolicyInstance_alias_2 }
102
-
103
- declare const agentsPrompt: (agents: Readonly<AgentInfo[]>, name: string) => string;
104
- export { agentsPrompt }
105
- export { agentsPrompt as agentsPrompt_alias_1 }
106
- export { agentsPrompt as agentsPrompt_alias_2 }
107
-
108
- declare const allAgents: readonly [{
109
- readonly name: "architect";
110
- readonly responsibilities: ["Analyzing the user’s overall task and requirements.", "Creating plans and making higher-level decisions about system structure and design.", "Reviewing and analyzing existing code or components for maintainability and scalability.", "Laying out the roadmap for implementation."];
111
- }, {
112
- readonly name: "coder";
113
- readonly responsibilities: ["Editing and refactoring existing code.", "Creating new features or modules.", "Running tests and analyzing test results.", "Maintaining coding standards, lint rules, and general code quality."];
114
- }, {
115
- readonly name: "analyzer";
116
- readonly responsibilities: ["Analyzing project structure and organization", "Identifying key source code files and their relationships", "Understanding common coding patterns and conventions", "Examining development workflow and tooling", "Analyzing dependencies and their usage patterns"];
117
- }, {
118
- readonly name: "codefixer";
119
- readonly responsibilities: ["Fixing type errors and type-related issues", "Resolving failing tests", "Addressing code quality issues", "Tracking and reporting unfixed issues"];
120
- }];
121
- export { allAgents }
122
- export { allAgents as allAgents_alias_1 }
123
-
124
- declare class AnalyzerAgent extends AgentBase {
125
- constructor(options: AnalyzerAgentOptions);
126
- onBeforeInvokeTool(): Promise<undefined>;
127
- }
128
- export { AnalyzerAgent }
129
- export { AnalyzerAgent as AnalyzerAgent_alias_1 }
130
- export { AnalyzerAgent as AnalyzerAgent_alias_2 }
131
-
132
- declare const analyzerAgentInfo: {
133
- readonly name: "analyzer";
134
- readonly responsibilities: ["Analyzing project structure and organization", "Identifying key source code files and their relationships", "Understanding common coding patterns and conventions", "Examining development workflow and tooling", "Analyzing dependencies and their usage patterns"];
135
- };
136
- export { analyzerAgentInfo }
137
- export { analyzerAgentInfo as analyzerAgentInfo_alias_1 }
138
- export { analyzerAgentInfo as analyzerAgentInfo_alias_2 }
139
-
140
- declare type AnalyzerAgentOptions = SharedAgentOptions;
141
- export { AnalyzerAgentOptions }
142
- export { AnalyzerAgentOptions as AnalyzerAgentOptions_alias_1 }
143
- export { AnalyzerAgentOptions as AnalyzerAgentOptions_alias_2 }
144
-
145
- declare class ArchitectAgent extends AgentBase {
146
- constructor(options: ArchitectAgentOptions);
147
- onBeforeInvokeTool(): Promise<undefined>;
148
- }
149
- export { ArchitectAgent }
150
- export { ArchitectAgent as ArchitectAgent_alias_1 }
151
- export { ArchitectAgent as ArchitectAgent_alias_2 }
152
-
153
- declare const architectAgentInfo: {
154
- readonly name: "architect";
155
- readonly responsibilities: ["Analyzing the user’s overall task and requirements.", "Creating plans and making higher-level decisions about system structure and design.", "Reviewing and analyzing existing code or components for maintainability and scalability.", "Laying out the roadmap for implementation."];
156
- };
157
- export { architectAgentInfo }
158
- export { architectAgentInfo as architectAgentInfo_alias_1 }
159
- export { architectAgentInfo as architectAgentInfo_alias_2 }
160
-
161
- declare type ArchitectAgentOptions = SharedAgentOptions;
162
- export { ArchitectAgentOptions }
163
- export { ArchitectAgentOptions as ArchitectAgentOptions_alias_1 }
164
- export { ArchitectAgentOptions as ArchitectAgentOptions_alias_2 }
165
-
166
- declare type AssistantMessageContent = TextContent | ToolUse;
167
- export { AssistantMessageContent }
168
- export { AssistantMessageContent as AssistantMessageContent_alias_1 }
169
- export { AssistantMessageContent as AssistantMessageContent_alias_2 }
170
-
171
- export declare const basePrompt = "You are a highly skilled software engineer specializing in debugging and fixing code issues. You have extensive experience with:\n- Type systems and type checking\n- Test frameworks and debugging test failures\n- Code quality tools and best practices\n- Systematic debugging approaches";
172
-
173
- export declare const basePrompt_alias_1 = "You are a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.";
174
-
175
- declare const capabilities: (_toolNamePrefix: string) => string;
176
- export { capabilities }
177
- export { capabilities as capabilities_alias_1 }
178
- export { capabilities as capabilities_alias_2 }
179
-
180
- /**
181
- * CodeFixer agent for fixing code issues like type errors and failing tests.
182
- * Using Scripts: format, check, test
183
- */
184
- declare class CodeFixerAgent extends AgentBase {
185
- #private;
186
- constructor(options: CodeFixerAgentOptions);
187
- protected onBeforeInvokeTool(name: string, _args: Record<string, string>): Promise<ToolResponse | undefined>;
188
- }
189
- export { CodeFixerAgent }
190
- export { CodeFixerAgent as CodeFixerAgent_alias_1 }
191
- export { CodeFixerAgent as CodeFixerAgent_alias_2 }
192
-
193
- declare const codeFixerAgentInfo: {
194
- readonly name: "codefixer";
195
- readonly responsibilities: ["Fixing type errors and type-related issues", "Resolving failing tests", "Addressing code quality issues", "Tracking and reporting unfixed issues"];
196
- };
197
- export { codeFixerAgentInfo }
198
- export { codeFixerAgentInfo as codeFixerAgentInfo_alias_1 }
199
- export { codeFixerAgentInfo as codeFixerAgentInfo_alias_2 }
200
-
201
- declare type CodeFixerAgentOptions = SharedAgentOptions & {
202
- maxRetries?: number;
203
- };
204
- export { CodeFixerAgentOptions }
205
- export { CodeFixerAgentOptions as CodeFixerAgentOptions_alias_1 }
206
- export { CodeFixerAgentOptions as CodeFixerAgentOptions_alias_2 }
207
-
208
- export declare const codeFixingStrategies = "\n====\n\nCODE FIXING STRATEGIES\n\n1. Type Errors\n - Analyze type error messages carefully\n - Check type definitions and imports\n - Consider type assertions only as a last resort\n - Verify type compatibility across function boundaries\n - Look for null/undefined handling issues\n\n2. Test Failures\n - Examine test output and error messages\n - Check test setup and fixtures\n - Verify assertions and expectations\n - Look for async/timing issues\n - Consider edge cases and input validation\n\n3. Code Quality Issues\n - Follow project's coding standards\n - Address linter warnings systematically\n - Improve code readability\n - Fix potential runtime issues\n - Consider performance implications\n\n4. General Approach\n - Start with the most critical issues\n - Make minimal necessary changes\n - Verify fixes don't introduce new issues\n - Document complex fixes with comments\n - Track attempted solutions for each issue";
209
-
210
- /**
211
- * Coder agent for writing code.
212
- * Using Scripts: format, check, test
213
- */
214
- declare class CoderAgent extends AgentBase {
215
- #private;
216
- constructor(options: CoderAgentOptions);
217
- protected onBeforeInvokeTool(name: string, _args: Record<string, string>): Promise<ToolResponse | undefined>;
218
- }
219
- export { CoderAgent }
220
- export { CoderAgent as CoderAgent_alias_1 }
221
- export { CoderAgent as CoderAgent_alias_2 }
222
-
223
- declare const coderAgentInfo: {
224
- readonly name: "coder";
225
- readonly responsibilities: ["Editing and refactoring existing code.", "Creating new features or modules.", "Running tests and analyzing test results.", "Maintaining coding standards, lint rules, and general code quality."];
226
- };
227
- export { coderAgentInfo }
228
- export { coderAgentInfo as coderAgentInfo_alias_1 }
229
- export { coderAgentInfo as coderAgentInfo_alias_2 }
230
-
231
- declare type CoderAgentOptions = SharedAgentOptions;
232
- export { CoderAgentOptions }
233
- export { CoderAgentOptions as CoderAgentOptions_alias_1 }
234
- export { CoderAgentOptions as CoderAgentOptions_alias_2 }
235
-
236
10
  declare type CommandProvider = {
237
11
  executeCommand?: (command: string, needApprove: boolean) => Promise<{
238
12
  stdout: string;
@@ -260,7 +34,6 @@ export { Config }
260
34
  export { Config as Config_alias_1 }
261
35
 
262
36
  declare const configSchema: z.ZodObject<{
263
- agent: z.ZodOptional<z.ZodString>;
264
37
  prices: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
265
38
  inputPrice: z.ZodOptional<z.ZodNumber>;
266
39
  outputPrice: z.ZodOptional<z.ZodNumber>;
@@ -278,10 +51,6 @@ declare const configSchema: z.ZodObject<{
278
51
  defaultProvider: z.ZodOptional<z.ZodString>;
279
52
  defaultModel: z.ZodOptional<z.ZodString>;
280
53
  defaultParameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
281
- toolFormat: z.ZodOptional<z.ZodEnum<{
282
- native: "native";
283
- "polka-codes": "polka-codes";
284
- }>>;
285
54
  maxMessageCount: z.ZodOptional<z.ZodNumber>;
286
55
  budget: z.ZodOptional<z.ZodNumber>;
287
56
  retryCount: z.ZodOptional<z.ZodNumber>;
@@ -291,95 +60,52 @@ declare const configSchema: z.ZodObject<{
291
60
  command: z.ZodString;
292
61
  description: z.ZodString;
293
62
  }, z.core.$strip>]>>>;
294
- agents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
295
- provider: z.ZodOptional<z.ZodString>;
296
- model: z.ZodOptional<z.ZodString>;
297
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
298
- toolFormat: z.ZodOptional<z.ZodEnum<{
299
- native: "native";
300
- "polka-codes": "polka-codes";
301
- }>>;
302
- initialContext: z.ZodOptional<z.ZodObject<{
303
- maxFileCount: z.ZodOptional<z.ZodNumber>;
304
- excludes: z.ZodOptional<z.ZodArray<z.ZodString>>;
305
- }, z.core.$strip>>;
306
- retryCount: z.ZodOptional<z.ZodNumber>;
307
- requestTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
308
- }, z.core.$strip>>>;
309
63
  commands: z.ZodOptional<z.ZodObject<{
310
64
  default: z.ZodOptional<z.ZodObject<{
311
65
  provider: z.ZodOptional<z.ZodString>;
312
66
  model: z.ZodOptional<z.ZodString>;
313
67
  parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
314
- toolFormat: z.ZodOptional<z.ZodEnum<{
315
- native: "native";
316
- "polka-codes": "polka-codes";
317
- }>>;
318
68
  }, z.core.$strip>>;
319
69
  }, z.core.$catchall<z.ZodObject<{
320
70
  provider: z.ZodOptional<z.ZodString>;
321
71
  model: z.ZodOptional<z.ZodString>;
322
72
  parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
323
- toolFormat: z.ZodOptional<z.ZodEnum<{
324
- native: "native";
325
- "polka-codes": "polka-codes";
326
- }>>;
327
73
  }, z.core.$strip>>>>;
328
74
  rules: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodArray<z.ZodString>>, z.ZodString]>>;
329
75
  excludeFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
330
- policies: z.ZodOptional<z.ZodArray<z.ZodString>>;
331
76
  }, z.core.$strict>;
332
77
  export { configSchema }
333
78
  export { configSchema as configSchema_alias_1 }
334
79
 
335
- declare const customInstructions: (customInstructions: string[]) => string;
336
- export { customInstructions }
337
- export { customInstructions as customInstructions_alias_1 }
338
- export { customInstructions as customInstructions_alias_2 }
339
-
340
- declare const customScripts: (commands: Record<string, string | {
341
- command: string;
342
- description: string;
343
- }>) => string;
344
- export { customScripts }
345
- export { customScripts as customScripts_alias_1 }
346
- export { customScripts as customScripts_alias_2 }
347
-
348
80
  declare const _default: {
349
81
  handler: ToolHandler<{
350
- readonly name: "ask_followup_question";
351
- readonly description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
82
+ readonly name: "appendMemory";
83
+ readonly description: "Appends content to a memory topic.";
352
84
  readonly parameters: z.ZodObject<{
353
- questions: z.ZodArray<z.ZodObject<{
354
- prompt: z.ZodString;
355
- options: z.ZodDefault<z.ZodArray<z.ZodString>>;
356
- }, z.core.$strip>>;
85
+ topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
86
+ content: z.ZodString;
357
87
  }, z.core.$strip>;
358
- }, InteractionProvider>;
359
- isAvailable: (provider: InteractionProvider) => boolean;
360
- name: "ask_followup_question";
361
- description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
88
+ }, MemoryProvider>;
89
+ name: "appendMemory";
90
+ description: "Appends content to a memory topic.";
362
91
  parameters: z.ZodObject<{
363
- questions: z.ZodArray<z.ZodObject<{
364
- prompt: z.ZodString;
365
- options: z.ZodDefault<z.ZodArray<z.ZodString>>;
366
- }, z.core.$strip>>;
92
+ topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
+ content: z.ZodString;
367
94
  }, z.core.$strip>;
368
95
  };
369
- export { _default as askFollowupQuestion }
370
- export { _default as askFollowupQuestion_alias_1 }
96
+ export { _default as appendMemory }
97
+ export { _default as appendMemory_alias_1 }
371
98
  export { _default as default_alias }
372
99
 
373
100
  declare const _default_10: {
374
101
  handler: ToolHandler<{
375
- readonly name: "remove_file";
102
+ readonly name: "removeFile";
376
103
  readonly description: "Request to remove a file at the specified path.";
377
104
  readonly parameters: z.ZodObject<{
378
105
  path: z.ZodString;
379
106
  }, z.core.$strip>;
380
107
  }, FilesystemProvider>;
381
- isAvailable: (provider: FilesystemProvider) => boolean;
382
- name: "remove_file";
108
+ name: "removeFile";
383
109
  description: "Request to remove a file at the specified path.";
384
110
  parameters: z.ZodObject<{
385
111
  path: z.ZodString;
@@ -391,49 +117,85 @@ export { _default_10 as removeFile_alias_1 }
391
117
 
392
118
  declare const _default_11: {
393
119
  handler: ToolHandler<{
394
- readonly name: "rename_file";
120
+ readonly name: "removeMemory";
121
+ readonly description: "Removes a topic from memory.";
122
+ readonly parameters: z.ZodObject<{
123
+ topic: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>;
125
+ }, MemoryProvider>;
126
+ name: "removeMemory";
127
+ description: "Removes a topic from memory.";
128
+ parameters: z.ZodObject<{
129
+ topic: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strip>;
131
+ };
132
+ export { _default_11 as default_alias_10 }
133
+ export { _default_11 as removeMemory }
134
+ export { _default_11 as removeMemory_alias_1 }
135
+
136
+ declare const _default_12: {
137
+ handler: ToolHandler<{
138
+ readonly name: "renameFile";
395
139
  readonly description: "Request to rename a file from source path to target path.";
396
140
  readonly parameters: z.ZodObject<{
397
141
  source_path: z.ZodString;
398
142
  target_path: z.ZodString;
399
143
  }, z.core.$strip>;
400
144
  }, FilesystemProvider>;
401
- isAvailable: (provider: FilesystemProvider) => boolean;
402
- name: "rename_file";
145
+ name: "renameFile";
403
146
  description: "Request to rename a file from source path to target path.";
404
147
  parameters: z.ZodObject<{
405
148
  source_path: z.ZodString;
406
149
  target_path: z.ZodString;
407
150
  }, z.core.$strip>;
408
151
  };
409
- export { _default_11 as default_alias_10 }
410
- export { _default_11 as renameFile }
411
- export { _default_11 as renameFile_alias_1 }
152
+ export { _default_12 as default_alias_11 }
153
+ export { _default_12 as renameFile }
154
+ export { _default_12 as renameFile_alias_1 }
412
155
 
413
- declare const _default_12: {
156
+ declare const _default_13: {
414
157
  handler: ToolHandler<{
415
- readonly name: "replace_in_file";
158
+ readonly name: "replaceInFile";
416
159
  readonly description: "Request to replace sections of content in an existing file using SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.";
417
160
  readonly parameters: z.ZodObject<{
418
161
  path: z.ZodString;
419
162
  diff: z.ZodString;
420
163
  }, z.core.$strip>;
421
164
  }, FilesystemProvider>;
422
- isAvailable: (provider: FilesystemProvider) => boolean;
423
- name: "replace_in_file";
165
+ name: "replaceInFile";
424
166
  description: "Request to replace sections of content in an existing file using SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.";
425
167
  parameters: z.ZodObject<{
426
168
  path: z.ZodString;
427
169
  diff: z.ZodString;
428
170
  }, z.core.$strip>;
429
171
  };
430
- export { _default_12 as default_alias_11 }
431
- export { _default_12 as replaceInFile }
432
- export { _default_12 as replaceInFile_alias_1 }
172
+ export { _default_13 as default_alias_12 }
173
+ export { _default_13 as replaceInFile }
174
+ export { _default_13 as replaceInFile_alias_1 }
433
175
 
434
- declare const _default_13: {
176
+ declare const _default_14: {
435
177
  handler: ToolHandler<{
436
- readonly name: "search_files";
178
+ readonly name: "replaceMemory";
179
+ readonly description: "Replaces content of a memory topic.";
180
+ readonly parameters: z.ZodObject<{
181
+ topic: z.ZodOptional<z.ZodString>;
182
+ content: z.ZodString;
183
+ }, z.core.$strip>;
184
+ }, MemoryProvider>;
185
+ name: "replaceMemory";
186
+ description: "Replaces content of a memory topic.";
187
+ parameters: z.ZodObject<{
188
+ topic: z.ZodOptional<z.ZodString>;
189
+ content: z.ZodString;
190
+ }, z.core.$strip>;
191
+ };
192
+ export { _default_14 as default_alias_13 }
193
+ export { _default_14 as replaceMemory }
194
+ export { _default_14 as replaceMemory_alias_1 }
195
+
196
+ declare const _default_15: {
197
+ handler: ToolHandler<{
198
+ readonly name: "searchFiles";
437
199
  readonly description: "Request to perform a regex search across files in a specified directory, outputting context-rich results that include surrounding lines. This tool searches for patterns or specific content across multiple files, displaying each match with encapsulating context.";
438
200
  readonly parameters: z.ZodObject<{
439
201
  path: z.ZodString;
@@ -441,8 +203,7 @@ declare const _default_13: {
441
203
  filePattern: z.ZodOptional<z.ZodString>;
442
204
  }, z.core.$strip>;
443
205
  }, FilesystemProvider>;
444
- isAvailable: (provider: FilesystemProvider) => boolean;
445
- name: "search_files";
206
+ name: "searchFiles";
446
207
  description: "Request to perform a regex search across files in a specified directory, outputting context-rich results that include surrounding lines. This tool searches for patterns or specific content across multiple files, displaying each match with encapsulating context.";
447
208
  parameters: z.ZodObject<{
448
209
  path: z.ZodString;
@@ -450,143 +211,95 @@ declare const _default_13: {
450
211
  filePattern: z.ZodOptional<z.ZodString>;
451
212
  }, z.core.$strip>;
452
213
  };
453
- export { _default_13 as default_alias_12 }
454
- export { _default_13 as searchFiles }
455
- export { _default_13 as searchFiles_alias_1 }
214
+ export { _default_15 as default_alias_14 }
215
+ export { _default_15 as searchFiles }
216
+ export { _default_15 as searchFiles_alias_1 }
456
217
 
457
- declare const _default_14: {
218
+ declare const _default_16: {
458
219
  handler: ToolHandler<{
459
- readonly name: "write_to_file";
220
+ readonly name: "writeToFile";
460
221
  readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
461
222
  readonly parameters: z.ZodObject<{
462
223
  path: z.ZodString;
463
224
  content: z.ZodString;
464
225
  }, z.core.$strip>;
465
226
  }, FilesystemProvider>;
466
- isAvailable: (provider: FilesystemProvider) => boolean;
467
- name: "write_to_file";
227
+ name: "writeToFile";
468
228
  description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
469
229
  parameters: z.ZodObject<{
470
230
  path: z.ZodString;
471
231
  content: z.ZodString;
472
232
  }, z.core.$strip>;
473
233
  };
474
- export { _default_14 as default_alias_13 }
475
- export { _default_14 as writeToFile }
476
- export { _default_14 as writeToFile_alias_1 }
234
+ export { _default_16 as default_alias_15 }
235
+ export { _default_16 as writeToFile }
236
+ export { _default_16 as writeToFile_alias_1 }
477
237
 
478
238
  declare const _default_2: {
479
239
  handler: ToolHandler<{
480
- readonly name: "attempt_completion";
481
- readonly description: "Use this tool when you believe the user’s requested task is complete. Indicate that your work is finished, but acknowledge the user may still provide additional instructions or questions if they want to continue. This tool MUST NOT to be used with any other tool.";
240
+ readonly name: "askFollowupQuestion";
241
+ readonly description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
482
242
  readonly parameters: z.ZodObject<{
483
- result: z.ZodString;
243
+ questions: z.ZodArray<z.ZodObject<{
244
+ prompt: z.ZodString;
245
+ options: z.ZodDefault<z.ZodArray<z.ZodString>>;
246
+ }, z.core.$strip>>;
484
247
  }, z.core.$strip>;
485
248
  }, InteractionProvider>;
486
- isAvailable: (_provider: InteractionProvider) => boolean;
487
- name: "attempt_completion";
488
- description: "Use this tool when you believe the user’s requested task is complete. Indicate that your work is finished, but acknowledge the user may still provide additional instructions or questions if they want to continue. This tool MUST NOT to be used with any other tool.";
249
+ name: "askFollowupQuestion";
250
+ description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
489
251
  parameters: z.ZodObject<{
490
- result: z.ZodString;
252
+ questions: z.ZodArray<z.ZodObject<{
253
+ prompt: z.ZodString;
254
+ options: z.ZodDefault<z.ZodArray<z.ZodString>>;
255
+ }, z.core.$strip>>;
491
256
  }, z.core.$strip>;
492
257
  };
493
- export { _default_2 as attemptCompletion }
494
- export { _default_2 as attemptCompletion_alias_1 }
258
+ export { _default_2 as askFollowupQuestion }
259
+ export { _default_2 as askFollowupQuestion_alias_1 }
495
260
  export { _default_2 as default_alias_1 }
496
261
 
497
262
  declare const _default_3: {
498
263
  handler: ToolHandler<{
499
- readonly name: "delegate";
500
- readonly description: "Temporarily delegate a task to another agent and receive the result back. This tool MUST NOT to be used with any other tool.";
501
- readonly parameters: z.ZodObject<{
502
- agentName: z.ZodString;
503
- task: z.ZodString;
504
- context: z.ZodString;
505
- files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
506
- }, z.core.$strip>;
507
- }, any>;
508
- isAvailable: (_provider: any) => boolean;
509
- name: "delegate";
510
- description: "Temporarily delegate a task to another agent and receive the result back. This tool MUST NOT to be used with any other tool.";
511
- parameters: z.ZodObject<{
512
- agentName: z.ZodString;
513
- task: z.ZodString;
514
- context: z.ZodString;
515
- files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
516
- }, z.core.$strip>;
517
- };
518
- export { _default_3 as default_alias_2 }
519
- export { _default_3 as delegate }
520
- export { _default_3 as delegate_alias_1 }
521
-
522
- declare const _default_4: {
523
- handler: ToolHandler<{
524
- readonly name: "execute_command";
264
+ readonly name: "executeCommand";
525
265
  readonly description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. **IMPORTANT**: After an `execute_command` call, you MUST stop and NOT allowed to make further tool calls in the same message.";
526
266
  readonly parameters: z.ZodObject<{
527
267
  command: z.ZodString;
528
268
  requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
529
269
  }, z.core.$strip>;
530
270
  }, CommandProvider>;
531
- isAvailable: (provider: CommandProvider) => boolean;
532
- name: "execute_command";
271
+ name: "executeCommand";
533
272
  description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. **IMPORTANT**: After an `execute_command` call, you MUST stop and NOT allowed to make further tool calls in the same message.";
534
273
  parameters: z.ZodObject<{
535
274
  command: z.ZodString;
536
275
  requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
537
276
  }, z.core.$strip>;
538
277
  };
539
- export { _default_4 as default_alias_3 }
540
- export { _default_4 as executeCommand }
541
- export { _default_4 as executeCommand_alias_1 }
278
+ export { _default_3 as default_alias_2 }
279
+ export { _default_3 as executeCommand }
280
+ export { _default_3 as executeCommand_alias_1 }
542
281
 
543
- declare const _default_5: {
282
+ declare const _default_4: {
544
283
  handler: ToolHandler<{
545
- readonly name: "fetch_url";
284
+ readonly name: "fetchUrl";
546
285
  readonly description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
547
286
  readonly parameters: z.ZodObject<{
548
287
  url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
549
288
  }, z.core.$strip>;
550
289
  }, WebProvider>;
551
- isAvailable: (provider: WebProvider) => boolean;
552
- name: "fetch_url";
290
+ name: "fetchUrl";
553
291
  description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
554
292
  parameters: z.ZodObject<{
555
293
  url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
556
294
  }, z.core.$strip>;
557
295
  };
558
- export { _default_5 as default_alias_4 }
559
- export { _default_5 as fetchUrl }
560
- export { _default_5 as fetchUrl_alias_1 }
561
-
562
- declare const _default_6: {
563
- handler: ToolHandler<{
564
- readonly name: "hand_over";
565
- readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
566
- readonly parameters: z.ZodObject<{
567
- agentName: z.ZodString;
568
- task: z.ZodString;
569
- context: z.ZodString;
570
- files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
571
- }, z.core.$strip>;
572
- }, any>;
573
- isAvailable: (_provider: any) => boolean;
574
- name: "hand_over";
575
- description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
576
- parameters: z.ZodObject<{
577
- agentName: z.ZodString;
578
- task: z.ZodString;
579
- context: z.ZodString;
580
- files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
581
- }, z.core.$strip>;
582
- };
583
- export { _default_6 as default_alias_5 }
584
- export { _default_6 as handOver }
585
- export { _default_6 as handOver_alias_1 }
296
+ export { _default_4 as default_alias_3 }
297
+ export { _default_4 as fetchUrl }
298
+ export { _default_4 as fetchUrl_alias_1 }
586
299
 
587
- declare const _default_7: {
300
+ declare const _default_5: {
588
301
  handler: ToolHandler<{
589
- readonly name: "list_files";
302
+ readonly name: "listFiles";
590
303
  readonly description: "Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.";
591
304
  readonly parameters: z.ZodObject<{
592
305
  path: z.ZodString;
@@ -595,8 +308,7 @@ declare const _default_7: {
595
308
  includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
596
309
  }, z.core.$strip>;
597
310
  }, FilesystemProvider>;
598
- isAvailable: (provider: FilesystemProvider) => boolean;
599
- name: "list_files";
311
+ name: "listFiles";
600
312
  description: "Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.";
601
313
  parameters: z.ZodObject<{
602
314
  path: z.ZodString;
@@ -605,49 +317,79 @@ declare const _default_7: {
605
317
  includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
606
318
  }, z.core.$strip>;
607
319
  };
608
- export { _default_7 as default_alias_6 }
609
- export { _default_7 as listFiles }
610
- export { _default_7 as listFiles_alias_1 }
320
+ export { _default_5 as default_alias_4 }
321
+ export { _default_5 as listFiles }
322
+ export { _default_5 as listFiles_alias_1 }
611
323
 
612
- declare const _default_8: {
324
+ declare const _default_6: {
325
+ handler: ToolHandler<{
326
+ readonly name: "listMemoryTopics";
327
+ readonly description: "Lists all topics in memory.";
328
+ readonly parameters: z.ZodObject<{}, z.core.$strip>;
329
+ }, MemoryProvider>;
330
+ name: "listMemoryTopics";
331
+ description: "Lists all topics in memory.";
332
+ parameters: z.ZodObject<{}, z.core.$strip>;
333
+ };
334
+ export { _default_6 as default_alias_5 }
335
+ export { _default_6 as listMemoryTopics }
336
+ export { _default_6 as listMemoryTopics_alias_1 }
337
+
338
+ declare const _default_7: {
613
339
  handler: ToolHandler<{
614
- readonly name: "read_binary_file";
340
+ readonly name: "readBinaryFile";
615
341
  readonly description: "Read a binary file from a URL or local path. Use file:// prefix to access local files. This can be used to access non-text files such as PDFs or images.";
616
342
  readonly parameters: z.ZodObject<{
617
343
  url: z.ZodString;
618
344
  }, z.core.$strip>;
619
345
  }, FilesystemProvider>;
620
- isAvailable: (provider: FilesystemProvider) => boolean;
621
- name: "read_binary_file";
346
+ name: "readBinaryFile";
622
347
  description: "Read a binary file from a URL or local path. Use file:// prefix to access local files. This can be used to access non-text files such as PDFs or images.";
623
348
  parameters: z.ZodObject<{
624
349
  url: z.ZodString;
625
350
  }, z.core.$strip>;
626
351
  };
627
- export { _default_8 as default_alias_7 }
628
- export { _default_8 as readBinaryFile }
629
- export { _default_8 as readBinaryFile_alias_1 }
352
+ export { _default_7 as default_alias_6 }
353
+ export { _default_7 as readBinaryFile }
354
+ export { _default_7 as readBinaryFile_alias_1 }
630
355
 
631
- declare const _default_9: {
356
+ declare const _default_8: {
632
357
  handler: ToolHandler<{
633
- readonly name: "read_file";
358
+ readonly name: "readFile";
634
359
  readonly description: "Request to read the contents of one or multiple files at the specified paths. Use comma separated paths to read multiple files. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. May not be suitable for other types of binary files, as it returns the raw content as a string. Try to list all the potential files are relevent to the task, and then use this tool to read all the relevant files.";
635
360
  readonly parameters: z.ZodObject<{
636
361
  path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
637
362
  includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
638
363
  }, z.core.$strip>;
639
364
  }, FilesystemProvider>;
640
- isAvailable: (provider: FilesystemProvider) => boolean;
641
- name: "read_file";
365
+ name: "readFile";
642
366
  description: "Request to read the contents of one or multiple files at the specified paths. Use comma separated paths to read multiple files. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. May not be suitable for other types of binary files, as it returns the raw content as a string. Try to list all the potential files are relevent to the task, and then use this tool to read all the relevant files.";
643
367
  parameters: z.ZodObject<{
644
368
  path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
645
369
  includeIgnored: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
646
370
  }, z.core.$strip>;
647
371
  };
372
+ export { _default_8 as default_alias_7 }
373
+ export { _default_8 as readFile }
374
+ export { _default_8 as readFile_alias_1 }
375
+
376
+ declare const _default_9: {
377
+ handler: ToolHandler<{
378
+ readonly name: "readMemory";
379
+ readonly description: "Reads content from a memory topic.";
380
+ readonly parameters: z.ZodObject<{
381
+ topic: z.ZodOptional<z.ZodString>;
382
+ }, z.core.$strip>;
383
+ }, MemoryProvider>;
384
+ name: "readMemory";
385
+ description: "Reads content from a memory topic.";
386
+ parameters: z.ZodObject<{
387
+ topic: z.ZodOptional<z.ZodString>;
388
+ }, z.core.$strip>;
389
+ };
648
390
  export { _default_9 as default_alias_8 }
649
- export { _default_9 as readFile }
650
- export { _default_9 as readFile_alias_1 }
391
+ export { _default_9 as readMemory }
392
+ export { _default_9 as readMemory_alias_1 }
651
393
 
652
394
  /**
653
395
  * Returns the directory portion of a path string.
@@ -655,28 +397,6 @@ export { _default_9 as readFile_alias_1 }
655
397
  */
656
398
  export declare function dirname(path: string): string;
657
399
 
658
- export declare const editingFilesPrompt: (toolNamePrefix: string) => string;
659
-
660
- declare const EnableCachePolicy: AgentPolicy;
661
- export { EnableCachePolicy }
662
- export { EnableCachePolicy as EnableCachePolicy_alias_1 }
663
- export { EnableCachePolicy as EnableCachePolicy_alias_2 }
664
- export { EnableCachePolicy as EnableCachePolicy_alias_3 }
665
-
666
- declare type ExitReason = {
667
- type: 'UsageExceeded';
668
- } | {
669
- type: 'WaitForUserInput';
670
- } | {
671
- type: 'Aborted';
672
- } | ToolResponseExit | ToolResponseInterrupted | ToolResponseHandOver | ToolResponseDelegate | {
673
- type: 'Pause';
674
- responses: ToolResponseOrToolPause[];
675
- };
676
- export { ExitReason }
677
- export { ExitReason as ExitReason_alias_1 }
678
- export { ExitReason as ExitReason_alias_2 }
679
-
680
400
  declare type FilesystemProvider = {
681
401
  readFile?: (path: string, includeIgnored: boolean) => Promise<string | undefined>;
682
402
  writeFile?: (path: string, content: string) => Promise<void>;
@@ -693,142 +413,67 @@ export { FilesystemProvider }
693
413
  export { FilesystemProvider as FilesystemProvider_alias_1 }
694
414
  export { FilesystemProvider as FilesystemProvider_alias_2 }
695
415
 
696
- export declare const fullSystemPrompt: (info: {
697
- os: string;
698
- }, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
699
- command: string;
700
- description: string;
701
- }>, useNativeTool: boolean) => string;
702
-
703
- export declare const fullSystemPrompt_alias_1: (info: {
704
- os: string;
705
- }, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
706
- command: string;
707
- description: string;
708
- }>, useNativeTool: boolean) => string;
709
-
710
- export declare const fullSystemPrompt_alias_2: (info: {
711
- os: string;
712
- }, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
713
- command: string;
714
- description: string;
715
- }>, useNativeTool: boolean) => string;
716
-
717
- export declare const fullSystemPrompt_alias_3: (info: {
718
- os: string;
719
- }, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
720
- command: string;
721
- description: string;
722
- }>, useNativeTool: boolean) => string;
723
-
724
416
  declare type FullToolInfo = ToolInfo & {
725
417
  handler: ToolHandler<ToolInfo, any>;
726
- isAvailable: (provider: any) => boolean;
727
418
  };
728
419
  export { FullToolInfo }
729
420
  export { FullToolInfo as FullToolInfo_alias_1 }
730
421
 
731
- declare type FullToolInfoV2 = ToolInfoV2 & {
732
- handler: ToolHandler<ToolInfoV2, any>;
733
- isAvailable: (provider: any) => boolean;
734
- };
735
- export { FullToolInfoV2 }
736
- export { FullToolInfoV2 as FullToolInfoV2_alias_1 }
737
-
738
- export declare const getArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>> | ToolParameterValue, name: T, defaultValue?: ToolParameterValue[]) => ToolParameterValue[];
739
-
740
- /**
741
- * Get the available tools based on the provider and agent availability
742
- * @param provider The provider to use.
743
- * @param allTools All possible tools.
744
- * @param hasAgent Whether the agent has agents.
745
- * @returns The available tools
746
- */
747
- declare const getAvailableTools: <T extends FullToolInfoV2 | FullToolInfo>({ provider, allTools, hasAgent, }: {
748
- provider: any;
749
- allTools: T[];
750
- hasAgent: boolean;
751
- }) => T[];
752
- export { getAvailableTools }
753
- export { getAvailableTools as getAvailableTools_alias_1 }
754
-
755
- export declare const getBoolean: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: boolean) => boolean;
756
-
757
- export declare const getInt: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: number) => number;
758
-
759
- export declare const getString: <T extends string>(args: Partial<Record<T, string>> | ToolParameterValue, name: T, defaultValue?: string) => string;
760
-
761
- export declare const getStringArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: string[]) => string[];
762
-
763
- export declare const handler: ToolHandler<typeof toolInfo, InteractionProvider>;
422
+ export declare const handler: ToolHandler<typeof toolInfo, MemoryProvider>;
764
423
 
765
424
  export declare const handler_alias_1: ToolHandler<typeof toolInfo_alias_1, InteractionProvider>;
766
425
 
767
- export declare const handler_alias_10: ToolHandler<typeof toolInfo_alias_10, FilesystemProvider>;
426
+ export declare const handler_alias_10: ToolHandler<typeof toolInfo_alias_10, MemoryProvider>;
768
427
 
769
428
  export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, FilesystemProvider>;
770
429
 
771
430
  export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12, FilesystemProvider>;
772
431
 
773
- export declare const handler_alias_13: ToolHandler<typeof toolInfo_alias_13, FilesystemProvider>;
432
+ export declare const handler_alias_13: ToolHandler<typeof toolInfo_alias_13, MemoryProvider>;
433
+
434
+ export declare const handler_alias_14: ToolHandler<typeof toolInfo_alias_14, FilesystemProvider>;
774
435
 
775
- export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, any>;
436
+ export declare const handler_alias_15: ToolHandler<typeof toolInfo_alias_15, FilesystemProvider>;
776
437
 
777
- export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, CommandProvider>;
438
+ export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, CommandProvider>;
778
439
 
779
- export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, WebProvider>;
440
+ export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, WebProvider>;
780
441
 
781
- export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, any>;
442
+ export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, FilesystemProvider>;
443
+
444
+ export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, MemoryProvider>;
782
445
 
783
446
  export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6, FilesystemProvider>;
784
447
 
785
448
  export declare const handler_alias_7: ToolHandler<typeof toolInfo_alias_7, FilesystemProvider>;
786
449
 
787
- export declare const handler_alias_8: ToolHandler<typeof toolInfo_alias_8, FilesystemProvider>;
450
+ export declare const handler_alias_8: ToolHandler<typeof toolInfo_alias_8, MemoryProvider>;
788
451
 
789
452
  export declare const handler_alias_9: ToolHandler<typeof toolInfo_alias_9, FilesystemProvider>;
790
453
 
791
454
  declare type InteractionProvider = {
792
455
  askFollowupQuestion?: (question: string, options: string[]) => Promise<string>;
793
- attemptCompletion?: (result: string) => Promise<string | undefined>;
794
456
  };
795
457
  export { InteractionProvider }
796
458
  export { InteractionProvider as InteractionProvider_alias_1 }
797
459
  export { InteractionProvider as InteractionProvider_alias_2 }
798
460
 
799
- export declare const isAvailable: (provider: InteractionProvider) => boolean;
800
-
801
- export declare const isAvailable_alias_1: (_provider: InteractionProvider) => boolean;
802
-
803
- export declare const isAvailable_alias_10: (provider: FilesystemProvider) => boolean;
804
-
805
- export declare const isAvailable_alias_11: (provider: FilesystemProvider) => boolean;
806
-
807
- export declare const isAvailable_alias_12: (provider: FilesystemProvider) => boolean;
808
-
809
- export declare const isAvailable_alias_13: (provider: FilesystemProvider) => boolean;
810
-
811
- export declare const isAvailable_alias_2: (_provider: any) => boolean;
812
-
813
- export declare const isAvailable_alias_3: (provider: CommandProvider) => boolean;
814
-
815
- export declare const isAvailable_alias_4: (provider: WebProvider) => boolean;
816
-
817
- export declare const isAvailable_alias_5: (_provider: any) => boolean;
818
-
819
- export declare const isAvailable_alias_6: (provider: FilesystemProvider) => boolean;
820
-
821
- export declare const isAvailable_alias_7: (provider: FilesystemProvider) => boolean;
822
-
823
- export declare const isAvailable_alias_8: (provider: FilesystemProvider) => boolean;
824
-
825
- export declare const isAvailable_alias_9: (provider: FilesystemProvider) => boolean;
826
-
827
461
  /**
828
462
  * Joins all given path segments, then normalizes the result.
829
463
  */
830
464
  export declare function join(...parts: string[]): string;
831
465
 
466
+ declare interface MemoryProvider {
467
+ listMemoryTopics: () => Promise<string[]>;
468
+ readMemory: (topic?: string) => Promise<string | undefined>;
469
+ appendMemory: (topic: string | undefined, content: string) => Promise<void>;
470
+ replaceMemory: (topic: string | undefined, content: string) => Promise<void>;
471
+ removeMemory: (topic: string | undefined) => Promise<void>;
472
+ }
473
+ export { MemoryProvider }
474
+ export { MemoryProvider as MemoryProvider_alias_1 }
475
+ export { MemoryProvider as MemoryProvider_alias_2 }
476
+
832
477
  declare class MockProvider implements ToolProvider {
833
478
  readFile(_path: string, _includeIgnored?: boolean): Promise<string>;
834
479
  writeFile(_path: string, _content: string): Promise<void>;
@@ -843,7 +488,6 @@ declare class MockProvider implements ToolProvider {
843
488
  summary?: string;
844
489
  }>;
845
490
  askFollowupQuestion(_question: string, _options?: string[]): Promise<string>;
846
- attemptCompletion(_result: string): Promise<string | undefined>;
847
491
  }
848
492
  export { MockProvider }
849
493
  export { MockProvider as MockProvider_alias_1 }
@@ -858,99 +502,6 @@ declare type ModelInfo = {
858
502
  export { ModelInfo }
859
503
  export { ModelInfo as ModelInfo_alias_1 }
860
504
 
861
- declare class MultiAgent {
862
- #private;
863
- constructor(config: MultiAgentConfig);
864
- startTask(options: {
865
- agentName: string;
866
- task: string;
867
- context: string;
868
- files?: (ImagePart | FilePart)[];
869
- }): Promise<ExitReason>;
870
- continueTask(userMessage: UserContent_2): Promise<ExitReason>;
871
- get hasActiveAgent(): boolean;
872
- abort(): void;
873
- }
874
- export { MultiAgent }
875
- export { MultiAgent as MultiAgent_alias_1 }
876
- export { MultiAgent as MultiAgent_alias_2 }
877
-
878
- declare type MultiAgentConfig = {
879
- createAgent: (name: string) => Promise<AgentBase>;
880
- getPrompt?: (name: string, task: string, context: string | undefined, files: string[] | undefined, originalTask: string | undefined) => Promise<string>;
881
- };
882
- export { MultiAgentConfig }
883
- export { MultiAgentConfig as MultiAgentConfig_alias_1 }
884
- export { MultiAgentConfig as MultiAgentConfig_alias_2 }
885
-
886
- export declare const objectives: (toolNamePrefix: string) => string;
887
-
888
- /**
889
- * Parse an assistant's message into an array of text content and tool use content.
890
- *
891
- * @example
892
- * const tools = [
893
- * {
894
- * name: "search",
895
- * parameters: [
896
- * {name: "query", type: "string"}
897
- * ]
898
- * }
899
- * ]
900
- *
901
- * // Text only
902
- * parseAssistantMessage("Hello world", tools, "tool_")
903
- * // Returns: [{type: "text", content: "Hello world"}]
904
- *
905
- * // Tool use with parameters
906
- * parseAssistantMessage(
907
- * `Let me search that for you
908
- * <tool_search>
909
- * <tool_parameter_query>cats</tool_parameter_query>
910
- * </tool_search>
911
- * Here are the results`,
912
- * tools,
913
- * "tool_"
914
- * )
915
- * // Returns: [
916
- * // {type: "text", content: "Let me search that for you"},
917
- * // {type: "tool_use", name: "search", params: {query: "cats"}},
918
- * // {type: "text", content: "Here are the results"}
919
- * // ]
920
- *
921
- * // Array mode (multiple occurrences of the same parameter)
922
- * parseAssistantMessage(
923
- * `<tool_read_file>
924
- * <tool_parameter_path>test.ts</tool_parameter_path>
925
- * <tool_parameter_path>main.ts</tool_parameter_path>
926
- * </tool_read_file>`,
927
- * tools,
928
- * "tool_"
929
- * )
930
- * // Returns: [
931
- * // {type: "tool_use", name: "read_file", params: {path: ["test.ts", "main.ts"]}}
932
- * // ]
933
- *
934
- * // Nested objects
935
- * parseAssistantMessage(
936
- * `<tool_example>
937
- * <tool_parameter_key>
938
- * <tool_parameter_key2>value</tool_parameter_key2>
939
- * <tool_parameter_key3>value2</tool_parameter_key3>
940
- * </tool_parameter_key>
941
- * </tool_example>`,
942
- * tools,
943
- * "tool_"
944
- * )
945
- * // Returns: [
946
- * // {type: "tool_use", name: "example", params: {key: {key2: "value", key3: "value2"}}}
947
- * // ]
948
- */
949
- declare function parseAssistantMessage(assistantMessage: string, tools: ToolInfo[], toolNamePrefix: string): AssistantMessageContent[];
950
- export { parseAssistantMessage }
951
- export { parseAssistantMessage as parseAssistantMessage_alias_1 }
952
- export { parseAssistantMessage as parseAssistantMessage_alias_2 }
953
-
954
505
  declare const parseJsonFromMarkdown: (markdown: string) => ParseOutputResult<any>;
955
506
  export { parseJsonFromMarkdown }
956
507
  export { parseJsonFromMarkdown as parseJsonFromMarkdown_alias_1 }
@@ -967,13 +518,6 @@ export { ParseOutputResult }
967
518
  export { ParseOutputResult as ParseOutputResult_alias_1 }
968
519
  export { ParseOutputResult as ParseOutputResult_alias_2 }
969
520
 
970
- declare enum Policies {
971
- TruncateContext = "truncatecontext",
972
- EnableCache = "enablecache"
973
- }
974
- export { Policies }
975
- export { Policies as Policies_alias_1 }
976
-
977
521
  declare const replaceInFile_2: (fileContent: string, diff: string) => ReplaceResult;
978
522
  export { replaceInFile_2 as replaceInFileHelper }
979
523
  export { replaceInFile_2 as replaceInFile_alias_2 }
@@ -999,238 +543,6 @@ export { responsePrompts }
999
543
  export { responsePrompts as responsePrompts_alias_1 }
1000
544
  export { responsePrompts as responsePrompts_alias_2 }
1001
545
 
1002
- export declare const retryGuidelines = "\n====\n\nRETRY GUIDELINES\n\n1. Before Retrying\n - Analyze previous attempt's failure\n - Consider alternative approaches\n - Check if similar issues were fixed\n - Verify no new issues were introduced\n\n2. When to Retry\n - Error message changed but issue persists\n - New information available about the root cause\n - Different fixing strategy available\n - Previous attempt partially successful\n\n3. When to Stop\n - Maximum retry limit reached\n - Same error occurs repeatedly\n - Fix would require major refactoring\n - Issue requires human intervention\n\n4. After Maximum Retries\n - Document attempted solutions\n - Explain why the issue remains\n - Suggest manual intervention steps\n - Report any partial improvements";
1003
-
1004
- export declare const rules: (toolNamePrefix: string) => string;
1005
-
1006
- declare type SharedAgentOptions = {
1007
- ai: LanguageModelV2;
1008
- os: string;
1009
- provider: ToolProvider;
1010
- additionalTools?: FullToolInfoV2[];
1011
- customInstructions?: string[];
1012
- scripts?: Record<string, string | {
1013
- command: string;
1014
- description: string;
1015
- }>;
1016
- agents?: Readonly<AgentInfo[]>;
1017
- callback?: TaskEventCallback;
1018
- policies: AgentPolicy[];
1019
- retryCount?: number;
1020
- requestTimeoutSeconds?: number;
1021
- toolFormat: ToolFormat;
1022
- parameters?: Record<string, any>;
1023
- usageMeter?: UsageMeter;
1024
- requireToolUse?: boolean;
1025
- };
1026
- export { SharedAgentOptions }
1027
- export { SharedAgentOptions as SharedAgentOptions_alias_1 }
1028
- export { SharedAgentOptions as SharedAgentOptions_alias_2 }
1029
-
1030
- declare const systemInformation: (info: {
1031
- os: string;
1032
- }) => string;
1033
- export { systemInformation }
1034
- export { systemInformation as systemInformation_alias_1 }
1035
- export { systemInformation as systemInformation_alias_2 }
1036
-
1037
- /**
1038
- * Union type of all possible task events
1039
- */
1040
- declare type TaskEvent = TaskEventStartTask | TaskEventStartRequest | TaskEventEndRequest | TaskEventUsage | TaskEventText | TaskEventToolUse | TaskEventToolResult | TaskEventToolError | TaskEventToolPause | TaskEventToolHandOverDelegate | TaskEventUsageExceeded | TaskEventEndTask;
1041
- export { TaskEvent }
1042
- export { TaskEvent as TaskEvent_alias_1 }
1043
- export { TaskEvent as TaskEvent_alias_2 }
1044
-
1045
- /**
1046
- * Base interface for all task events
1047
- */
1048
- declare interface TaskEventBase {
1049
- kind: TaskEventKind;
1050
- }
1051
- export { TaskEventBase }
1052
- export { TaskEventBase as TaskEventBase_alias_1 }
1053
- export { TaskEventBase as TaskEventBase_alias_2 }
1054
-
1055
- declare type TaskEventCallback = (event: TaskEvent) => void | Promise<void>;
1056
- export { TaskEventCallback }
1057
- export { TaskEventCallback as TaskEventCallback_alias_1 }
1058
- export { TaskEventCallback as TaskEventCallback_alias_2 }
1059
-
1060
- /**
1061
- * Event for request end
1062
- */
1063
- declare interface TaskEventEndRequest extends TaskEventBase {
1064
- kind: TaskEventKind.EndRequest;
1065
- message: string;
1066
- }
1067
- export { TaskEventEndRequest }
1068
- export { TaskEventEndRequest as TaskEventEndRequest_alias_1 }
1069
- export { TaskEventEndRequest as TaskEventEndRequest_alias_2 }
1070
-
1071
- /**
1072
- * Event for task end
1073
- */
1074
- declare interface TaskEventEndTask extends TaskEventBase {
1075
- kind: TaskEventKind.EndTask;
1076
- exitReason: ExitReason;
1077
- }
1078
- export { TaskEventEndTask }
1079
- export { TaskEventEndTask as TaskEventEndTask_alias_1 }
1080
- export { TaskEventEndTask as TaskEventEndTask_alias_2 }
1081
-
1082
- /**
1083
- * Enum representing different kinds of task events
1084
- */
1085
- declare enum TaskEventKind {
1086
- StartTask = "StartTask",
1087
- StartRequest = "StartRequest",
1088
- EndRequest = "EndRequest",
1089
- Usage = "Usage",
1090
- Text = "Text",
1091
- Reasoning = "Reasoning",
1092
- ToolUse = "ToolUse",
1093
- ToolReply = "ToolReply",
1094
- ToolInvalid = "ToolInvalid",
1095
- ToolError = "ToolError",
1096
- ToolInterrupted = "ToolInterrupted",
1097
- ToolHandOver = "ToolHandOver",
1098
- ToolDelegate = "ToolDelegate",
1099
- ToolPause = "ToolPause",
1100
- UsageExceeded = "UsageExceeded",
1101
- EndTask = "EndTask"
1102
- }
1103
- export { TaskEventKind }
1104
- export { TaskEventKind as TaskEventKind_alias_1 }
1105
- export { TaskEventKind as TaskEventKind_alias_2 }
1106
-
1107
- /**
1108
- * Event for request start
1109
- */
1110
- declare interface TaskEventStartRequest extends TaskEventBase {
1111
- kind: TaskEventKind.StartRequest;
1112
- userMessage: ModelMessage[];
1113
- }
1114
- export { TaskEventStartRequest }
1115
- export { TaskEventStartRequest as TaskEventStartRequest_alias_1 }
1116
- export { TaskEventStartRequest as TaskEventStartRequest_alias_2 }
1117
-
1118
- /**
1119
- * Event for task start
1120
- */
1121
- declare interface TaskEventStartTask extends TaskEventBase {
1122
- kind: TaskEventKind.StartTask;
1123
- systemPrompt: string;
1124
- }
1125
- export { TaskEventStartTask }
1126
- export { TaskEventStartTask as TaskEventStartTask_alias_1 }
1127
- export { TaskEventStartTask as TaskEventStartTask_alias_2 }
1128
-
1129
- /**
1130
- * Event for text/reasoning updates
1131
- */
1132
- declare interface TaskEventText extends TaskEventBase {
1133
- kind: TaskEventKind.Text | TaskEventKind.Reasoning;
1134
- newText: string;
1135
- }
1136
- export { TaskEventText }
1137
- export { TaskEventText as TaskEventText_alias_1 }
1138
- export { TaskEventText as TaskEventText_alias_2 }
1139
-
1140
- declare interface TaskEventToolError extends TaskEventBase {
1141
- kind: TaskEventKind.ToolError;
1142
- tool: string;
1143
- error: ToolResponseError | ToolResponseResult;
1144
- }
1145
- export { TaskEventToolError }
1146
- export { TaskEventToolError as TaskEventToolError_alias_1 }
1147
- export { TaskEventToolError as TaskEventToolError_alias_2 }
1148
-
1149
- /**
1150
- * Event for tool handover
1151
- */
1152
- declare interface TaskEventToolHandOverDelegate extends TaskEventBase {
1153
- kind: TaskEventKind.ToolHandOver | TaskEventKind.ToolDelegate;
1154
- tool: string;
1155
- agentName: string;
1156
- task: string;
1157
- context?: string;
1158
- files?: string[];
1159
- }
1160
- export { TaskEventToolHandOverDelegate }
1161
- export { TaskEventToolHandOverDelegate as TaskEventToolHandOverDelegate_alias_1 }
1162
- export { TaskEventToolHandOverDelegate as TaskEventToolHandOverDelegate_alias_2 }
1163
-
1164
- declare interface TaskEventToolPause extends TaskEventBase {
1165
- kind: TaskEventKind.ToolPause;
1166
- tool: string;
1167
- object: any;
1168
- }
1169
- export { TaskEventToolPause }
1170
- export { TaskEventToolPause as TaskEventToolPause_alias_1 }
1171
- export { TaskEventToolPause as TaskEventToolPause_alias_2 }
1172
-
1173
- declare interface TaskEventToolResult extends TaskEventBase {
1174
- kind: TaskEventKind.ToolReply | TaskEventKind.ToolInvalid | TaskEventKind.ToolInterrupted;
1175
- tool: string;
1176
- content: ToolResponseResult;
1177
- }
1178
- export { TaskEventToolResult }
1179
- export { TaskEventToolResult as TaskEventToolResult_alias_1 }
1180
- export { TaskEventToolResult as TaskEventToolResult_alias_2 }
1181
-
1182
- /**
1183
- * Event for tool-related updates
1184
- */
1185
- declare interface TaskEventToolUse extends TaskEventBase {
1186
- kind: TaskEventKind.ToolUse;
1187
- tool: string;
1188
- params: Record<string, any>;
1189
- }
1190
- export { TaskEventToolUse }
1191
- export { TaskEventToolUse as TaskEventToolUse_alias_1 }
1192
- export { TaskEventToolUse as TaskEventToolUse_alias_2 }
1193
-
1194
- /**
1195
- * Event for API usage updates
1196
- */
1197
- declare interface TaskEventUsage extends TaskEventBase {
1198
- kind: TaskEventKind.Usage;
1199
- usage: LanguageModelUsage;
1200
- }
1201
- export { TaskEventUsage }
1202
- export { TaskEventUsage as TaskEventUsage_alias_1 }
1203
- export { TaskEventUsage as TaskEventUsage_alias_2 }
1204
-
1205
- /**
1206
- * Event for task usage exceeded
1207
- */
1208
- declare interface TaskEventUsageExceeded extends TaskEventBase {
1209
- kind: TaskEventKind.UsageExceeded;
1210
- }
1211
- export { TaskEventUsageExceeded }
1212
- export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_1 }
1213
- export { TaskEventUsageExceeded as TaskEventUsageExceeded_alias_2 }
1214
-
1215
- declare interface TextContent {
1216
- type: 'text';
1217
- content: string;
1218
- }
1219
- export { TextContent }
1220
- export { TextContent as TextContent_alias_1 }
1221
- export { TextContent as TextContent_alias_2 }
1222
-
1223
- declare type ToolExample = {
1224
- description: string;
1225
- input: Record<string, ToolParameterValue>;
1226
- };
1227
- export { ToolExample }
1228
- export { ToolExample as ToolExample_alias_1 }
1229
-
1230
- declare type ToolFormat = 'native' | 'polka-codes';
1231
- export { ToolFormat }
1232
- export { ToolFormat as ToolFormat_alias_1 }
1233
-
1234
546
  declare type ToolHandler<_T, P> = (provider: P, args: Partial<Record<string, ToolParameterValue>>) => Promise<ToolResponse>;
1235
547
  export { ToolHandler }
1236
548
  export { ToolHandler as ToolHandler_alias_1 }
@@ -1238,14 +550,22 @@ export { ToolHandler as ToolHandler_alias_1 }
1238
550
  declare type ToolInfo = {
1239
551
  name: string;
1240
552
  description: string;
1241
- parameters: ToolParameter[];
1242
- examples?: ToolExample[];
553
+ parameters: z.ZodObject<any>;
1243
554
  };
1244
555
  export { ToolInfo }
1245
556
  export { ToolInfo as ToolInfo_alias_1 }
1246
557
 
1247
558
  export declare const toolInfo: {
1248
- readonly name: "ask_followup_question";
559
+ readonly name: "appendMemory";
560
+ readonly description: "Appends content to a memory topic.";
561
+ readonly parameters: z.ZodObject<{
562
+ topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
563
+ content: z.ZodString;
564
+ }, z.core.$strip>;
565
+ };
566
+
567
+ export declare const toolInfo_alias_1: {
568
+ readonly name: "askFollowupQuestion";
1249
569
  readonly description: "Call this when vital details are missing. Pose each follow-up as one direct, unambiguous question. If it speeds the reply, add up to five short, mutually-exclusive answer options. Group any related questions in the same call to avoid a back-and-forth chain.";
1250
570
  readonly parameters: z.ZodObject<{
1251
571
  questions: z.ZodArray<z.ZodObject<{
@@ -1255,16 +575,16 @@ export declare const toolInfo: {
1255
575
  }, z.core.$strip>;
1256
576
  };
1257
577
 
1258
- export declare const toolInfo_alias_1: {
1259
- readonly name: "attempt_completion";
1260
- readonly description: "Use this tool when you believe the user’s requested task is complete. Indicate that your work is finished, but acknowledge the user may still provide additional instructions or questions if they want to continue. This tool MUST NOT to be used with any other tool.";
578
+ export declare const toolInfo_alias_10: {
579
+ readonly name: "removeMemory";
580
+ readonly description: "Removes a topic from memory.";
1261
581
  readonly parameters: z.ZodObject<{
1262
- result: z.ZodString;
582
+ topic: z.ZodOptional<z.ZodString>;
1263
583
  }, z.core.$strip>;
1264
584
  };
1265
585
 
1266
- export declare const toolInfo_alias_10: {
1267
- readonly name: "rename_file";
586
+ export declare const toolInfo_alias_11: {
587
+ readonly name: "renameFile";
1268
588
  readonly description: "Request to rename a file from source path to target path.";
1269
589
  readonly parameters: z.ZodObject<{
1270
590
  source_path: z.ZodString;
@@ -1272,8 +592,8 @@ export declare const toolInfo_alias_10: {
1272
592
  }, z.core.$strip>;
1273
593
  };
1274
594
 
1275
- export declare const toolInfo_alias_11: {
1276
- readonly name: "replace_in_file";
595
+ export declare const toolInfo_alias_12: {
596
+ readonly name: "replaceInFile";
1277
597
  readonly description: "Request to replace sections of content in an existing file using SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.";
1278
598
  readonly parameters: z.ZodObject<{
1279
599
  path: z.ZodString;
@@ -1281,8 +601,17 @@ export declare const toolInfo_alias_11: {
1281
601
  }, z.core.$strip>;
1282
602
  };
1283
603
 
1284
- export declare const toolInfo_alias_12: {
1285
- readonly name: "search_files";
604
+ export declare const toolInfo_alias_13: {
605
+ readonly name: "replaceMemory";
606
+ readonly description: "Replaces content of a memory topic.";
607
+ readonly parameters: z.ZodObject<{
608
+ topic: z.ZodOptional<z.ZodString>;
609
+ content: z.ZodString;
610
+ }, z.core.$strip>;
611
+ };
612
+
613
+ export declare const toolInfo_alias_14: {
614
+ readonly name: "searchFiles";
1286
615
  readonly description: "Request to perform a regex search across files in a specified directory, outputting context-rich results that include surrounding lines. This tool searches for patterns or specific content across multiple files, displaying each match with encapsulating context.";
1287
616
  readonly parameters: z.ZodObject<{
1288
617
  path: z.ZodString;
@@ -1291,8 +620,8 @@ export declare const toolInfo_alias_12: {
1291
620
  }, z.core.$strip>;
1292
621
  };
1293
622
 
1294
- export declare const toolInfo_alias_13: {
1295
- readonly name: "write_to_file";
623
+ export declare const toolInfo_alias_15: {
624
+ readonly name: "writeToFile";
1296
625
  readonly description: "Request to write content to a file at the specified path. If the file exists, it will be overwritten with the provided content. If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file. Ensure that the output content does not include incorrect escaped character patterns such as `&lt;`, `&gt;`, or `&amp;`. Also ensure there is no unwanted CDATA tags in the content.";
1297
626
  readonly parameters: z.ZodObject<{
1298
627
  path: z.ZodString;
@@ -1301,18 +630,7 @@ export declare const toolInfo_alias_13: {
1301
630
  };
1302
631
 
1303
632
  export declare const toolInfo_alias_2: {
1304
- readonly name: "delegate";
1305
- readonly description: "Temporarily delegate a task to another agent and receive the result back. This tool MUST NOT to be used with any other tool.";
1306
- readonly parameters: z.ZodObject<{
1307
- agentName: z.ZodString;
1308
- task: z.ZodString;
1309
- context: z.ZodString;
1310
- files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
1311
- }, z.core.$strip>;
1312
- };
1313
-
1314
- export declare const toolInfo_alias_3: {
1315
- readonly name: "execute_command";
633
+ readonly name: "executeCommand";
1316
634
  readonly description: "Run a single CLI command. The command is always executed in the project-root working directory (regardless of earlier commands). Prefer one-off shell commands over wrapper scripts for flexibility. **IMPORTANT**: After an `execute_command` call, you MUST stop and NOT allowed to make further tool calls in the same message.";
1317
635
  readonly parameters: z.ZodObject<{
1318
636
  command: z.ZodString;
@@ -1320,27 +638,16 @@ export declare const toolInfo_alias_3: {
1320
638
  }, z.core.$strip>;
1321
639
  };
1322
640
 
1323
- export declare const toolInfo_alias_4: {
1324
- readonly name: "fetch_url";
641
+ export declare const toolInfo_alias_3: {
642
+ readonly name: "fetchUrl";
1325
643
  readonly description: "Fetch the content located at one or more HTTP(S) URLs and return it in Markdown format. This works for standard web pages as well as raw files (e.g. README.md, source code) hosted on platforms like GitHub.";
1326
644
  readonly parameters: z.ZodObject<{
1327
645
  url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
1328
646
  }, z.core.$strip>;
1329
647
  };
1330
648
 
1331
- export declare const toolInfo_alias_5: {
1332
- readonly name: "hand_over";
1333
- readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
1334
- readonly parameters: z.ZodObject<{
1335
- agentName: z.ZodString;
1336
- task: z.ZodString;
1337
- context: z.ZodString;
1338
- files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
1339
- }, z.core.$strip>;
1340
- };
1341
-
1342
- export declare const toolInfo_alias_6: {
1343
- readonly name: "list_files";
649
+ export declare const toolInfo_alias_4: {
650
+ readonly name: "listFiles";
1344
651
  readonly description: "Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.";
1345
652
  readonly parameters: z.ZodObject<{
1346
653
  path: z.ZodString;
@@ -1350,16 +657,22 @@ export declare const toolInfo_alias_6: {
1350
657
  }, z.core.$strip>;
1351
658
  };
1352
659
 
1353
- export declare const toolInfo_alias_7: {
1354
- readonly name: "read_binary_file";
660
+ export declare const toolInfo_alias_5: {
661
+ readonly name: "listMemoryTopics";
662
+ readonly description: "Lists all topics in memory.";
663
+ readonly parameters: z.ZodObject<{}, z.core.$strip>;
664
+ };
665
+
666
+ export declare const toolInfo_alias_6: {
667
+ readonly name: "readBinaryFile";
1355
668
  readonly description: "Read a binary file from a URL or local path. Use file:// prefix to access local files. This can be used to access non-text files such as PDFs or images.";
1356
669
  readonly parameters: z.ZodObject<{
1357
670
  url: z.ZodString;
1358
671
  }, z.core.$strip>;
1359
672
  };
1360
673
 
1361
- export declare const toolInfo_alias_8: {
1362
- readonly name: "read_file";
674
+ export declare const toolInfo_alias_7: {
675
+ readonly name: "readFile";
1363
676
  readonly description: "Request to read the contents of one or multiple files at the specified paths. Use comma separated paths to read multiple files. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. May not be suitable for other types of binary files, as it returns the raw content as a string. Try to list all the potential files are relevent to the task, and then use this tool to read all the relevant files.";
1364
677
  readonly parameters: z.ZodObject<{
1365
678
  path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
@@ -1367,22 +680,22 @@ export declare const toolInfo_alias_8: {
1367
680
  }, z.core.$strip>;
1368
681
  };
1369
682
 
683
+ export declare const toolInfo_alias_8: {
684
+ readonly name: "readMemory";
685
+ readonly description: "Reads content from a memory topic.";
686
+ readonly parameters: z.ZodObject<{
687
+ topic: z.ZodOptional<z.ZodString>;
688
+ }, z.core.$strip>;
689
+ };
690
+
1370
691
  export declare const toolInfo_alias_9: {
1371
- readonly name: "remove_file";
692
+ readonly name: "removeFile";
1372
693
  readonly description: "Request to remove a file at the specified path.";
1373
694
  readonly parameters: z.ZodObject<{
1374
695
  path: z.ZodString;
1375
696
  }, z.core.$strip>;
1376
697
  };
1377
698
 
1378
- declare type ToolInfoV2 = {
1379
- name: string;
1380
- description: string;
1381
- parameters: z.ZodObject<any>;
1382
- };
1383
- export { ToolInfoV2 }
1384
- export { ToolInfoV2 as ToolInfoV2_alias_1 }
1385
-
1386
699
  declare type ToolParameter = {
1387
700
  name: string;
1388
701
  description: string;
@@ -1400,29 +713,18 @@ declare type ToolParameterValue = string | {
1400
713
  export { ToolParameterValue }
1401
714
  export { ToolParameterValue as ToolParameterValue_alias_1 }
1402
715
 
1403
- declare type ToolProvider = FilesystemProvider & CommandProvider & InteractionProvider & WebProvider;
716
+ declare type ToolProvider = FilesystemProvider & CommandProvider & InteractionProvider & WebProvider & Partial<MemoryProvider>;
1404
717
  export { ToolProvider }
1405
718
  export { ToolProvider as ToolProvider_alias_1 }
1406
719
  export { ToolProvider as ToolProvider_alias_2 }
1407
720
 
1408
- declare type ToolResponse = ToolResponseReply | ToolResponseExit | ToolResponseInvalid | ToolResponseError | ToolResponseInterrupted | ToolResponseHandOver | ToolResponseDelegate | ToolResponsePause;
721
+ declare type ToolResponse = ToolResponseReply | ToolResponseExit | ToolResponseError;
1409
722
  export { ToolResponse }
1410
723
  export { ToolResponse as ToolResponse_alias_1 }
1411
724
 
1412
- declare type ToolResponseDelegate = {
1413
- type: ToolResponseType.Delegate;
1414
- agentName: string;
1415
- task: string;
1416
- context?: string;
1417
- files?: string[];
1418
- };
1419
- export { ToolResponseDelegate }
1420
- export { ToolResponseDelegate as ToolResponseDelegate_alias_1 }
1421
-
1422
725
  declare type ToolResponseError = {
1423
726
  type: ToolResponseType.Error;
1424
727
  message: ToolResponseResult;
1425
- canRetry?: boolean;
1426
728
  };
1427
729
  export { ToolResponseError }
1428
730
  export { ToolResponseError as ToolResponseError_alias_1 }
@@ -1435,52 +737,6 @@ declare type ToolResponseExit = {
1435
737
  export { ToolResponseExit }
1436
738
  export { ToolResponseExit as ToolResponseExit_alias_1 }
1437
739
 
1438
- declare type ToolResponseHandOver = {
1439
- type: ToolResponseType.HandOver;
1440
- agentName: string;
1441
- task: string;
1442
- context?: string;
1443
- files?: string[];
1444
- };
1445
- export { ToolResponseHandOver }
1446
- export { ToolResponseHandOver as ToolResponseHandOver_alias_1 }
1447
-
1448
- declare type ToolResponseInterrupted = {
1449
- type: ToolResponseType.Interrupted;
1450
- message: string;
1451
- };
1452
- export { ToolResponseInterrupted }
1453
- export { ToolResponseInterrupted as ToolResponseInterrupted_alias_1 }
1454
-
1455
- declare type ToolResponseInvalid = {
1456
- type: ToolResponseType.Invalid;
1457
- message: ToolResponseResult;
1458
- };
1459
- export { ToolResponseInvalid }
1460
- export { ToolResponseInvalid as ToolResponseInvalid_alias_1 }
1461
-
1462
- declare type ToolResponseOrToolPause = {
1463
- type: 'response';
1464
- tool: string;
1465
- response: LanguageModelV2ToolResultOutput;
1466
- id?: string;
1467
- } | {
1468
- type: 'pause';
1469
- tool: string;
1470
- object: any;
1471
- id?: string;
1472
- };
1473
- export { ToolResponseOrToolPause }
1474
- export { ToolResponseOrToolPause as ToolResponseOrToolPause_alias_1 }
1475
- export { ToolResponseOrToolPause as ToolResponseOrToolPause_alias_2 }
1476
-
1477
- declare type ToolResponsePause = {
1478
- type: ToolResponseType.Pause;
1479
- object: any;
1480
- };
1481
- export { ToolResponsePause }
1482
- export { ToolResponsePause as ToolResponsePause_alias_1 }
1483
-
1484
740
  declare type ToolResponseReply = {
1485
741
  type: ToolResponseType.Reply;
1486
742
  message: ToolResponseResult;
@@ -1522,31 +778,11 @@ export { ToolResponseResultMedia as ToolResponseResultMedia_alias_1 }
1522
778
  declare enum ToolResponseType {
1523
779
  Reply = "Reply",
1524
780
  Exit = "Exit",
1525
- Invalid = "Invalid",
1526
- Error = "Error",
1527
- Interrupted = "Interrupted",
1528
- HandOver = "HandOver",
1529
- Delegate = "Delegate",
1530
- Pause = "Pause"
781
+ Error = "Error"
1531
782
  }
1532
783
  export { ToolResponseType }
1533
784
  export { ToolResponseType as ToolResponseType_alias_1 }
1534
785
 
1535
- declare interface ToolUse {
1536
- id?: string;
1537
- type: 'tool_use';
1538
- name: string;
1539
- params: Record<string, any>;
1540
- }
1541
- export { ToolUse }
1542
- export { ToolUse as ToolUse_alias_1 }
1543
- export { ToolUse as ToolUse_alias_2 }
1544
-
1545
- declare const toolUsePrompt: (useNativeTool: boolean, tools: FullToolInfoV2[], toolNamePrefix: string) => string;
1546
- export { toolUsePrompt }
1547
- export { toolUsePrompt as toolUsePrompt_alias_1 }
1548
- export { toolUsePrompt as toolUsePrompt_alias_2 }
1549
-
1550
786
  declare type Totals = {
1551
787
  input: number;
1552
788
  output: number;
@@ -1555,17 +791,6 @@ declare type Totals = {
1555
791
  messageCount: number;
1556
792
  };
1557
793
 
1558
- export declare function toToolInfoV1(tool: FullToolInfoV2): FullToolInfo;
1559
-
1560
- declare const TruncateContextPolicy: () => {
1561
- name: Policies;
1562
- onBeforeRequest(agent: AgentBase): Promise<void>;
1563
- };
1564
- export { TruncateContextPolicy }
1565
- export { TruncateContextPolicy as TruncateContextPolicy_alias_1 }
1566
- export { TruncateContextPolicy as TruncateContextPolicy_alias_2 }
1567
- export { TruncateContextPolicy as TruncateContextPolicy_alias_3 }
1568
-
1569
794
  /**
1570
795
  * Tracks token / cost usage across any mix of LLM models.
1571
796
  * Supports optional caps on total messages and total cost.