@polka-codes/core 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.ts +171 -689
- package/dist/index.d.ts +3 -0
- package/dist/index.js +586 -401
- package/package.json +1 -1
|
@@ -2,11 +2,13 @@ import type { FilePart } from 'ai';
|
|
|
2
2
|
import type { ImagePart } from 'ai';
|
|
3
3
|
import type { LanguageModelV2 } from '@ai-sdk/provider';
|
|
4
4
|
import type { LanguageModelV2Usage } from '@ai-sdk/provider';
|
|
5
|
-
import type { ModelMessage } from 'ai';
|
|
6
|
-
import type { ModelMessage as ModelMessage_2 } from '
|
|
5
|
+
import type { ModelMessage } from '@ai-sdk/provider-utils';
|
|
6
|
+
import type { ModelMessage as ModelMessage_2 } from 'ai';
|
|
7
7
|
import type { TextPart } from 'ai';
|
|
8
|
+
import type { ToolModelMessage } from '@ai-sdk/provider-utils';
|
|
8
9
|
import type { UserContent } from '@ai-sdk/provider-utils';
|
|
9
10
|
import type { UserContent as UserContent_2 } from 'ai';
|
|
11
|
+
import type { UserModelMessage } from '@ai-sdk/provider-utils';
|
|
10
12
|
import { z } from 'zod';
|
|
11
13
|
|
|
12
14
|
declare abstract class AgentBase {
|
|
@@ -17,13 +19,13 @@ declare abstract class AgentBase {
|
|
|
17
19
|
constructor(name: string, ai: LanguageModelV2, config: AgentBaseConfig);
|
|
18
20
|
abort(): void;
|
|
19
21
|
get parameters(): Readonly<Record<string, any>>;
|
|
20
|
-
get messages(): Readonly<
|
|
21
|
-
setMessages(messages: Readonly<
|
|
22
|
+
get messages(): Readonly<ModelMessage[]>;
|
|
23
|
+
setMessages(messages: Readonly<ModelMessage[]>): void;
|
|
22
24
|
start(prompt: UserContent): Promise<ExitReason>;
|
|
23
25
|
step(prompt: UserContent): Promise<AssistantMessageContent[]>;
|
|
24
26
|
handleStepResponse(response: AssistantMessageContent[]): Promise<{
|
|
25
27
|
type: "reply";
|
|
26
|
-
message:
|
|
28
|
+
message: UserModelMessage | ToolModelMessage;
|
|
27
29
|
} | {
|
|
28
30
|
type: "exit";
|
|
29
31
|
reason: ExitReason;
|
|
@@ -89,7 +91,7 @@ declare type AgentPolicyInstance = {
|
|
|
89
91
|
prompt?: string;
|
|
90
92
|
onBeforeInvokeTool?: (name: string, args: Record<string, string>) => Promise<ToolResponse | undefined>;
|
|
91
93
|
onBeforeRequest?: (agent: AgentBase) => Promise<void>;
|
|
92
|
-
prepareMessages?: (agent: AgentBase, messages:
|
|
94
|
+
prepareMessages?: (agent: AgentBase, messages: ModelMessage_2[]) => Promise<ModelMessage_2[]>;
|
|
93
95
|
};
|
|
94
96
|
export { AgentPolicyInstance }
|
|
95
97
|
export { AgentPolicyInstance as AgentPolicyInstance_alias_1 }
|
|
@@ -106,12 +108,19 @@ declare type AiToolDefinition<Input, Output = string> = {
|
|
|
106
108
|
prompt: string;
|
|
107
109
|
formatInput: (params: Input) => string;
|
|
108
110
|
parseOutput: (output: string) => Output;
|
|
109
|
-
agent?: AgentNameType;
|
|
110
111
|
};
|
|
111
112
|
export { AiToolDefinition }
|
|
112
113
|
export { AiToolDefinition as AiToolDefinition_alias_1 }
|
|
113
114
|
export { AiToolDefinition as AiToolDefinition_alias_2 }
|
|
114
115
|
|
|
116
|
+
export declare type AiToolDefinitionWithAgent<Input, Output = string> = AiToolDefinition<Input, Output> & {
|
|
117
|
+
agent: (options: SharedAgentOptions) => AgentBase;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export declare type AiToolDefinitionWithMultiAgent<Input, Output = string> = AiToolDefinition<Input, Output> & {
|
|
121
|
+
agent: AgentNameType;
|
|
122
|
+
};
|
|
123
|
+
|
|
115
124
|
declare const allAgents: readonly [{
|
|
116
125
|
readonly name: "architect";
|
|
117
126
|
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."];
|
|
@@ -371,44 +380,6 @@ declare const _default: {
|
|
|
371
380
|
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
372
381
|
}, z.core.$strip>>;
|
|
373
382
|
}, z.core.$strip>;
|
|
374
|
-
readonly examples: [{
|
|
375
|
-
readonly description: "Single clarifying question (no options)";
|
|
376
|
-
readonly parameters: [{
|
|
377
|
-
readonly name: "questions";
|
|
378
|
-
readonly value: {
|
|
379
|
-
readonly prompt: "What is the target deployment environment?";
|
|
380
|
-
};
|
|
381
|
-
}];
|
|
382
|
-
}, {
|
|
383
|
-
readonly description: "Single question with multiple-choice options";
|
|
384
|
-
readonly parameters: [{
|
|
385
|
-
readonly name: "questions";
|
|
386
|
-
readonly value: {
|
|
387
|
-
readonly prompt: "Which frontend framework are you using?";
|
|
388
|
-
readonly options: ["React", "Angular", "Vue", "Svelte"];
|
|
389
|
-
};
|
|
390
|
-
}];
|
|
391
|
-
}, {
|
|
392
|
-
readonly description: "Two related questions in one call";
|
|
393
|
-
readonly parameters: [{
|
|
394
|
-
readonly name: "questions";
|
|
395
|
-
readonly value: [{
|
|
396
|
-
readonly prompt: "What type of application are you building?";
|
|
397
|
-
}, {
|
|
398
|
-
readonly prompt: "Preferred programming language?";
|
|
399
|
-
readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
|
|
400
|
-
}];
|
|
401
|
-
}];
|
|
402
|
-
}, {
|
|
403
|
-
readonly description: "Binary (yes/no) confirmation";
|
|
404
|
-
readonly parameters: [{
|
|
405
|
-
readonly name: "questions";
|
|
406
|
-
readonly value: {
|
|
407
|
-
readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
|
|
408
|
-
readonly options: ["Yes", "No"];
|
|
409
|
-
};
|
|
410
|
-
}];
|
|
411
|
-
}];
|
|
412
383
|
readonly permissionLevel: PermissionLevel.None;
|
|
413
384
|
}, InteractionProvider>;
|
|
414
385
|
isAvailable: (provider: InteractionProvider) => boolean;
|
|
@@ -420,50 +391,12 @@ declare const _default: {
|
|
|
420
391
|
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
421
392
|
}, z.core.$strip>>;
|
|
422
393
|
}, z.core.$strip>;
|
|
423
|
-
examples: [{
|
|
424
|
-
readonly description: "Single clarifying question (no options)";
|
|
425
|
-
readonly parameters: [{
|
|
426
|
-
readonly name: "questions";
|
|
427
|
-
readonly value: {
|
|
428
|
-
readonly prompt: "What is the target deployment environment?";
|
|
429
|
-
};
|
|
430
|
-
}];
|
|
431
|
-
}, {
|
|
432
|
-
readonly description: "Single question with multiple-choice options";
|
|
433
|
-
readonly parameters: [{
|
|
434
|
-
readonly name: "questions";
|
|
435
|
-
readonly value: {
|
|
436
|
-
readonly prompt: "Which frontend framework are you using?";
|
|
437
|
-
readonly options: ["React", "Angular", "Vue", "Svelte"];
|
|
438
|
-
};
|
|
439
|
-
}];
|
|
440
|
-
}, {
|
|
441
|
-
readonly description: "Two related questions in one call";
|
|
442
|
-
readonly parameters: [{
|
|
443
|
-
readonly name: "questions";
|
|
444
|
-
readonly value: [{
|
|
445
|
-
readonly prompt: "What type of application are you building?";
|
|
446
|
-
}, {
|
|
447
|
-
readonly prompt: "Preferred programming language?";
|
|
448
|
-
readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
|
|
449
|
-
}];
|
|
450
|
-
}];
|
|
451
|
-
}, {
|
|
452
|
-
readonly description: "Binary (yes/no) confirmation";
|
|
453
|
-
readonly parameters: [{
|
|
454
|
-
readonly name: "questions";
|
|
455
|
-
readonly value: {
|
|
456
|
-
readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
|
|
457
|
-
readonly options: ["Yes", "No"];
|
|
458
|
-
};
|
|
459
|
-
}];
|
|
460
|
-
}];
|
|
461
394
|
permissionLevel: PermissionLevel.None;
|
|
462
395
|
};
|
|
463
396
|
export { _default as askFollowupQuestion }
|
|
464
397
|
export { _default as askFollowupQuestion_alias_1 }
|
|
465
398
|
export { _default as askFollowupQuestion_alias_2 }
|
|
466
|
-
export { _default as
|
|
399
|
+
export { _default as default_alias_6 }
|
|
467
400
|
|
|
468
401
|
declare const _default_10: {
|
|
469
402
|
handler: ToolHandler<{
|
|
@@ -473,16 +406,6 @@ declare const _default_10: {
|
|
|
473
406
|
source_path: z.ZodString;
|
|
474
407
|
target_path: z.ZodString;
|
|
475
408
|
}, z.core.$strip>;
|
|
476
|
-
readonly examples: [{
|
|
477
|
-
readonly description: "Request to rename a file";
|
|
478
|
-
readonly parameters: [{
|
|
479
|
-
readonly name: "source_path";
|
|
480
|
-
readonly value: "src/old-name.js";
|
|
481
|
-
}, {
|
|
482
|
-
readonly name: "target_path";
|
|
483
|
-
readonly value: "src/new-name.js";
|
|
484
|
-
}];
|
|
485
|
-
}];
|
|
486
409
|
readonly permissionLevel: PermissionLevel.Write;
|
|
487
410
|
}, FilesystemProvider>;
|
|
488
411
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
@@ -492,19 +415,9 @@ declare const _default_10: {
|
|
|
492
415
|
source_path: z.ZodString;
|
|
493
416
|
target_path: z.ZodString;
|
|
494
417
|
}, z.core.$strip>;
|
|
495
|
-
examples: [{
|
|
496
|
-
readonly description: "Request to rename a file";
|
|
497
|
-
readonly parameters: [{
|
|
498
|
-
readonly name: "source_path";
|
|
499
|
-
readonly value: "src/old-name.js";
|
|
500
|
-
}, {
|
|
501
|
-
readonly name: "target_path";
|
|
502
|
-
readonly value: "src/new-name.js";
|
|
503
|
-
}];
|
|
504
|
-
}];
|
|
505
418
|
permissionLevel: PermissionLevel.Write;
|
|
506
419
|
};
|
|
507
|
-
export { _default_10 as
|
|
420
|
+
export { _default_10 as default_alias_15 }
|
|
508
421
|
export { _default_10 as renameFile }
|
|
509
422
|
export { _default_10 as renameFile_alias_1 }
|
|
510
423
|
export { _default_10 as renameFile_alias_2 }
|
|
@@ -517,43 +430,6 @@ declare const _default_11: {
|
|
|
517
430
|
path: z.ZodString;
|
|
518
431
|
diff: z.ZodString;
|
|
519
432
|
}, z.core.$strip>;
|
|
520
|
-
readonly examples: [{
|
|
521
|
-
readonly description: "Request to replace sections of content in a file";
|
|
522
|
-
readonly parameters: [{
|
|
523
|
-
readonly name: "path";
|
|
524
|
-
readonly value: "src/main.js";
|
|
525
|
-
}, {
|
|
526
|
-
readonly name: "diff";
|
|
527
|
-
readonly value: "<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE";
|
|
528
|
-
}];
|
|
529
|
-
}, {
|
|
530
|
-
readonly description: "Request to perform a simple, single-line replacement";
|
|
531
|
-
readonly parameters: [{
|
|
532
|
-
readonly name: "path";
|
|
533
|
-
readonly value: "src/config.js";
|
|
534
|
-
}, {
|
|
535
|
-
readonly name: "diff";
|
|
536
|
-
readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
|
|
537
|
-
}];
|
|
538
|
-
}, {
|
|
539
|
-
readonly description: "Request to add a new function to a file";
|
|
540
|
-
readonly parameters: [{
|
|
541
|
-
readonly name: "path";
|
|
542
|
-
readonly value: "src/utils.js";
|
|
543
|
-
}, {
|
|
544
|
-
readonly name: "diff";
|
|
545
|
-
readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
|
|
546
|
-
}];
|
|
547
|
-
}, {
|
|
548
|
-
readonly description: "Request to delete a block of code from a file";
|
|
549
|
-
readonly parameters: [{
|
|
550
|
-
readonly name: "path";
|
|
551
|
-
readonly value: "src/app.js";
|
|
552
|
-
}, {
|
|
553
|
-
readonly name: "diff";
|
|
554
|
-
readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
|
|
555
|
-
}];
|
|
556
|
-
}];
|
|
557
433
|
readonly permissionLevel: PermissionLevel.Write;
|
|
558
434
|
}, FilesystemProvider>;
|
|
559
435
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
@@ -563,46 +439,9 @@ declare const _default_11: {
|
|
|
563
439
|
path: z.ZodString;
|
|
564
440
|
diff: z.ZodString;
|
|
565
441
|
}, z.core.$strip>;
|
|
566
|
-
examples: [{
|
|
567
|
-
readonly description: "Request to replace sections of content in a file";
|
|
568
|
-
readonly parameters: [{
|
|
569
|
-
readonly name: "path";
|
|
570
|
-
readonly value: "src/main.js";
|
|
571
|
-
}, {
|
|
572
|
-
readonly name: "diff";
|
|
573
|
-
readonly value: "<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE";
|
|
574
|
-
}];
|
|
575
|
-
}, {
|
|
576
|
-
readonly description: "Request to perform a simple, single-line replacement";
|
|
577
|
-
readonly parameters: [{
|
|
578
|
-
readonly name: "path";
|
|
579
|
-
readonly value: "src/config.js";
|
|
580
|
-
}, {
|
|
581
|
-
readonly name: "diff";
|
|
582
|
-
readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
|
|
583
|
-
}];
|
|
584
|
-
}, {
|
|
585
|
-
readonly description: "Request to add a new function to a file";
|
|
586
|
-
readonly parameters: [{
|
|
587
|
-
readonly name: "path";
|
|
588
|
-
readonly value: "src/utils.js";
|
|
589
|
-
}, {
|
|
590
|
-
readonly name: "diff";
|
|
591
|
-
readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
|
|
592
|
-
}];
|
|
593
|
-
}, {
|
|
594
|
-
readonly description: "Request to delete a block of code from a file";
|
|
595
|
-
readonly parameters: [{
|
|
596
|
-
readonly name: "path";
|
|
597
|
-
readonly value: "src/app.js";
|
|
598
|
-
}, {
|
|
599
|
-
readonly name: "diff";
|
|
600
|
-
readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
|
|
601
|
-
}];
|
|
602
|
-
}];
|
|
603
442
|
permissionLevel: PermissionLevel.Write;
|
|
604
443
|
};
|
|
605
|
-
export { _default_11 as
|
|
444
|
+
export { _default_11 as default_alias_16 }
|
|
606
445
|
export { _default_11 as replaceInFile }
|
|
607
446
|
export { _default_11 as replaceInFile_alias_1 }
|
|
608
447
|
export { _default_11 as replaceInFile_alias_2 }
|
|
@@ -616,19 +455,6 @@ declare const _default_12: {
|
|
|
616
455
|
regex: z.ZodString;
|
|
617
456
|
filePattern: z.ZodOptional<z.ZodString>;
|
|
618
457
|
}, z.core.$strip>;
|
|
619
|
-
readonly examples: [{
|
|
620
|
-
readonly description: "Request to perform a regex search across files";
|
|
621
|
-
readonly parameters: [{
|
|
622
|
-
readonly name: "path";
|
|
623
|
-
readonly value: "src";
|
|
624
|
-
}, {
|
|
625
|
-
readonly name: "regex";
|
|
626
|
-
readonly value: "^components/";
|
|
627
|
-
}, {
|
|
628
|
-
readonly name: "filePattern";
|
|
629
|
-
readonly value: "*.ts,*.tsx";
|
|
630
|
-
}];
|
|
631
|
-
}];
|
|
632
458
|
readonly permissionLevel: PermissionLevel.Read;
|
|
633
459
|
}, FilesystemProvider>;
|
|
634
460
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
@@ -639,22 +465,9 @@ declare const _default_12: {
|
|
|
639
465
|
regex: z.ZodString;
|
|
640
466
|
filePattern: z.ZodOptional<z.ZodString>;
|
|
641
467
|
}, z.core.$strip>;
|
|
642
|
-
examples: [{
|
|
643
|
-
readonly description: "Request to perform a regex search across files";
|
|
644
|
-
readonly parameters: [{
|
|
645
|
-
readonly name: "path";
|
|
646
|
-
readonly value: "src";
|
|
647
|
-
}, {
|
|
648
|
-
readonly name: "regex";
|
|
649
|
-
readonly value: "^components/";
|
|
650
|
-
}, {
|
|
651
|
-
readonly name: "filePattern";
|
|
652
|
-
readonly value: "*.ts,*.tsx";
|
|
653
|
-
}];
|
|
654
|
-
}];
|
|
655
468
|
permissionLevel: PermissionLevel.Read;
|
|
656
469
|
};
|
|
657
|
-
export { _default_12 as
|
|
470
|
+
export { _default_12 as default_alias_17 }
|
|
658
471
|
export { _default_12 as searchFiles }
|
|
659
472
|
export { _default_12 as searchFiles_alias_1 }
|
|
660
473
|
export { _default_12 as searchFiles_alias_2 }
|
|
@@ -667,16 +480,6 @@ declare const _default_13: {
|
|
|
667
480
|
path: z.ZodString;
|
|
668
481
|
content: z.ZodString;
|
|
669
482
|
}, z.core.$strip>;
|
|
670
|
-
readonly examples: [{
|
|
671
|
-
readonly description: "Request to write content to a file";
|
|
672
|
-
readonly parameters: [{
|
|
673
|
-
readonly name: "path";
|
|
674
|
-
readonly value: "src/main.js";
|
|
675
|
-
}, {
|
|
676
|
-
readonly name: "content";
|
|
677
|
-
readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
|
|
678
|
-
}];
|
|
679
|
-
}];
|
|
680
483
|
readonly permissionLevel: PermissionLevel.Write;
|
|
681
484
|
}, FilesystemProvider>;
|
|
682
485
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
@@ -686,19 +489,9 @@ declare const _default_13: {
|
|
|
686
489
|
path: z.ZodString;
|
|
687
490
|
content: z.ZodString;
|
|
688
491
|
}, z.core.$strip>;
|
|
689
|
-
examples: [{
|
|
690
|
-
readonly description: "Request to write content to a file";
|
|
691
|
-
readonly parameters: [{
|
|
692
|
-
readonly name: "path";
|
|
693
|
-
readonly value: "src/main.js";
|
|
694
|
-
}, {
|
|
695
|
-
readonly name: "content";
|
|
696
|
-
readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
|
|
697
|
-
}];
|
|
698
|
-
}];
|
|
699
492
|
permissionLevel: PermissionLevel.Write;
|
|
700
493
|
};
|
|
701
|
-
export { _default_13 as
|
|
494
|
+
export { _default_13 as default_alias_18 }
|
|
702
495
|
export { _default_13 as writeToFile }
|
|
703
496
|
export { _default_13 as writeToFile_alias_1 }
|
|
704
497
|
export { _default_13 as writeToFile_alias_2 }
|
|
@@ -710,13 +503,6 @@ declare const _default_2: {
|
|
|
710
503
|
readonly parameters: z.ZodObject<{
|
|
711
504
|
result: z.ZodString;
|
|
712
505
|
}, z.core.$strip>;
|
|
713
|
-
readonly examples: [{
|
|
714
|
-
readonly description: "Request to present the result of the task";
|
|
715
|
-
readonly parameters: [{
|
|
716
|
-
readonly name: "result";
|
|
717
|
-
readonly value: "Your final result description here";
|
|
718
|
-
}];
|
|
719
|
-
}];
|
|
720
506
|
readonly permissionLevel: PermissionLevel.None;
|
|
721
507
|
}, InteractionProvider>;
|
|
722
508
|
isAvailable: (_provider: InteractionProvider) => boolean;
|
|
@@ -725,19 +511,12 @@ declare const _default_2: {
|
|
|
725
511
|
parameters: z.ZodObject<{
|
|
726
512
|
result: z.ZodString;
|
|
727
513
|
}, z.core.$strip>;
|
|
728
|
-
examples: [{
|
|
729
|
-
readonly description: "Request to present the result of the task";
|
|
730
|
-
readonly parameters: [{
|
|
731
|
-
readonly name: "result";
|
|
732
|
-
readonly value: "Your final result description here";
|
|
733
|
-
}];
|
|
734
|
-
}];
|
|
735
514
|
permissionLevel: PermissionLevel.None;
|
|
736
515
|
};
|
|
737
516
|
export { _default_2 as attemptCompletion }
|
|
738
517
|
export { _default_2 as attemptCompletion_alias_1 }
|
|
739
518
|
export { _default_2 as attemptCompletion_alias_2 }
|
|
740
|
-
export { _default_2 as
|
|
519
|
+
export { _default_2 as default_alias_7 }
|
|
741
520
|
|
|
742
521
|
declare const _default_3: {
|
|
743
522
|
handler: ToolHandler<{
|
|
@@ -749,22 +528,6 @@ declare const _default_3: {
|
|
|
749
528
|
context: z.ZodString;
|
|
750
529
|
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
751
530
|
}, z.core.$strip>;
|
|
752
|
-
readonly examples: [{
|
|
753
|
-
readonly description: "Delegate a code analysis task to the analyzer agent";
|
|
754
|
-
readonly parameters: [{
|
|
755
|
-
readonly name: "agentName";
|
|
756
|
-
readonly value: "analyzer";
|
|
757
|
-
}, {
|
|
758
|
-
readonly name: "task";
|
|
759
|
-
readonly value: "Analyze the authentication implementation";
|
|
760
|
-
}, {
|
|
761
|
-
readonly name: "context";
|
|
762
|
-
readonly value: "Need to understand the security implications of the current auth system";
|
|
763
|
-
}, {
|
|
764
|
-
readonly name: "files";
|
|
765
|
-
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
766
|
-
}];
|
|
767
|
-
}];
|
|
768
531
|
readonly permissionLevel: PermissionLevel.None;
|
|
769
532
|
}, any>;
|
|
770
533
|
isAvailable: (_provider: any) => boolean;
|
|
@@ -776,25 +539,9 @@ declare const _default_3: {
|
|
|
776
539
|
context: z.ZodString;
|
|
777
540
|
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
778
541
|
}, z.core.$strip>;
|
|
779
|
-
examples: [{
|
|
780
|
-
readonly description: "Delegate a code analysis task to the analyzer agent";
|
|
781
|
-
readonly parameters: [{
|
|
782
|
-
readonly name: "agentName";
|
|
783
|
-
readonly value: "analyzer";
|
|
784
|
-
}, {
|
|
785
|
-
readonly name: "task";
|
|
786
|
-
readonly value: "Analyze the authentication implementation";
|
|
787
|
-
}, {
|
|
788
|
-
readonly name: "context";
|
|
789
|
-
readonly value: "Need to understand the security implications of the current auth system";
|
|
790
|
-
}, {
|
|
791
|
-
readonly name: "files";
|
|
792
|
-
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
793
|
-
}];
|
|
794
|
-
}];
|
|
795
542
|
permissionLevel: PermissionLevel.None;
|
|
796
543
|
};
|
|
797
|
-
export { _default_3 as
|
|
544
|
+
export { _default_3 as default_alias_8 }
|
|
798
545
|
export { _default_3 as delegate }
|
|
799
546
|
export { _default_3 as delegate_alias_1 }
|
|
800
547
|
export { _default_3 as delegate_alias_2 }
|
|
@@ -807,16 +554,6 @@ declare const _default_4: {
|
|
|
807
554
|
command: z.ZodString;
|
|
808
555
|
requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
809
556
|
}, z.core.$strip>;
|
|
810
|
-
readonly examples: [{
|
|
811
|
-
readonly description: "Make a build";
|
|
812
|
-
readonly parameters: [{
|
|
813
|
-
readonly name: "command";
|
|
814
|
-
readonly value: "npm run build";
|
|
815
|
-
}, {
|
|
816
|
-
readonly name: "requiresApproval";
|
|
817
|
-
readonly value: "false";
|
|
818
|
-
}];
|
|
819
|
-
}];
|
|
820
557
|
readonly permissionLevel: PermissionLevel.Arbitrary;
|
|
821
558
|
}, CommandProvider>;
|
|
822
559
|
isAvailable: (provider: CommandProvider) => boolean;
|
|
@@ -826,19 +563,9 @@ declare const _default_4: {
|
|
|
826
563
|
command: z.ZodString;
|
|
827
564
|
requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
828
565
|
}, z.core.$strip>;
|
|
829
|
-
examples: [{
|
|
830
|
-
readonly description: "Make a build";
|
|
831
|
-
readonly parameters: [{
|
|
832
|
-
readonly name: "command";
|
|
833
|
-
readonly value: "npm run build";
|
|
834
|
-
}, {
|
|
835
|
-
readonly name: "requiresApproval";
|
|
836
|
-
readonly value: "false";
|
|
837
|
-
}];
|
|
838
|
-
}];
|
|
839
566
|
permissionLevel: PermissionLevel.Arbitrary;
|
|
840
567
|
};
|
|
841
|
-
export { _default_4 as
|
|
568
|
+
export { _default_4 as default_alias_9 }
|
|
842
569
|
export { _default_4 as executeCommand }
|
|
843
570
|
export { _default_4 as executeCommand_alias_1 }
|
|
844
571
|
export { _default_4 as executeCommand_alias_2 }
|
|
@@ -850,25 +577,6 @@ declare const _default_5: {
|
|
|
850
577
|
readonly parameters: z.ZodObject<{
|
|
851
578
|
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
852
579
|
}, z.core.$strip>;
|
|
853
|
-
readonly examples: [{
|
|
854
|
-
readonly description: "Fetch a single webpage";
|
|
855
|
-
readonly parameters: [{
|
|
856
|
-
readonly name: "url";
|
|
857
|
-
readonly value: "https://example.com";
|
|
858
|
-
}];
|
|
859
|
-
}, {
|
|
860
|
-
readonly description: "Fetch multiple webpages";
|
|
861
|
-
readonly parameters: [{
|
|
862
|
-
readonly name: "url";
|
|
863
|
-
readonly value: "https://example.com,https://developer.mozilla.org/en-US/docs/Web/HTTP";
|
|
864
|
-
}];
|
|
865
|
-
}, {
|
|
866
|
-
readonly description: "Fetch a raw file from GitHub";
|
|
867
|
-
readonly parameters: [{
|
|
868
|
-
readonly name: "url";
|
|
869
|
-
readonly value: "https://raw.githubusercontent.com/user/repo/main/README.md";
|
|
870
|
-
}];
|
|
871
|
-
}];
|
|
872
580
|
readonly permissionLevel: PermissionLevel.Read;
|
|
873
581
|
}, WebProvider>;
|
|
874
582
|
isAvailable: (provider: WebProvider) => boolean;
|
|
@@ -877,28 +585,9 @@ declare const _default_5: {
|
|
|
877
585
|
parameters: z.ZodObject<{
|
|
878
586
|
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
879
587
|
}, z.core.$strip>;
|
|
880
|
-
examples: [{
|
|
881
|
-
readonly description: "Fetch a single webpage";
|
|
882
|
-
readonly parameters: [{
|
|
883
|
-
readonly name: "url";
|
|
884
|
-
readonly value: "https://example.com";
|
|
885
|
-
}];
|
|
886
|
-
}, {
|
|
887
|
-
readonly description: "Fetch multiple webpages";
|
|
888
|
-
readonly parameters: [{
|
|
889
|
-
readonly name: "url";
|
|
890
|
-
readonly value: "https://example.com,https://developer.mozilla.org/en-US/docs/Web/HTTP";
|
|
891
|
-
}];
|
|
892
|
-
}, {
|
|
893
|
-
readonly description: "Fetch a raw file from GitHub";
|
|
894
|
-
readonly parameters: [{
|
|
895
|
-
readonly name: "url";
|
|
896
|
-
readonly value: "https://raw.githubusercontent.com/user/repo/main/README.md";
|
|
897
|
-
}];
|
|
898
|
-
}];
|
|
899
588
|
permissionLevel: PermissionLevel.Read;
|
|
900
589
|
};
|
|
901
|
-
export { _default_5 as
|
|
590
|
+
export { _default_5 as default_alias_10 }
|
|
902
591
|
export { _default_5 as fetchUrl }
|
|
903
592
|
export { _default_5 as fetchUrl_alias_1 }
|
|
904
593
|
export { _default_5 as fetchUrl_alias_2 }
|
|
@@ -913,22 +602,6 @@ declare const _default_6: {
|
|
|
913
602
|
context: z.ZodString;
|
|
914
603
|
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
915
604
|
}, z.core.$strip>;
|
|
916
|
-
readonly examples: [{
|
|
917
|
-
readonly description: "Hand over a coding task to the coder agent";
|
|
918
|
-
readonly parameters: [{
|
|
919
|
-
readonly name: "agentName";
|
|
920
|
-
readonly value: "coder";
|
|
921
|
-
}, {
|
|
922
|
-
readonly name: "task";
|
|
923
|
-
readonly value: "Implement the login feature";
|
|
924
|
-
}, {
|
|
925
|
-
readonly name: "context";
|
|
926
|
-
readonly value: "We need a secure login system with email and password";
|
|
927
|
-
}, {
|
|
928
|
-
readonly name: "files";
|
|
929
|
-
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
930
|
-
}];
|
|
931
|
-
}];
|
|
932
605
|
readonly permissionLevel: PermissionLevel.None;
|
|
933
606
|
}, any>;
|
|
934
607
|
isAvailable: (_provider: any) => boolean;
|
|
@@ -940,25 +613,9 @@ declare const _default_6: {
|
|
|
940
613
|
context: z.ZodString;
|
|
941
614
|
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
942
615
|
}, z.core.$strip>;
|
|
943
|
-
examples: [{
|
|
944
|
-
readonly description: "Hand over a coding task to the coder agent";
|
|
945
|
-
readonly parameters: [{
|
|
946
|
-
readonly name: "agentName";
|
|
947
|
-
readonly value: "coder";
|
|
948
|
-
}, {
|
|
949
|
-
readonly name: "task";
|
|
950
|
-
readonly value: "Implement the login feature";
|
|
951
|
-
}, {
|
|
952
|
-
readonly name: "context";
|
|
953
|
-
readonly value: "We need a secure login system with email and password";
|
|
954
|
-
}, {
|
|
955
|
-
readonly name: "files";
|
|
956
|
-
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
957
|
-
}];
|
|
958
|
-
}];
|
|
959
616
|
permissionLevel: PermissionLevel.None;
|
|
960
617
|
};
|
|
961
|
-
export { _default_6 as
|
|
618
|
+
export { _default_6 as default_alias_11 }
|
|
962
619
|
export { _default_6 as handOver }
|
|
963
620
|
export { _default_6 as handOver_alias_1 }
|
|
964
621
|
export { _default_6 as handOver_alias_2 }
|
|
@@ -972,16 +629,6 @@ declare const _default_7: {
|
|
|
972
629
|
maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
973
630
|
recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
974
631
|
}, z.core.$strip>;
|
|
975
|
-
readonly examples: [{
|
|
976
|
-
readonly description: "Request to list files";
|
|
977
|
-
readonly parameters: [{
|
|
978
|
-
readonly name: "path";
|
|
979
|
-
readonly value: "src";
|
|
980
|
-
}, {
|
|
981
|
-
readonly name: "maxCount";
|
|
982
|
-
readonly value: "100";
|
|
983
|
-
}];
|
|
984
|
-
}];
|
|
985
632
|
readonly permissionLevel: PermissionLevel.Read;
|
|
986
633
|
}, FilesystemProvider>;
|
|
987
634
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
@@ -992,19 +639,9 @@ declare const _default_7: {
|
|
|
992
639
|
maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
993
640
|
recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
994
641
|
}, z.core.$strip>;
|
|
995
|
-
examples: [{
|
|
996
|
-
readonly description: "Request to list files";
|
|
997
|
-
readonly parameters: [{
|
|
998
|
-
readonly name: "path";
|
|
999
|
-
readonly value: "src";
|
|
1000
|
-
}, {
|
|
1001
|
-
readonly name: "maxCount";
|
|
1002
|
-
readonly value: "100";
|
|
1003
|
-
}];
|
|
1004
|
-
}];
|
|
1005
642
|
permissionLevel: PermissionLevel.Read;
|
|
1006
643
|
};
|
|
1007
|
-
export { _default_7 as
|
|
644
|
+
export { _default_7 as default_alias_12 }
|
|
1008
645
|
export { _default_7 as listFiles }
|
|
1009
646
|
export { _default_7 as listFiles_alias_1 }
|
|
1010
647
|
export { _default_7 as listFiles_alias_2 }
|
|
@@ -1016,19 +653,6 @@ declare const _default_8: {
|
|
|
1016
653
|
readonly parameters: z.ZodObject<{
|
|
1017
654
|
path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
1018
655
|
}, z.core.$strip>;
|
|
1019
|
-
readonly examples: [{
|
|
1020
|
-
readonly description: "Request to read the contents of a file";
|
|
1021
|
-
readonly parameters: [{
|
|
1022
|
-
readonly name: "path";
|
|
1023
|
-
readonly value: "src/main.js";
|
|
1024
|
-
}];
|
|
1025
|
-
}, {
|
|
1026
|
-
readonly description: "Request to read multiple files";
|
|
1027
|
-
readonly parameters: [{
|
|
1028
|
-
readonly name: "path";
|
|
1029
|
-
readonly value: "src/main.js,src/index.js";
|
|
1030
|
-
}];
|
|
1031
|
-
}];
|
|
1032
656
|
readonly permissionLevel: PermissionLevel.Read;
|
|
1033
657
|
}, FilesystemProvider>;
|
|
1034
658
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
@@ -1037,22 +661,9 @@ declare const _default_8: {
|
|
|
1037
661
|
parameters: z.ZodObject<{
|
|
1038
662
|
path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
1039
663
|
}, z.core.$strip>;
|
|
1040
|
-
examples: [{
|
|
1041
|
-
readonly description: "Request to read the contents of a file";
|
|
1042
|
-
readonly parameters: [{
|
|
1043
|
-
readonly name: "path";
|
|
1044
|
-
readonly value: "src/main.js";
|
|
1045
|
-
}];
|
|
1046
|
-
}, {
|
|
1047
|
-
readonly description: "Request to read multiple files";
|
|
1048
|
-
readonly parameters: [{
|
|
1049
|
-
readonly name: "path";
|
|
1050
|
-
readonly value: "src/main.js,src/index.js";
|
|
1051
|
-
}];
|
|
1052
|
-
}];
|
|
1053
664
|
permissionLevel: PermissionLevel.Read;
|
|
1054
665
|
};
|
|
1055
|
-
export { _default_8 as
|
|
666
|
+
export { _default_8 as default_alias_13 }
|
|
1056
667
|
export { _default_8 as readFile }
|
|
1057
668
|
export { _default_8 as readFile_alias_1 }
|
|
1058
669
|
export { _default_8 as readFile_alias_2 }
|
|
@@ -1064,13 +675,6 @@ declare const _default_9: {
|
|
|
1064
675
|
readonly parameters: z.ZodObject<{
|
|
1065
676
|
path: z.ZodString;
|
|
1066
677
|
}, z.core.$strip>;
|
|
1067
|
-
readonly examples: [{
|
|
1068
|
-
readonly description: "Request to remove a file";
|
|
1069
|
-
readonly parameters: [{
|
|
1070
|
-
readonly name: "path";
|
|
1071
|
-
readonly value: "src/main.js";
|
|
1072
|
-
}];
|
|
1073
|
-
}];
|
|
1074
678
|
readonly permissionLevel: PermissionLevel.Write;
|
|
1075
679
|
}, FilesystemProvider>;
|
|
1076
680
|
isAvailable: (provider: FilesystemProvider) => boolean;
|
|
@@ -1079,16 +683,9 @@ declare const _default_9: {
|
|
|
1079
683
|
parameters: z.ZodObject<{
|
|
1080
684
|
path: z.ZodString;
|
|
1081
685
|
}, z.core.$strip>;
|
|
1082
|
-
examples: [{
|
|
1083
|
-
readonly description: "Request to remove a file";
|
|
1084
|
-
readonly parameters: [{
|
|
1085
|
-
readonly name: "path";
|
|
1086
|
-
readonly value: "src/main.js";
|
|
1087
|
-
}];
|
|
1088
|
-
}];
|
|
1089
686
|
permissionLevel: PermissionLevel.Write;
|
|
1090
687
|
};
|
|
1091
|
-
export { _default_9 as
|
|
688
|
+
export { _default_9 as default_alias_14 }
|
|
1092
689
|
export { _default_9 as removeFile }
|
|
1093
690
|
export { _default_9 as removeFile_alias_1 }
|
|
1094
691
|
export { _default_9 as removeFile_alias_2 }
|
|
@@ -1100,7 +697,7 @@ export { _default_9 as removeFile_alias_2 }
|
|
|
1100
697
|
export declare const default_alias: {
|
|
1101
698
|
readonly name: "createNewProject";
|
|
1102
699
|
readonly description: "Creates a new project";
|
|
1103
|
-
readonly prompt: "You are an AiTool designed to assist users in creating new projects. Follow these guidelines:\n\n1. **Gather Information:**\n - Begin by asking the user for essential project details, including:\n - Project type (e.g., web, mobile, desktop, etc.)\n - Desired programming languages\n - Preferred frameworks or libraries\n - Build tools and package manager preferences\n - Testing frameworks and patterns\n - Code style and linting preferences\n - Any additional specifications or requirements\n\n2. **Clarification & Confirmation:**\n - Do not make any decisions or assumptions on behalf of the user.\n - Ask clarifying questions if any detail is ambiguous.\n - Confirm each piece of information with the user before proceeding to the next step.\n\n3. **Avoid Redundancy:**\n - Do not repeat questions or details that have already been confirmed.\n - Keep interactions concise and focused on gathering complete and accurate details.\n\n4. **Generate Configuration:**\n - Based on the collected information, generate a .polkacodes.yml configuration file that includes:\n - scripts section with common development commands (test, format, check, etc.)\n - rules section reflecting project conventions and tools\n - excludeFiles section for sensitive files only\n - Example structure:\n ```yaml\n scripts:\n test:\n command: \"[test-command]\"\n description: \"Run tests\"\n format:\n command: \"[format-command]\"\n description: \"Format code\"\n check:\n command: \"[check-command]\"\n description: \"Check code\"\n\n rules:\n - \"[package-manager-rule]\"\n - \"[testing-framework-rule]\"\n - \"[code-style-rule]\"\n - \"[other-rule]\"\n\n excludeFiles:\n - \".env\"\n - \".env.*\"\n ```\n\n5. **Generate Essential Project Files:**\n - Create a .gitattributes file with appropriate configurations:\n - Mark lock files as generated and exclude them from diffs\n - Example for different package managers:\n
|
|
700
|
+
readonly prompt: "You are an AiTool designed to assist users in creating new projects. Follow these guidelines:\n\n1. **Gather Information:**\n - Begin by asking the user for essential project details, including:\n - Project type (e.g., web, mobile, desktop, etc.)\n - Desired programming languages\n - Preferred frameworks or libraries\n - Build tools and package manager preferences\n - Testing frameworks and patterns\n - Code style and linting preferences\n - Any additional specifications or requirements\n\n2. **Clarification & Confirmation:**\n - Do not make any decisions or assumptions on behalf of the user.\n - Ask clarifying questions if any detail is ambiguous.\n - Confirm each piece of information with the user before proceeding to the next step.\n\n3. **Avoid Redundancy:**\n - Do not repeat questions or details that have already been confirmed.\n - Keep interactions concise and focused on gathering complete and accurate details.\n\n4. **Generate Configuration:**\n - Based on the collected information, generate a .polkacodes.yml configuration file that includes:\n - scripts section with common development commands (test, format, check, etc.)\n - rules section reflecting project conventions and tools\n - excludeFiles section for sensitive files only\n - Example structure:\n ```yaml\n scripts:\n test:\n command: \"[test-command]\"\n description: \"Run tests\"\n format:\n command: \"[format-command]\"\n description: \"Format code\"\n check:\n command: \"[check-command]\"\n description: \"Check code\"\n\n rules:\n - \"[package-manager-rule]\"\n - \"[testing-framework-rule]\"\n - \"[code-style-rule]\"\n - \"[other-rule]\"\n\n excludeFiles:\n - \".env\"\n - \".env.*\"\n ```\n\n5. **Generate Essential Project Files:**\n - Create a .gitattributes file with appropriate configurations:\n - Mark lock files as generated and exclude them from diffs\n - Example for different package managers:\n\n # For Bun\n bun.lock linguist-generated=true\n bun.lock -diff\n\n # For npm\n package-lock.json linguist-generated=true\n package-lock.json -diff\n\n # For Yarn\n yarn.lock linguist-generated=true\n yarn.lock -diff\n\n # For pnpm\n pnpm-lock.yaml linguist-generated=true\n pnpm-lock.yaml -diff\n\n - Include other common configurations as needed based on project type\n\n6. **Handover to Coder Agent:**\n - Once all required information is collected and validated by the user, compile:\n 1. The final project specifications\n 2. The .polkacodes.yml configuration content\n - Clearly hand over these details to the coder agent, instructing them to:\n 1. Create the new project based on the confirmed specifications\n 2. Include the .polkacodes.yml file in the project root\n 3. Include the .gitattributes file with appropriate configurations\n 4. Ensure all specified tools and configurations are properly set up";
|
|
1104
701
|
readonly formatInput: (params: string) => string;
|
|
1105
702
|
readonly parseOutput: (output: string) => string;
|
|
1106
703
|
readonly agent: "architect";
|
|
@@ -1138,6 +735,37 @@ export declare const default_alias_3: {
|
|
|
1138
735
|
readonly agent: "analyzer";
|
|
1139
736
|
};
|
|
1140
737
|
|
|
738
|
+
export declare const default_alias_4: {
|
|
739
|
+
readonly name: "reviewDiff";
|
|
740
|
+
readonly description: "Reviews a git diff";
|
|
741
|
+
readonly prompt: "\n# Code Review Prompt\n\nYou are a senior software engineer reviewing code changes.\n\n## Viewing Changes\n- Use **git_diff** to inspect code.\n - **Pull request**: use the provided commit range.\n - **Local changes**: diff staged or unstaged files.\n- If a pull request is present you may receive:\n - <pr_title>\n - <pr_description>\n - <commit_messages>\n- A <review_instructions> tag tells you the focus of the review.\n\n## Focus Areas\n- Readability and maintainability\n- Correctness, edge cases, potential bugs\n- Performance implications\n- Clarity of intent\n- Best-practice adherence\n\n## Output Format\nDo **not** include praise or positive feedback. Ignore generated files such as lock files.\n\nReturn your review as a JSON object inside a ```json block, wrapped like:\n<tool_attempt_completion>\n<tool_parameter_result>\n```json\n{\n \"overview\": \"Summary of overall concerns.\",\n \"specificReviews\": [\n {\n \"file\": \"path/filename.ext\",\n \"lines\": \"N or N-M\",\n \"review\": \"Describe the issue and actionable fix or improvement.\"\n }\n ]\n}\n```\n</tool_parameter_result>\n</tool_attempt_completion>\n";
|
|
742
|
+
readonly formatInput: (params: Input_2) => string;
|
|
743
|
+
readonly parseOutput: (output: string) => Output_2;
|
|
744
|
+
readonly agent: (options: SharedAgentOptions) => AnalyzerAgent;
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
export declare const default_alias_5: {
|
|
748
|
+
handler: ToolHandler<{
|
|
749
|
+
readonly name: "git_diff";
|
|
750
|
+
readonly description: "Get the git diff for the current repository. Can be used to get staged changes, unstaged changes, or changes between commits. By default, it returns unstaged changes.";
|
|
751
|
+
readonly parameters: z.ZodObject<{
|
|
752
|
+
staged: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
753
|
+
commitRange: z.ZodOptional<z.ZodString>;
|
|
754
|
+
file: z.ZodOptional<z.ZodString>;
|
|
755
|
+
}, z.core.$strip>;
|
|
756
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
757
|
+
}, CommandProvider>;
|
|
758
|
+
isAvailable: (provider: CommandProvider) => boolean;
|
|
759
|
+
name: "git_diff";
|
|
760
|
+
description: "Get the git diff for the current repository. Can be used to get staged changes, unstaged changes, or changes between commits. By default, it returns unstaged changes.";
|
|
761
|
+
parameters: z.ZodObject<{
|
|
762
|
+
staged: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
763
|
+
commitRange: z.ZodOptional<z.ZodString>;
|
|
764
|
+
file: z.ZodOptional<z.ZodString>;
|
|
765
|
+
}, z.core.$strip>;
|
|
766
|
+
permissionLevel: PermissionLevel.Read;
|
|
767
|
+
};
|
|
768
|
+
|
|
1141
769
|
/**
|
|
1142
770
|
* Returns the directory portion of a path string.
|
|
1143
771
|
* Strips trailing slashes, then takes everything up to the last slash.
|
|
@@ -1152,10 +780,14 @@ export { EnableCachePolicy as EnableCachePolicy_alias_1 }
|
|
|
1152
780
|
export { EnableCachePolicy as EnableCachePolicy_alias_2 }
|
|
1153
781
|
export { EnableCachePolicy as EnableCachePolicy_alias_3 }
|
|
1154
782
|
|
|
1155
|
-
declare const executeAgentTool: <T extends
|
|
783
|
+
declare const executeAgentTool: <T extends AiToolDefinitionWithAgent<any, any>>(definition: T, options: SharedAgentOptions, params: GetInput<T>) => Promise<GetOutput<T>>;
|
|
1156
784
|
export { executeAgentTool }
|
|
1157
785
|
export { executeAgentTool as executeAgentTool_alias_1 }
|
|
1158
786
|
|
|
787
|
+
declare const executeMultiAgentTool: <T extends AiToolDefinitionWithMultiAgent<any, any>>(definition: T, agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
|
|
788
|
+
export { executeMultiAgentTool }
|
|
789
|
+
export { executeMultiAgentTool as executeMultiAgentTool_alias_1 }
|
|
790
|
+
|
|
1159
791
|
declare const executeTool: <T extends AiToolDefinition<any, any>>(definition: T, ai: LanguageModelV2, params: GetInput<T>, usageMeter: UsageMeter) => Promise<GetOutput<T>>;
|
|
1160
792
|
export { executeTool }
|
|
1161
793
|
export { executeTool as executeTool_alias_1 }
|
|
@@ -1188,28 +820,28 @@ export { FilesystemProvider as FilesystemProvider_alias_2 }
|
|
|
1188
820
|
|
|
1189
821
|
export declare const fullSystemPrompt: (info: {
|
|
1190
822
|
os: string;
|
|
1191
|
-
}, tools:
|
|
823
|
+
}, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
1192
824
|
command: string;
|
|
1193
825
|
description: string;
|
|
1194
826
|
}>, useNativeTool: boolean) => string;
|
|
1195
827
|
|
|
1196
828
|
export declare const fullSystemPrompt_alias_1: (info: {
|
|
1197
829
|
os: string;
|
|
1198
|
-
}, tools:
|
|
830
|
+
}, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
1199
831
|
command: string;
|
|
1200
832
|
description: string;
|
|
1201
833
|
}>, useNativeTool: boolean) => string;
|
|
1202
834
|
|
|
1203
835
|
export declare const fullSystemPrompt_alias_2: (info: {
|
|
1204
836
|
os: string;
|
|
1205
|
-
}, tools:
|
|
837
|
+
}, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
1206
838
|
command: string;
|
|
1207
839
|
description: string;
|
|
1208
840
|
}>, _interactive: boolean, useNativeTool: boolean) => string;
|
|
1209
841
|
|
|
1210
842
|
export declare const fullSystemPrompt_alias_3: (info: {
|
|
1211
843
|
os: string;
|
|
1212
|
-
}, tools:
|
|
844
|
+
}, tools: FullToolInfoV2[], toolNamePrefix: string, instructions: string[], scripts: Record<string, string | {
|
|
1213
845
|
command: string;
|
|
1214
846
|
description: string;
|
|
1215
847
|
}>, useNativeTool: boolean) => string;
|
|
@@ -1290,7 +922,7 @@ export declare const getString: <T extends string>(args: Partial<Record<T, strin
|
|
|
1290
922
|
|
|
1291
923
|
export declare const getStringArray: <T extends string>(args: Partial<Record<T, ToolParameterValue>>, name: T, defaultValue?: string[]) => string[];
|
|
1292
924
|
|
|
1293
|
-
export declare const handler: ToolHandler<typeof toolInfo,
|
|
925
|
+
export declare const handler: ToolHandler<typeof toolInfo, CommandProvider>;
|
|
1294
926
|
|
|
1295
927
|
export declare const handler_alias_1: ToolHandler<typeof toolInfo_alias_1, InteractionProvider>;
|
|
1296
928
|
|
|
@@ -1300,15 +932,17 @@ export declare const handler_alias_11: ToolHandler<typeof toolInfo_alias_11, Fil
|
|
|
1300
932
|
|
|
1301
933
|
export declare const handler_alias_12: ToolHandler<typeof toolInfo_alias_12, FilesystemProvider>;
|
|
1302
934
|
|
|
1303
|
-
export declare const
|
|
935
|
+
export declare const handler_alias_13: ToolHandler<typeof toolInfo_alias_13, FilesystemProvider>;
|
|
936
|
+
|
|
937
|
+
export declare const handler_alias_2: ToolHandler<typeof toolInfo_alias_2, InteractionProvider>;
|
|
1304
938
|
|
|
1305
|
-
export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3,
|
|
939
|
+
export declare const handler_alias_3: ToolHandler<typeof toolInfo_alias_3, any>;
|
|
1306
940
|
|
|
1307
|
-
export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4,
|
|
941
|
+
export declare const handler_alias_4: ToolHandler<typeof toolInfo_alias_4, CommandProvider>;
|
|
1308
942
|
|
|
1309
|
-
export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5,
|
|
943
|
+
export declare const handler_alias_5: ToolHandler<typeof toolInfo_alias_5, WebProvider>;
|
|
1310
944
|
|
|
1311
|
-
export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6,
|
|
945
|
+
export declare const handler_alias_6: ToolHandler<typeof toolInfo_alias_6, any>;
|
|
1312
946
|
|
|
1313
947
|
export declare const handler_alias_7: ToolHandler<typeof toolInfo_alias_7, FilesystemProvider>;
|
|
1314
948
|
|
|
@@ -1323,6 +957,14 @@ declare type Input = {
|
|
|
1323
957
|
branchName: string;
|
|
1324
958
|
};
|
|
1325
959
|
|
|
960
|
+
declare type Input_2 = {
|
|
961
|
+
pullRequestTitle?: string;
|
|
962
|
+
pullRequestDescription?: string;
|
|
963
|
+
commitMessages?: string;
|
|
964
|
+
commitRange?: string;
|
|
965
|
+
staged?: boolean;
|
|
966
|
+
};
|
|
967
|
+
|
|
1326
968
|
declare type InteractionProvider = {
|
|
1327
969
|
askFollowupQuestion?: (question: string, options: string[]) => Promise<string>;
|
|
1328
970
|
attemptCompletion?: (result: string) => Promise<string | undefined>;
|
|
@@ -1331,9 +973,9 @@ export { InteractionProvider }
|
|
|
1331
973
|
export { InteractionProvider as InteractionProvider_alias_1 }
|
|
1332
974
|
export { InteractionProvider as InteractionProvider_alias_2 }
|
|
1333
975
|
|
|
1334
|
-
export declare const isAvailable: (provider:
|
|
976
|
+
export declare const isAvailable: (provider: CommandProvider) => boolean;
|
|
1335
977
|
|
|
1336
|
-
export declare const isAvailable_alias_1: (
|
|
978
|
+
export declare const isAvailable_alias_1: (provider: InteractionProvider) => boolean;
|
|
1337
979
|
|
|
1338
980
|
export declare const isAvailable_alias_10: (provider: FilesystemProvider) => boolean;
|
|
1339
981
|
|
|
@@ -1341,15 +983,17 @@ export declare const isAvailable_alias_11: (provider: FilesystemProvider) => boo
|
|
|
1341
983
|
|
|
1342
984
|
export declare const isAvailable_alias_12: (provider: FilesystemProvider) => boolean;
|
|
1343
985
|
|
|
1344
|
-
export declare const
|
|
986
|
+
export declare const isAvailable_alias_13: (provider: FilesystemProvider) => boolean;
|
|
987
|
+
|
|
988
|
+
export declare const isAvailable_alias_2: (_provider: InteractionProvider) => boolean;
|
|
1345
989
|
|
|
1346
|
-
export declare const isAvailable_alias_3: (
|
|
990
|
+
export declare const isAvailable_alias_3: (_provider: any) => boolean;
|
|
1347
991
|
|
|
1348
|
-
export declare const isAvailable_alias_4: (provider:
|
|
992
|
+
export declare const isAvailable_alias_4: (provider: CommandProvider) => boolean;
|
|
1349
993
|
|
|
1350
|
-
export declare const isAvailable_alias_5: (
|
|
994
|
+
export declare const isAvailable_alias_5: (provider: WebProvider) => boolean;
|
|
1351
995
|
|
|
1352
|
-
export declare const isAvailable_alias_6: (
|
|
996
|
+
export declare const isAvailable_alias_6: (_provider: any) => boolean;
|
|
1353
997
|
|
|
1354
998
|
export declare const isAvailable_alias_7: (provider: FilesystemProvider) => boolean;
|
|
1355
999
|
|
|
@@ -1362,10 +1006,14 @@ export declare const isAvailable_alias_9: (provider: FilesystemProvider) => bool
|
|
|
1362
1006
|
*/
|
|
1363
1007
|
export declare function join(...parts: string[]): string;
|
|
1364
1008
|
|
|
1365
|
-
declare const makeAgentTool: <T extends
|
|
1009
|
+
declare const makeAgentTool: <T extends AiToolDefinitionWithAgent<any, any>>(definition: T) => (options: SharedAgentOptions, params: GetInput<T>) => Promise<GetOutput<T>>;
|
|
1366
1010
|
export { makeAgentTool }
|
|
1367
1011
|
export { makeAgentTool as makeAgentTool_alias_1 }
|
|
1368
1012
|
|
|
1013
|
+
declare const makeMultiAgentTool: <T extends AiToolDefinitionWithMultiAgent<any, any>>(definition: T) => (agent: MultiAgent, params: GetInput<T>) => Promise<GetOutput<T>>;
|
|
1014
|
+
export { makeMultiAgentTool }
|
|
1015
|
+
export { makeMultiAgentTool as makeMultiAgentTool_alias_1 }
|
|
1016
|
+
|
|
1369
1017
|
declare const makeTool: <T extends AiToolDefinition<any, any>>(definition: T) => (ai: LanguageModelV2, params: GetInput<T>, usageMeter: UsageMeter) => Promise<GetOutput<T>>;
|
|
1370
1018
|
export { makeTool }
|
|
1371
1019
|
export { makeTool as makeTool_alias_1 }
|
|
@@ -1429,6 +1077,11 @@ declare type Output = {
|
|
|
1429
1077
|
description: string;
|
|
1430
1078
|
};
|
|
1431
1079
|
|
|
1080
|
+
declare type Output_2 = {
|
|
1081
|
+
overview: string;
|
|
1082
|
+
specificReviews: SpecificReview[];
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1432
1085
|
/**
|
|
1433
1086
|
* Parse an assistant's message into an array of text content and tool use content.
|
|
1434
1087
|
*
|
|
@@ -1528,6 +1181,7 @@ export { ReplaceResult as ReplaceResult_alias_1 }
|
|
|
1528
1181
|
declare const responsePrompts: {
|
|
1529
1182
|
readonly errorInvokeTool: (tool: string, error: unknown) => string;
|
|
1530
1183
|
readonly requireUseTool: "Error: No tool use detected. You MUST use a tool before proceeding.\ne.g. <tool_tool_name>tool_name</tool_tool_name>\n\nEnsure the opening and closing tags are correctly nested and closed, and that you are using the correct tool name.\nAvoid unnecessary text or symbols before or after the tool use.\nAvoid unnecessary escape characters or special characters.\n";
|
|
1184
|
+
readonly requireUseToolNative: "Error: No tool use detected. You MUST use a tool before proceeding.\n";
|
|
1531
1185
|
readonly toolResults: (tool: string, result: UserContent_2) => Array<TextPart | ImagePart | FilePart>;
|
|
1532
1186
|
readonly commandResult: (command: string, exitCode: number, stdout: string, stderr: string) => string;
|
|
1533
1187
|
};
|
|
@@ -1537,6 +1191,23 @@ export { responsePrompts as responsePrompts_alias_2 }
|
|
|
1537
1191
|
|
|
1538
1192
|
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";
|
|
1539
1193
|
|
|
1194
|
+
declare const reviewDiff: (options: SharedAgentOptions, params: {
|
|
1195
|
+
pullRequestTitle?: string;
|
|
1196
|
+
pullRequestDescription?: string;
|
|
1197
|
+
commitMessages?: string;
|
|
1198
|
+
commitRange?: string;
|
|
1199
|
+
staged?: boolean;
|
|
1200
|
+
}) => Promise<{
|
|
1201
|
+
overview: string;
|
|
1202
|
+
specificReviews: {
|
|
1203
|
+
file: string;
|
|
1204
|
+
lines: string;
|
|
1205
|
+
review: string;
|
|
1206
|
+
}[];
|
|
1207
|
+
}>;
|
|
1208
|
+
export { reviewDiff }
|
|
1209
|
+
export { reviewDiff as reviewDiff_alias_1 }
|
|
1210
|
+
|
|
1540
1211
|
export declare const rules: (toolNamePrefix: string) => string;
|
|
1541
1212
|
|
|
1542
1213
|
declare type SharedAgentOptions = {
|
|
@@ -1563,6 +1234,12 @@ export { SharedAgentOptions }
|
|
|
1563
1234
|
export { SharedAgentOptions as SharedAgentOptions_alias_1 }
|
|
1564
1235
|
export { SharedAgentOptions as SharedAgentOptions_alias_2 }
|
|
1565
1236
|
|
|
1237
|
+
declare type SpecificReview = {
|
|
1238
|
+
file: string;
|
|
1239
|
+
lines: string;
|
|
1240
|
+
review: string;
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1566
1243
|
declare const systemInformation: (info: {
|
|
1567
1244
|
os: string;
|
|
1568
1245
|
}) => string;
|
|
@@ -1646,7 +1323,7 @@ export { TaskEventKind as TaskEventKind_alias_2 }
|
|
|
1646
1323
|
*/
|
|
1647
1324
|
declare interface TaskEventStartRequest extends TaskEventBase {
|
|
1648
1325
|
kind: TaskEventKind.StartRequest;
|
|
1649
|
-
userMessage:
|
|
1326
|
+
userMessage: ModelMessage;
|
|
1650
1327
|
}
|
|
1651
1328
|
export { TaskEventStartRequest }
|
|
1652
1329
|
export { TaskEventStartRequest as TaskEventStartRequest_alias_1 }
|
|
@@ -1680,6 +1357,7 @@ export { TaskEventText as TaskEventText_alias_2 }
|
|
|
1680
1357
|
declare interface TaskEventTool extends TaskEventBase {
|
|
1681
1358
|
kind: TaskEventKind.ToolUse | TaskEventKind.ToolReply | TaskEventKind.ToolInvalid | TaskEventKind.ToolError | TaskEventKind.ToolInterrupted;
|
|
1682
1359
|
tool: string;
|
|
1360
|
+
content: any;
|
|
1683
1361
|
}
|
|
1684
1362
|
export { TaskEventTool }
|
|
1685
1363
|
export { TaskEventTool as TaskEventTool_alias_1 }
|
|
@@ -1739,10 +1417,7 @@ export { TextContent as TextContent_alias_2 }
|
|
|
1739
1417
|
|
|
1740
1418
|
declare type ToolExample = {
|
|
1741
1419
|
description: string;
|
|
1742
|
-
|
|
1743
|
-
name: string;
|
|
1744
|
-
value: ToolParameterValue;
|
|
1745
|
-
}[];
|
|
1420
|
+
input: Record<string, ToolParameterValue>;
|
|
1746
1421
|
};
|
|
1747
1422
|
export { ToolExample }
|
|
1748
1423
|
export { ToolExample as ToolExample_alias_1 }
|
|
@@ -1766,6 +1441,17 @@ export { ToolInfo }
|
|
|
1766
1441
|
export { ToolInfo as ToolInfo_alias_1 }
|
|
1767
1442
|
|
|
1768
1443
|
export declare const toolInfo: {
|
|
1444
|
+
readonly name: "git_diff";
|
|
1445
|
+
readonly description: "Get the git diff for the current repository. Can be used to get staged changes, unstaged changes, or changes between commits. By default, it returns unstaged changes.";
|
|
1446
|
+
readonly parameters: z.ZodObject<{
|
|
1447
|
+
staged: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1448
|
+
commitRange: z.ZodOptional<z.ZodString>;
|
|
1449
|
+
file: z.ZodOptional<z.ZodString>;
|
|
1450
|
+
}, z.core.$strip>;
|
|
1451
|
+
readonly permissionLevel: PermissionLevel.Read;
|
|
1452
|
+
};
|
|
1453
|
+
|
|
1454
|
+
export declare const toolInfo_alias_1: {
|
|
1769
1455
|
readonly name: "ask_followup_question";
|
|
1770
1456
|
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.";
|
|
1771
1457
|
readonly parameters: z.ZodObject<{
|
|
@@ -1774,111 +1460,30 @@ export declare const toolInfo: {
|
|
|
1774
1460
|
options: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
1775
1461
|
}, z.core.$strip>>;
|
|
1776
1462
|
}, z.core.$strip>;
|
|
1777
|
-
readonly examples: [{
|
|
1778
|
-
readonly description: "Single clarifying question (no options)";
|
|
1779
|
-
readonly parameters: [{
|
|
1780
|
-
readonly name: "questions";
|
|
1781
|
-
readonly value: {
|
|
1782
|
-
readonly prompt: "What is the target deployment environment?";
|
|
1783
|
-
};
|
|
1784
|
-
}];
|
|
1785
|
-
}, {
|
|
1786
|
-
readonly description: "Single question with multiple-choice options";
|
|
1787
|
-
readonly parameters: [{
|
|
1788
|
-
readonly name: "questions";
|
|
1789
|
-
readonly value: {
|
|
1790
|
-
readonly prompt: "Which frontend framework are you using?";
|
|
1791
|
-
readonly options: ["React", "Angular", "Vue", "Svelte"];
|
|
1792
|
-
};
|
|
1793
|
-
}];
|
|
1794
|
-
}, {
|
|
1795
|
-
readonly description: "Two related questions in one call";
|
|
1796
|
-
readonly parameters: [{
|
|
1797
|
-
readonly name: "questions";
|
|
1798
|
-
readonly value: [{
|
|
1799
|
-
readonly prompt: "What type of application are you building?";
|
|
1800
|
-
}, {
|
|
1801
|
-
readonly prompt: "Preferred programming language?";
|
|
1802
|
-
readonly options: ["JavaScript", "TypeScript", "Python", "Java"];
|
|
1803
|
-
}];
|
|
1804
|
-
}];
|
|
1805
|
-
}, {
|
|
1806
|
-
readonly description: "Binary (yes/no) confirmation";
|
|
1807
|
-
readonly parameters: [{
|
|
1808
|
-
readonly name: "questions";
|
|
1809
|
-
readonly value: {
|
|
1810
|
-
readonly prompt: "Is it acceptable to refactor existing tests to improve performance?";
|
|
1811
|
-
readonly options: ["Yes", "No"];
|
|
1812
|
-
};
|
|
1813
|
-
}];
|
|
1814
|
-
}];
|
|
1815
1463
|
readonly permissionLevel: PermissionLevel.None;
|
|
1816
1464
|
};
|
|
1817
1465
|
|
|
1818
|
-
export declare const
|
|
1819
|
-
readonly name: "
|
|
1820
|
-
readonly description: "
|
|
1466
|
+
export declare const toolInfo_alias_10: {
|
|
1467
|
+
readonly name: "rename_file";
|
|
1468
|
+
readonly description: "Request to rename a file from source path to target path.";
|
|
1821
1469
|
readonly parameters: z.ZodObject<{
|
|
1822
|
-
|
|
1470
|
+
source_path: z.ZodString;
|
|
1471
|
+
target_path: z.ZodString;
|
|
1823
1472
|
}, z.core.$strip>;
|
|
1824
|
-
readonly
|
|
1825
|
-
readonly description: "Request to present the result of the task";
|
|
1826
|
-
readonly parameters: [{
|
|
1827
|
-
readonly name: "result";
|
|
1828
|
-
readonly value: "Your final result description here";
|
|
1829
|
-
}];
|
|
1830
|
-
}];
|
|
1831
|
-
readonly permissionLevel: PermissionLevel.None;
|
|
1473
|
+
readonly permissionLevel: PermissionLevel.Write;
|
|
1832
1474
|
};
|
|
1833
1475
|
|
|
1834
|
-
export declare const
|
|
1476
|
+
export declare const toolInfo_alias_11: {
|
|
1835
1477
|
readonly name: "replace_in_file";
|
|
1836
1478
|
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.";
|
|
1837
1479
|
readonly parameters: z.ZodObject<{
|
|
1838
1480
|
path: z.ZodString;
|
|
1839
1481
|
diff: z.ZodString;
|
|
1840
1482
|
}, z.core.$strip>;
|
|
1841
|
-
readonly examples: [{
|
|
1842
|
-
readonly description: "Request to replace sections of content in a file";
|
|
1843
|
-
readonly parameters: [{
|
|
1844
|
-
readonly name: "path";
|
|
1845
|
-
readonly value: "src/main.js";
|
|
1846
|
-
}, {
|
|
1847
|
-
readonly name: "diff";
|
|
1848
|
-
readonly value: "<<<<<<< SEARCH\nimport React from 'react';\n=======\nimport React, { useState } from 'react';\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\n=======\n>>>>>>> REPLACE\n\n<<<<<<< SEARCH\nreturn (\n <div>\n=======\nfunction handleSubmit() {\n saveData();\n setLoading(false);\n}\n\nreturn (\n <div>\n>>>>>>> REPLACE";
|
|
1849
|
-
}];
|
|
1850
|
-
}, {
|
|
1851
|
-
readonly description: "Request to perform a simple, single-line replacement";
|
|
1852
|
-
readonly parameters: [{
|
|
1853
|
-
readonly name: "path";
|
|
1854
|
-
readonly value: "src/config.js";
|
|
1855
|
-
}, {
|
|
1856
|
-
readonly name: "diff";
|
|
1857
|
-
readonly value: "<<<<<<< SEARCH\nconst API_URL = 'https://api.example.com';\n=======\nconst API_URL = 'https://api.staging.example.com';\n>>>>>>> REPLACE";
|
|
1858
|
-
}];
|
|
1859
|
-
}, {
|
|
1860
|
-
readonly description: "Request to add a new function to a file";
|
|
1861
|
-
readonly parameters: [{
|
|
1862
|
-
readonly name: "path";
|
|
1863
|
-
readonly value: "src/utils.js";
|
|
1864
|
-
}, {
|
|
1865
|
-
readonly name: "diff";
|
|
1866
|
-
readonly value: "<<<<<<< SEARCH\nfunction helperA() {\n // ...\n}\n=======\nfunction helperA() {\n // ...\n}\n\nfunction newHelper() {\n // implementation\n}\n>>>>>>> REPLACE";
|
|
1867
|
-
}];
|
|
1868
|
-
}, {
|
|
1869
|
-
readonly description: "Request to delete a block of code from a file";
|
|
1870
|
-
readonly parameters: [{
|
|
1871
|
-
readonly name: "path";
|
|
1872
|
-
readonly value: "src/app.js";
|
|
1873
|
-
}, {
|
|
1874
|
-
readonly name: "diff";
|
|
1875
|
-
readonly value: "<<<<<<< SEARCH\nfunction oldFeature() {\n // This is no longer needed\n}\n\n=======\n>>>>>>> REPLACE";
|
|
1876
|
-
}];
|
|
1877
|
-
}];
|
|
1878
1483
|
readonly permissionLevel: PermissionLevel.Write;
|
|
1879
1484
|
};
|
|
1880
1485
|
|
|
1881
|
-
export declare const
|
|
1486
|
+
export declare const toolInfo_alias_12: {
|
|
1882
1487
|
readonly name: "search_files";
|
|
1883
1488
|
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.";
|
|
1884
1489
|
readonly parameters: z.ZodObject<{
|
|
@@ -1886,43 +1491,29 @@ export declare const toolInfo_alias_11: {
|
|
|
1886
1491
|
regex: z.ZodString;
|
|
1887
1492
|
filePattern: z.ZodOptional<z.ZodString>;
|
|
1888
1493
|
}, z.core.$strip>;
|
|
1889
|
-
readonly examples: [{
|
|
1890
|
-
readonly description: "Request to perform a regex search across files";
|
|
1891
|
-
readonly parameters: [{
|
|
1892
|
-
readonly name: "path";
|
|
1893
|
-
readonly value: "src";
|
|
1894
|
-
}, {
|
|
1895
|
-
readonly name: "regex";
|
|
1896
|
-
readonly value: "^components/";
|
|
1897
|
-
}, {
|
|
1898
|
-
readonly name: "filePattern";
|
|
1899
|
-
readonly value: "*.ts,*.tsx";
|
|
1900
|
-
}];
|
|
1901
|
-
}];
|
|
1902
1494
|
readonly permissionLevel: PermissionLevel.Read;
|
|
1903
1495
|
};
|
|
1904
1496
|
|
|
1905
|
-
export declare const
|
|
1497
|
+
export declare const toolInfo_alias_13: {
|
|
1906
1498
|
readonly name: "write_to_file";
|
|
1907
1499
|
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 `<`, `>`, or `&`. Also ensure there is no unwanted CDATA tags in the content.";
|
|
1908
1500
|
readonly parameters: z.ZodObject<{
|
|
1909
1501
|
path: z.ZodString;
|
|
1910
1502
|
content: z.ZodString;
|
|
1911
1503
|
}, z.core.$strip>;
|
|
1912
|
-
readonly examples: [{
|
|
1913
|
-
readonly description: "Request to write content to a file";
|
|
1914
|
-
readonly parameters: [{
|
|
1915
|
-
readonly name: "path";
|
|
1916
|
-
readonly value: "src/main.js";
|
|
1917
|
-
}, {
|
|
1918
|
-
readonly name: "content";
|
|
1919
|
-
readonly value: "import React from 'react';\n\nfunction App() {\n return (\n <div>\n <h1>Hello, World!</h1>\n </div>\n );\n}\n\nexport default App;\n";
|
|
1920
|
-
}];
|
|
1921
|
-
}];
|
|
1922
1504
|
readonly permissionLevel: PermissionLevel.Write;
|
|
1923
1505
|
};
|
|
1924
1506
|
|
|
1925
1507
|
export declare const toolInfo_alias_2: {
|
|
1508
|
+
readonly name: "attempt_completion";
|
|
1509
|
+
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.";
|
|
1510
|
+
readonly parameters: z.ZodObject<{
|
|
1511
|
+
result: z.ZodString;
|
|
1512
|
+
}, z.core.$strip>;
|
|
1513
|
+
readonly permissionLevel: PermissionLevel.None;
|
|
1514
|
+
};
|
|
1515
|
+
|
|
1516
|
+
export declare const toolInfo_alias_3: {
|
|
1926
1517
|
readonly name: "delegate";
|
|
1927
1518
|
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.";
|
|
1928
1519
|
readonly parameters: z.ZodObject<{
|
|
@@ -1931,74 +1522,29 @@ export declare const toolInfo_alias_2: {
|
|
|
1931
1522
|
context: z.ZodString;
|
|
1932
1523
|
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
1933
1524
|
}, z.core.$strip>;
|
|
1934
|
-
readonly examples: [{
|
|
1935
|
-
readonly description: "Delegate a code analysis task to the analyzer agent";
|
|
1936
|
-
readonly parameters: [{
|
|
1937
|
-
readonly name: "agentName";
|
|
1938
|
-
readonly value: "analyzer";
|
|
1939
|
-
}, {
|
|
1940
|
-
readonly name: "task";
|
|
1941
|
-
readonly value: "Analyze the authentication implementation";
|
|
1942
|
-
}, {
|
|
1943
|
-
readonly name: "context";
|
|
1944
|
-
readonly value: "Need to understand the security implications of the current auth system";
|
|
1945
|
-
}, {
|
|
1946
|
-
readonly name: "files";
|
|
1947
|
-
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
1948
|
-
}];
|
|
1949
|
-
}];
|
|
1950
1525
|
readonly permissionLevel: PermissionLevel.None;
|
|
1951
1526
|
};
|
|
1952
1527
|
|
|
1953
|
-
export declare const
|
|
1528
|
+
export declare const toolInfo_alias_4: {
|
|
1954
1529
|
readonly name: "execute_command";
|
|
1955
1530
|
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.";
|
|
1956
1531
|
readonly parameters: z.ZodObject<{
|
|
1957
1532
|
command: z.ZodString;
|
|
1958
1533
|
requiresApproval: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1959
1534
|
}, z.core.$strip>;
|
|
1960
|
-
readonly examples: [{
|
|
1961
|
-
readonly description: "Make a build";
|
|
1962
|
-
readonly parameters: [{
|
|
1963
|
-
readonly name: "command";
|
|
1964
|
-
readonly value: "npm run build";
|
|
1965
|
-
}, {
|
|
1966
|
-
readonly name: "requiresApproval";
|
|
1967
|
-
readonly value: "false";
|
|
1968
|
-
}];
|
|
1969
|
-
}];
|
|
1970
1535
|
readonly permissionLevel: PermissionLevel.Arbitrary;
|
|
1971
1536
|
};
|
|
1972
1537
|
|
|
1973
|
-
export declare const
|
|
1538
|
+
export declare const toolInfo_alias_5: {
|
|
1974
1539
|
readonly name: "fetch_url";
|
|
1975
1540
|
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.";
|
|
1976
1541
|
readonly parameters: z.ZodObject<{
|
|
1977
1542
|
url: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
1978
1543
|
}, z.core.$strip>;
|
|
1979
|
-
readonly examples: [{
|
|
1980
|
-
readonly description: "Fetch a single webpage";
|
|
1981
|
-
readonly parameters: [{
|
|
1982
|
-
readonly name: "url";
|
|
1983
|
-
readonly value: "https://example.com";
|
|
1984
|
-
}];
|
|
1985
|
-
}, {
|
|
1986
|
-
readonly description: "Fetch multiple webpages";
|
|
1987
|
-
readonly parameters: [{
|
|
1988
|
-
readonly name: "url";
|
|
1989
|
-
readonly value: "https://example.com,https://developer.mozilla.org/en-US/docs/Web/HTTP";
|
|
1990
|
-
}];
|
|
1991
|
-
}, {
|
|
1992
|
-
readonly description: "Fetch a raw file from GitHub";
|
|
1993
|
-
readonly parameters: [{
|
|
1994
|
-
readonly name: "url";
|
|
1995
|
-
readonly value: "https://raw.githubusercontent.com/user/repo/main/README.md";
|
|
1996
|
-
}];
|
|
1997
|
-
}];
|
|
1998
1544
|
readonly permissionLevel: PermissionLevel.Read;
|
|
1999
1545
|
};
|
|
2000
1546
|
|
|
2001
|
-
export declare const
|
|
1547
|
+
export declare const toolInfo_alias_6: {
|
|
2002
1548
|
readonly name: "hand_over";
|
|
2003
1549
|
readonly description: "Hand over the current task to another agent to complete. This tool MUST NOT to be used with any other tool.";
|
|
2004
1550
|
readonly parameters: z.ZodObject<{
|
|
@@ -2007,26 +1553,10 @@ export declare const toolInfo_alias_5: {
|
|
|
2007
1553
|
context: z.ZodString;
|
|
2008
1554
|
files: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>>;
|
|
2009
1555
|
}, z.core.$strip>;
|
|
2010
|
-
readonly examples: [{
|
|
2011
|
-
readonly description: "Hand over a coding task to the coder agent";
|
|
2012
|
-
readonly parameters: [{
|
|
2013
|
-
readonly name: "agentName";
|
|
2014
|
-
readonly value: "coder";
|
|
2015
|
-
}, {
|
|
2016
|
-
readonly name: "task";
|
|
2017
|
-
readonly value: "Implement the login feature";
|
|
2018
|
-
}, {
|
|
2019
|
-
readonly name: "context";
|
|
2020
|
-
readonly value: "We need a secure login system with email and password";
|
|
2021
|
-
}, {
|
|
2022
|
-
readonly name: "files";
|
|
2023
|
-
readonly value: "src/auth/login.ts,src/auth/types.ts";
|
|
2024
|
-
}];
|
|
2025
|
-
}];
|
|
2026
1556
|
readonly permissionLevel: PermissionLevel.None;
|
|
2027
1557
|
};
|
|
2028
1558
|
|
|
2029
|
-
export declare const
|
|
1559
|
+
export declare const toolInfo_alias_7: {
|
|
2030
1560
|
readonly name: "list_files";
|
|
2031
1561
|
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.";
|
|
2032
1562
|
readonly parameters: z.ZodObject<{
|
|
@@ -2034,74 +1564,24 @@ export declare const toolInfo_alias_6: {
|
|
|
2034
1564
|
maxCount: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
2035
1565
|
recursive: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
2036
1566
|
}, z.core.$strip>;
|
|
2037
|
-
readonly examples: [{
|
|
2038
|
-
readonly description: "Request to list files";
|
|
2039
|
-
readonly parameters: [{
|
|
2040
|
-
readonly name: "path";
|
|
2041
|
-
readonly value: "src";
|
|
2042
|
-
}, {
|
|
2043
|
-
readonly name: "maxCount";
|
|
2044
|
-
readonly value: "100";
|
|
2045
|
-
}];
|
|
2046
|
-
}];
|
|
2047
1567
|
readonly permissionLevel: PermissionLevel.Read;
|
|
2048
1568
|
};
|
|
2049
1569
|
|
|
2050
|
-
export declare const
|
|
1570
|
+
export declare const toolInfo_alias_8: {
|
|
2051
1571
|
readonly name: "read_file";
|
|
2052
1572
|
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.";
|
|
2053
1573
|
readonly parameters: z.ZodObject<{
|
|
2054
1574
|
path: z.ZodPipe<z.ZodTransform<string[], unknown>, z.ZodArray<z.ZodString>>;
|
|
2055
1575
|
}, z.core.$strip>;
|
|
2056
|
-
readonly examples: [{
|
|
2057
|
-
readonly description: "Request to read the contents of a file";
|
|
2058
|
-
readonly parameters: [{
|
|
2059
|
-
readonly name: "path";
|
|
2060
|
-
readonly value: "src/main.js";
|
|
2061
|
-
}];
|
|
2062
|
-
}, {
|
|
2063
|
-
readonly description: "Request to read multiple files";
|
|
2064
|
-
readonly parameters: [{
|
|
2065
|
-
readonly name: "path";
|
|
2066
|
-
readonly value: "src/main.js,src/index.js";
|
|
2067
|
-
}];
|
|
2068
|
-
}];
|
|
2069
1576
|
readonly permissionLevel: PermissionLevel.Read;
|
|
2070
1577
|
};
|
|
2071
1578
|
|
|
2072
|
-
export declare const
|
|
1579
|
+
export declare const toolInfo_alias_9: {
|
|
2073
1580
|
readonly name: "remove_file";
|
|
2074
1581
|
readonly description: "Request to remove a file at the specified path.";
|
|
2075
1582
|
readonly parameters: z.ZodObject<{
|
|
2076
1583
|
path: z.ZodString;
|
|
2077
1584
|
}, z.core.$strip>;
|
|
2078
|
-
readonly examples: [{
|
|
2079
|
-
readonly description: "Request to remove a file";
|
|
2080
|
-
readonly parameters: [{
|
|
2081
|
-
readonly name: "path";
|
|
2082
|
-
readonly value: "src/main.js";
|
|
2083
|
-
}];
|
|
2084
|
-
}];
|
|
2085
|
-
readonly permissionLevel: PermissionLevel.Write;
|
|
2086
|
-
};
|
|
2087
|
-
|
|
2088
|
-
export declare const toolInfo_alias_9: {
|
|
2089
|
-
readonly name: "rename_file";
|
|
2090
|
-
readonly description: "Request to rename a file from source path to target path.";
|
|
2091
|
-
readonly parameters: z.ZodObject<{
|
|
2092
|
-
source_path: z.ZodString;
|
|
2093
|
-
target_path: z.ZodString;
|
|
2094
|
-
}, z.core.$strip>;
|
|
2095
|
-
readonly examples: [{
|
|
2096
|
-
readonly description: "Request to rename a file";
|
|
2097
|
-
readonly parameters: [{
|
|
2098
|
-
readonly name: "source_path";
|
|
2099
|
-
readonly value: "src/old-name.js";
|
|
2100
|
-
}, {
|
|
2101
|
-
readonly name: "target_path";
|
|
2102
|
-
readonly value: "src/new-name.js";
|
|
2103
|
-
}];
|
|
2104
|
-
}];
|
|
2105
1585
|
readonly permissionLevel: PermissionLevel.Write;
|
|
2106
1586
|
};
|
|
2107
1587
|
|
|
@@ -2109,7 +1589,6 @@ declare type ToolInfoV2 = {
|
|
|
2109
1589
|
name: string;
|
|
2110
1590
|
description: string;
|
|
2111
1591
|
parameters: z.ZodObject<any>;
|
|
2112
|
-
examples?: ToolExample[];
|
|
2113
1592
|
permissionLevel: PermissionLevel;
|
|
2114
1593
|
};
|
|
2115
1594
|
export { ToolInfoV2 }
|
|
@@ -2195,10 +1674,12 @@ declare type ToolResponseOrToolPause = {
|
|
|
2195
1674
|
type: 'response';
|
|
2196
1675
|
tool: string;
|
|
2197
1676
|
response: UserContent;
|
|
1677
|
+
id?: string;
|
|
2198
1678
|
} | {
|
|
2199
1679
|
type: 'pause';
|
|
2200
1680
|
tool: string;
|
|
2201
1681
|
object: any;
|
|
1682
|
+
id?: string;
|
|
2202
1683
|
};
|
|
2203
1684
|
export { ToolResponseOrToolPause }
|
|
2204
1685
|
export { ToolResponseOrToolPause as ToolResponseOrToolPause_alias_1 }
|
|
@@ -2232,6 +1713,7 @@ export { ToolResponseType }
|
|
|
2232
1713
|
export { ToolResponseType as ToolResponseType_alias_1 }
|
|
2233
1714
|
|
|
2234
1715
|
declare interface ToolUse {
|
|
1716
|
+
id?: string;
|
|
2235
1717
|
type: 'tool_use';
|
|
2236
1718
|
name: string;
|
|
2237
1719
|
params: Record<string, any>;
|
|
@@ -2240,7 +1722,7 @@ export { ToolUse }
|
|
|
2240
1722
|
export { ToolUse as ToolUse_alias_1 }
|
|
2241
1723
|
export { ToolUse as ToolUse_alias_2 }
|
|
2242
1724
|
|
|
2243
|
-
declare const toolUsePrompt: (tools:
|
|
1725
|
+
declare const toolUsePrompt: (tools: FullToolInfoV2[], toolNamePrefix: string) => string;
|
|
2244
1726
|
export { toolUsePrompt }
|
|
2245
1727
|
export { toolUsePrompt as toolUsePrompt_alias_1 }
|
|
2246
1728
|
export { toolUsePrompt as toolUsePrompt_alias_2 }
|