evoltagent 1.1.3 → 1.1.4
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/index.d.ts +1541 -228
- package/dist/index.js +2483 -442
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ChildProcess } from 'child_process';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Post-run hooks for agent output processing
|
|
3
5
|
*
|
|
@@ -41,7 +43,7 @@ type PostProcessor = (response: string) => Promise<any>;
|
|
|
41
43
|
*/
|
|
42
44
|
|
|
43
45
|
interface Message$1 {
|
|
44
|
-
role: 'system' | 'user' | 'assistant';
|
|
46
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
45
47
|
content: string;
|
|
46
48
|
images?: string | string[];
|
|
47
49
|
type?: string;
|
|
@@ -50,11 +52,6 @@ interface ToolCall {
|
|
|
50
52
|
type: 'system' | 'user';
|
|
51
53
|
extractedResult: () => string;
|
|
52
54
|
}
|
|
53
|
-
interface ModelResponse$1 {
|
|
54
|
-
type: 'system' | 'user' | 'TaskCompletion';
|
|
55
|
-
extractedResult: () => string | any[] | Record<string, any>;
|
|
56
|
-
rawContentFromLlm?: string;
|
|
57
|
-
}
|
|
58
55
|
interface ToolDescription {
|
|
59
56
|
desc: string;
|
|
60
57
|
execute: (...args: any[]) => Promise<any>;
|
|
@@ -90,19 +87,6 @@ interface ModelConfig {
|
|
|
90
87
|
stream?: boolean;
|
|
91
88
|
[key: string]: any;
|
|
92
89
|
}
|
|
93
|
-
interface AgentConfig {
|
|
94
|
-
name: string;
|
|
95
|
-
profile: string;
|
|
96
|
-
system?: string;
|
|
97
|
-
tools?: string[];
|
|
98
|
-
subAgents?: any[];
|
|
99
|
-
mcpServerNames?: string[];
|
|
100
|
-
modelConfig?: string | ModelConfig;
|
|
101
|
-
verbose?: boolean | number;
|
|
102
|
-
useFunctionCalling?: boolean;
|
|
103
|
-
postProcessor?: PostProcessor;
|
|
104
|
-
toolcallManagerPoolSize?: number;
|
|
105
|
-
}
|
|
106
90
|
interface EnvironmentConfig {
|
|
107
91
|
workspace?: string;
|
|
108
92
|
[key: string]: any;
|
|
@@ -401,156 +385,42 @@ declare class GitTool {
|
|
|
401
385
|
}
|
|
402
386
|
|
|
403
387
|
/**
|
|
404
|
-
*
|
|
388
|
+
* Image reading utilities
|
|
405
389
|
*
|
|
406
|
-
*
|
|
390
|
+
* Corresponds to Python's utils/read_image.py
|
|
407
391
|
*/
|
|
408
|
-
|
|
409
392
|
/**
|
|
410
|
-
*
|
|
393
|
+
* OpenAI vision API format for image content
|
|
411
394
|
*/
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
private functionCallingTools;
|
|
418
|
-
private mcpServerNames;
|
|
419
|
-
private modelConfig;
|
|
420
|
-
private verbose;
|
|
421
|
-
private model;
|
|
422
|
-
private history;
|
|
423
|
-
private subAgents;
|
|
424
|
-
private toolcallManagerPoolSize;
|
|
425
|
-
private postProcessor;
|
|
426
|
-
private useFunctionCalling;
|
|
427
|
-
constructor(config: AgentConfig);
|
|
428
|
-
/**
|
|
429
|
-
* Get the current system prompt
|
|
430
|
-
*/
|
|
431
|
-
get systemPrompt(): string;
|
|
432
|
-
/**
|
|
433
|
-
* Set the system prompt and update history
|
|
434
|
-
*/
|
|
435
|
-
set systemPrompt(value: string);
|
|
436
|
-
/**
|
|
437
|
-
* Set the system prompt with system tools descriptions
|
|
438
|
-
* @private
|
|
439
|
-
*/
|
|
440
|
-
private setSystem;
|
|
441
|
-
/**
|
|
442
|
-
* Set up function calling tools for OpenAI-style function calling
|
|
443
|
-
* @private
|
|
444
|
-
*/
|
|
445
|
-
private setFunctionCallingTools;
|
|
446
|
-
/**
|
|
447
|
-
* Agent loop - processes user input and handles tool calls
|
|
448
|
-
* @private
|
|
449
|
-
*/
|
|
450
|
-
private _agentLoop;
|
|
451
|
-
/**
|
|
452
|
-
* Run the agent with given instruction
|
|
453
|
-
*/
|
|
454
|
-
run(instruction: string, images?: string | string[]): Promise<string | any>;
|
|
455
|
-
/**
|
|
456
|
-
* Get agent profile
|
|
457
|
-
*/
|
|
458
|
-
getProfile(): string;
|
|
459
|
-
/**
|
|
460
|
-
* Get tools
|
|
461
|
-
*/
|
|
462
|
-
getTools(): string[];
|
|
463
|
-
/**
|
|
464
|
-
* Get function calling tools schemas
|
|
465
|
-
*/
|
|
466
|
-
getFunctionCallingTools(): any[];
|
|
467
|
-
/**
|
|
468
|
-
* Get MCP server names
|
|
469
|
-
*/
|
|
470
|
-
getMcpServerNames(): string[];
|
|
471
|
-
/**
|
|
472
|
-
* Get model config (string or ModelConfig object)
|
|
473
|
-
*/
|
|
474
|
-
getModelConfig(): string | ModelConfig;
|
|
475
|
-
/**
|
|
476
|
-
* Get model name (for backward compatibility)
|
|
477
|
-
*/
|
|
478
|
-
getModelName(): string;
|
|
479
|
-
/**
|
|
480
|
-
* Get verbose setting
|
|
481
|
-
*/
|
|
482
|
-
getVerbose(): boolean | number;
|
|
483
|
-
/**
|
|
484
|
-
* Get sub-agents
|
|
485
|
-
*/
|
|
486
|
-
getSubAgents(): any[];
|
|
395
|
+
interface ImageContent {
|
|
396
|
+
type: 'image_url';
|
|
397
|
+
image_url: {
|
|
398
|
+
url: string;
|
|
399
|
+
};
|
|
487
400
|
}
|
|
488
|
-
|
|
489
401
|
/**
|
|
490
|
-
*
|
|
402
|
+
* Check if the file is a supported image format
|
|
491
403
|
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
* - Anthropic Claude
|
|
495
|
-
* - Google Gemini
|
|
404
|
+
* @param imagePath - Path or URL to the image
|
|
405
|
+
* @returns true if the image format is supported (jpeg, jpg, png, gif, webp), false otherwise (svg, etc.)
|
|
496
406
|
*/
|
|
497
|
-
|
|
407
|
+
declare function isSupportedImageFile(imagePath: string): boolean;
|
|
498
408
|
/**
|
|
499
|
-
*
|
|
409
|
+
* Synchronously read image and convert to base64 format
|
|
410
|
+
*
|
|
411
|
+
* @param imagePath - Image path or URL
|
|
412
|
+
* @returns OpenAI vision API format image content
|
|
413
|
+
* @throws Error if image file not found or URL request fails
|
|
500
414
|
*/
|
|
501
|
-
|
|
502
|
-
type: 'system' | 'user' | 'TaskCompletion';
|
|
503
|
-
extractedResult: () => string | any[] | Record<string, any>;
|
|
504
|
-
rawContentFromLlm?: string;
|
|
505
|
-
}
|
|
415
|
+
declare function readImage(imagePath: string): ImageContent;
|
|
506
416
|
/**
|
|
507
|
-
*
|
|
508
|
-
*
|
|
417
|
+
* Asynchronously read image and convert to base64 format
|
|
418
|
+
*
|
|
419
|
+
* @param imagePath - Image path or URL
|
|
420
|
+
* @returns OpenAI vision API format image content
|
|
421
|
+
* @throws Error if image file not found or URL request fails
|
|
509
422
|
*/
|
|
510
|
-
declare
|
|
511
|
-
private modelName;
|
|
512
|
-
private config;
|
|
513
|
-
private openaiClient?;
|
|
514
|
-
private anthropicClient?;
|
|
515
|
-
private geminiClient?;
|
|
516
|
-
constructor(model?: string | ModelConfig);
|
|
517
|
-
/**
|
|
518
|
-
* Initialize the appropriate SDK client based on provider
|
|
519
|
-
*/
|
|
520
|
-
private _initializeClient;
|
|
521
|
-
/**
|
|
522
|
-
* Asynchronous chat completion
|
|
523
|
-
*/
|
|
524
|
-
achat(messages: any[], tools?: any[], stream?: boolean): Promise<ModelResponse[]>;
|
|
525
|
-
/**
|
|
526
|
-
* Call OpenAI-compatible API (OpenAI, DeepSeek, etc.)
|
|
527
|
-
*/
|
|
528
|
-
private _callOpenAICompatible;
|
|
529
|
-
/**
|
|
530
|
-
* Call Anthropic API
|
|
531
|
-
*/
|
|
532
|
-
private _callAnthropic;
|
|
533
|
-
/**
|
|
534
|
-
* Call Google Gemini API
|
|
535
|
-
*/
|
|
536
|
-
private _callGemini;
|
|
537
|
-
/**
|
|
538
|
-
* Convert OpenAI format messages to Gemini format
|
|
539
|
-
*/
|
|
540
|
-
private _convertMessagesToGeminiFormat;
|
|
541
|
-
/**
|
|
542
|
-
* Get model configuration
|
|
543
|
-
*/
|
|
544
|
-
getConfig(): ModelConfig;
|
|
545
|
-
/**
|
|
546
|
-
* Get model name
|
|
547
|
-
*/
|
|
548
|
-
getName(): string;
|
|
549
|
-
/**
|
|
550
|
-
* Check if model supports tool calling
|
|
551
|
-
*/
|
|
552
|
-
supportsToolCalling(): boolean;
|
|
553
|
-
}
|
|
423
|
+
declare function areadImage(imagePath: string): Promise<ImageContent>;
|
|
554
424
|
|
|
555
425
|
/**
|
|
556
426
|
* Message class for conversation history
|
|
@@ -562,11 +432,16 @@ declare class Model {
|
|
|
562
432
|
* Message class representing a single message in conversation
|
|
563
433
|
*/
|
|
564
434
|
declare class Message implements Message$1 {
|
|
565
|
-
role: 'system' | 'user' | 'assistant';
|
|
435
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
566
436
|
content: string;
|
|
567
437
|
images?: string | string[];
|
|
438
|
+
imagesContent?: ImageContent[];
|
|
439
|
+
tag?: string;
|
|
440
|
+
isFunctionCall?: boolean;
|
|
441
|
+
toolCallId?: string;
|
|
442
|
+
toolName?: string;
|
|
568
443
|
type?: string;
|
|
569
|
-
constructor(role: 'system' | 'user' | 'assistant', content: string, images?: string | string[], type?: string);
|
|
444
|
+
constructor(role: 'system' | 'user' | 'assistant' | 'tool', content: string, images?: string | string[], type?: string);
|
|
570
445
|
/**
|
|
571
446
|
* Create message from user input
|
|
572
447
|
*/
|
|
@@ -579,10 +454,36 @@ declare class Message implements Message$1 {
|
|
|
579
454
|
* Create system message
|
|
580
455
|
*/
|
|
581
456
|
static fromSystemMsg(content: string): Message;
|
|
457
|
+
/**
|
|
458
|
+
* Check if message is truthy based on content
|
|
459
|
+
*/
|
|
460
|
+
isTruthy(): boolean;
|
|
461
|
+
/**
|
|
462
|
+
* Format the content with pre/post content and optional tag wrapping
|
|
463
|
+
*/
|
|
464
|
+
private _formatForContent;
|
|
465
|
+
/**
|
|
466
|
+
* Ensure text content is not empty to avoid API errors
|
|
467
|
+
*/
|
|
468
|
+
private static _ensureNonEmptyText;
|
|
469
|
+
/**
|
|
470
|
+
* Format message for OpenAI API
|
|
471
|
+
*
|
|
472
|
+
* This is the recommended method replacing toChatMessage.
|
|
473
|
+
*
|
|
474
|
+
* @param preContent - Content to prepend
|
|
475
|
+
* @param postContent - Content to append
|
|
476
|
+
* @returns Formatted message object for API
|
|
477
|
+
*/
|
|
478
|
+
formatForApi(preContent?: string, postContent?: string): Record<string, any>;
|
|
582
479
|
/**
|
|
583
480
|
* Convert to plain object for API calls
|
|
584
481
|
*/
|
|
585
482
|
toObject(): any;
|
|
483
|
+
/**
|
|
484
|
+
* Convert to dictionary representation
|
|
485
|
+
*/
|
|
486
|
+
toDict(): Record<string, any>;
|
|
586
487
|
/**
|
|
587
488
|
* Check if message contains images
|
|
588
489
|
*/
|
|
@@ -595,8 +496,18 @@ declare class Message implements Message$1 {
|
|
|
595
496
|
* Convert to string representation
|
|
596
497
|
*/
|
|
597
498
|
toString(): string;
|
|
499
|
+
/**
|
|
500
|
+
* Merge two messages into one
|
|
501
|
+
*
|
|
502
|
+
* @param other - Message to merge with
|
|
503
|
+
* @returns New merged Message
|
|
504
|
+
*/
|
|
505
|
+
merge(other: Message): Message;
|
|
598
506
|
/**
|
|
599
507
|
* Convert to OpenAI Vision API format with base64-encoded images
|
|
508
|
+
*
|
|
509
|
+
* @deprecated Use formatForApi instead. Will be removed in 0.2.2.
|
|
510
|
+
*
|
|
600
511
|
* This method handles:
|
|
601
512
|
* - HTTP/HTTPS URLs: Downloads and converts to base64
|
|
602
513
|
* - Local file paths: Reads file and converts to base64
|
|
@@ -618,56 +529,96 @@ declare class Message implements Message$1 {
|
|
|
618
529
|
}
|
|
619
530
|
|
|
620
531
|
/**
|
|
621
|
-
*
|
|
532
|
+
* ImageTool - Tool for reading images from paths or URLs
|
|
622
533
|
*
|
|
623
|
-
*
|
|
534
|
+
* Corresponds to Python's tools/image_tool.py
|
|
624
535
|
*/
|
|
536
|
+
|
|
625
537
|
/**
|
|
626
|
-
*
|
|
538
|
+
* Tool for reading images from paths or URLs
|
|
627
539
|
*/
|
|
628
|
-
|
|
540
|
+
declare class ImageTool {
|
|
541
|
+
/**
|
|
542
|
+
* Read and analyze an image (JPEG, JPG, PNG, GIF, WebP) from image path or URL.
|
|
543
|
+
*
|
|
544
|
+
* Note: SVG format is not supported by the AI model.
|
|
545
|
+
*
|
|
546
|
+
* @param imagePath - Image path or URL
|
|
547
|
+
* @param instruction - Instruction for analyzing the image
|
|
548
|
+
* @returns Message containing image content in base64 format
|
|
549
|
+
*/
|
|
550
|
+
readImage(imagePath: string, instruction?: string): Promise<Message>;
|
|
551
|
+
/**
|
|
552
|
+
* Read images (JPEG, JPG, PNG, GIF, WebP) from image paths or URLs.
|
|
553
|
+
*
|
|
554
|
+
* Note: SVG format is not supported by the AI model and will be automatically filtered out.
|
|
555
|
+
*
|
|
556
|
+
* @param imagePaths - List of image paths or URLs
|
|
557
|
+
* @param instruction - Instruction for reading the images
|
|
558
|
+
* @returns Message containing multiple image contents in base64 format
|
|
559
|
+
*/
|
|
560
|
+
readImages(imagePaths: string[], instruction?: string): Promise<Message>;
|
|
561
|
+
}
|
|
562
|
+
|
|
629
563
|
/**
|
|
630
|
-
*
|
|
564
|
+
* PatchTool - Tool for applying patches to files
|
|
565
|
+
*
|
|
566
|
+
* Corresponds to Python's tools/patch_tool.py
|
|
631
567
|
*/
|
|
632
|
-
type ToolcallType = 'system' | 'user' | 'TaskCompletion';
|
|
633
568
|
/**
|
|
634
|
-
*
|
|
569
|
+
* Tool for applying patches to files
|
|
635
570
|
*/
|
|
636
|
-
declare class
|
|
637
|
-
name: string;
|
|
638
|
-
input: Record<string, any>;
|
|
639
|
-
isExtractedSuccess: boolean;
|
|
640
|
-
failedExtractedReason?: string;
|
|
641
|
-
executedState: ToolcallState;
|
|
642
|
-
executedContent?: string;
|
|
643
|
-
toolCallId: string;
|
|
644
|
-
type: ToolcallType;
|
|
645
|
-
rawContentFromLlm?: string;
|
|
646
|
-
constructor(config: {
|
|
647
|
-
name: string;
|
|
648
|
-
input?: Record<string, any>;
|
|
649
|
-
isExtractedSuccess?: boolean;
|
|
650
|
-
failedExtractedReason?: string;
|
|
651
|
-
executedState?: ToolcallState;
|
|
652
|
-
executedContent?: string;
|
|
653
|
-
toolCallId?: string;
|
|
654
|
-
type?: ToolcallType;
|
|
655
|
-
rawContentFromLlm?: string;
|
|
656
|
-
});
|
|
571
|
+
declare class PatchTool {
|
|
657
572
|
/**
|
|
658
|
-
*
|
|
573
|
+
* Write patch content to file
|
|
574
|
+
*
|
|
575
|
+
* @param patchPath - Path to the patch file
|
|
576
|
+
* @param patchContent - Content of the patch in unified diff format
|
|
577
|
+
* @returns Success message
|
|
659
578
|
*/
|
|
660
|
-
|
|
579
|
+
writePatchFile(patchPath: string, patchContent: string): Promise<string>;
|
|
661
580
|
/**
|
|
662
|
-
*
|
|
581
|
+
* Apply a patch to a file
|
|
582
|
+
*
|
|
583
|
+
* @param patchPath - Path to the patch file
|
|
584
|
+
* @param patchContent - Optional patch content to write before applying
|
|
585
|
+
* @returns Success message
|
|
663
586
|
*/
|
|
664
|
-
|
|
587
|
+
applyPatch(patchPath: string, patchContent?: string): Promise<string>;
|
|
588
|
+
/**
|
|
589
|
+
* Validate patch format
|
|
590
|
+
*/
|
|
591
|
+
private _validatePatchFormat;
|
|
592
|
+
/**
|
|
593
|
+
* Convert git diff format to unified diff format
|
|
594
|
+
*/
|
|
595
|
+
private _convertGitDiffToUnifiedDiff;
|
|
596
|
+
/**
|
|
597
|
+
* Extract target file path from patch content
|
|
598
|
+
*/
|
|
599
|
+
private _extractTargetFile;
|
|
600
|
+
/**
|
|
601
|
+
* Determine working directory for applying patch
|
|
602
|
+
*/
|
|
603
|
+
private _determineWorkDir;
|
|
604
|
+
/**
|
|
605
|
+
* Apply patch using patch command or manual fallback
|
|
606
|
+
*/
|
|
607
|
+
private _applyPatch;
|
|
608
|
+
/**
|
|
609
|
+
* Execute patch command
|
|
610
|
+
*/
|
|
611
|
+
private _executePatchCommand;
|
|
612
|
+
/**
|
|
613
|
+
* Manually apply patch by parsing unified diff format
|
|
614
|
+
*/
|
|
615
|
+
private _applyPatchManually;
|
|
665
616
|
}
|
|
666
617
|
|
|
667
618
|
/**
|
|
668
619
|
* Message history management
|
|
669
620
|
*
|
|
670
|
-
* Converts Python's message_history.py to TypeScript
|
|
621
|
+
* Converts Python's runtime/memory/message_history.py to TypeScript
|
|
671
622
|
*/
|
|
672
623
|
|
|
673
624
|
/**
|
|
@@ -731,77 +682,1410 @@ declare class MessageHistory {
|
|
|
731
682
|
}
|
|
732
683
|
|
|
733
684
|
/**
|
|
734
|
-
*
|
|
685
|
+
* AgentConfig - Configuration interface for Agent
|
|
735
686
|
*
|
|
736
|
-
*
|
|
687
|
+
* Corresponds to Python's core/agent_config.py
|
|
688
|
+
* Separates configuration from business logic.
|
|
737
689
|
*/
|
|
738
690
|
|
|
739
691
|
/**
|
|
740
|
-
*
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
692
|
+
* Tool Executor Protocol interface
|
|
693
|
+
* Will be fully defined in runtime/executors
|
|
694
|
+
*/
|
|
695
|
+
interface ToolExecutorProtocol$1 {
|
|
696
|
+
start(): Promise<void>;
|
|
697
|
+
shutdown(options?: {
|
|
698
|
+
wait?: boolean;
|
|
699
|
+
}): Promise<void>;
|
|
700
|
+
submit(toolcall: any): Promise<void>;
|
|
701
|
+
submitMany(toolcalls: Iterable<any>, options?: {
|
|
702
|
+
parallel?: boolean;
|
|
703
|
+
}): Promise<void>;
|
|
704
|
+
observe(options?: {
|
|
705
|
+
wait?: boolean;
|
|
706
|
+
timeout?: number;
|
|
707
|
+
maxItems?: number;
|
|
708
|
+
}): Promise<any[]>;
|
|
709
|
+
waitAll(): Promise<void>;
|
|
710
|
+
status(): Record<string, any>;
|
|
711
|
+
clear(): void;
|
|
748
712
|
}
|
|
749
713
|
/**
|
|
750
|
-
*
|
|
714
|
+
* Configuration interface for Agent
|
|
715
|
+
*
|
|
716
|
+
* This interface encapsulates all configuration parameters for an Agent,
|
|
717
|
+
* separating configuration management from business logic.
|
|
751
718
|
*/
|
|
752
|
-
|
|
719
|
+
interface AgentConfig {
|
|
753
720
|
/**
|
|
754
|
-
*
|
|
721
|
+
* Agent identifier for logging and tracking
|
|
755
722
|
*/
|
|
756
|
-
|
|
723
|
+
name: string;
|
|
757
724
|
/**
|
|
758
|
-
*
|
|
725
|
+
* Profile of the agent, used as base for system prompt
|
|
759
726
|
*/
|
|
760
|
-
|
|
761
|
-
constructor(agents?: Agent[], agentSkills?: Record<string, string[]>);
|
|
727
|
+
profile: string;
|
|
762
728
|
/**
|
|
763
|
-
*
|
|
729
|
+
* Custom system prompt (overrides profile if provided)
|
|
764
730
|
*/
|
|
765
|
-
|
|
731
|
+
system?: string;
|
|
766
732
|
/**
|
|
767
|
-
*
|
|
733
|
+
* List of tool names available to the agent
|
|
768
734
|
*/
|
|
769
|
-
|
|
735
|
+
tools?: string[];
|
|
736
|
+
/**
|
|
737
|
+
* List of sub-agents that can be called as tools
|
|
738
|
+
*/
|
|
739
|
+
subAgents?: any[];
|
|
740
|
+
/**
|
|
741
|
+
* MCP server names for external tool integration
|
|
742
|
+
*/
|
|
743
|
+
mcpServerNames?: string[];
|
|
744
|
+
/**
|
|
745
|
+
* Whether to use function calling mode
|
|
746
|
+
*/
|
|
747
|
+
useFunctionCalling?: boolean;
|
|
748
|
+
/**
|
|
749
|
+
* User defined model name, which is the key of models in config.yaml
|
|
750
|
+
* Replaces the legacy modelConfig parameter
|
|
751
|
+
*/
|
|
752
|
+
udfModelName?: string;
|
|
753
|
+
/**
|
|
754
|
+
* Legacy model config (string name or ModelConfig object)
|
|
755
|
+
* @deprecated Use udfModelName instead
|
|
756
|
+
*/
|
|
757
|
+
modelConfig?: string | any;
|
|
758
|
+
/**
|
|
759
|
+
* Logging verbosity level
|
|
760
|
+
* 0: off, 1: agent messages, 2: all messages
|
|
761
|
+
*/
|
|
762
|
+
verbose?: boolean | number;
|
|
763
|
+
/**
|
|
764
|
+
* Execute tool calls in parallel
|
|
765
|
+
* @default false
|
|
766
|
+
*/
|
|
767
|
+
parallelExecution?: boolean;
|
|
768
|
+
/**
|
|
769
|
+
* Tool call observation timeout in seconds
|
|
770
|
+
* @default 60.0
|
|
771
|
+
*/
|
|
772
|
+
observeTimeout?: number;
|
|
773
|
+
/**
|
|
774
|
+
* Workspace directory for file operations
|
|
775
|
+
*/
|
|
776
|
+
workspaceDir?: string;
|
|
777
|
+
/**
|
|
778
|
+
* Auto-shutdown executor when agent completes
|
|
779
|
+
* Warning: Don't set to true in multi-agent mode as agents share executors
|
|
780
|
+
* @default false
|
|
781
|
+
*/
|
|
782
|
+
autoShutdownExecutor?: boolean;
|
|
783
|
+
/**
|
|
784
|
+
* Post-processor for final output
|
|
785
|
+
*/
|
|
786
|
+
postProcessor?: PostProcessor;
|
|
787
|
+
/**
|
|
788
|
+
* Custom tool executor
|
|
789
|
+
*/
|
|
790
|
+
executor?: ToolExecutorProtocol$1;
|
|
791
|
+
/**
|
|
792
|
+
* Pre-initialized message history
|
|
793
|
+
*/
|
|
794
|
+
chatHistoryMessage?: any;
|
|
795
|
+
/**
|
|
796
|
+
* Custom agent ID (auto-generated if not provided)
|
|
797
|
+
*/
|
|
798
|
+
agentId?: string;
|
|
799
|
+
/**
|
|
800
|
+
* Skill names to load and inject into system prompt
|
|
801
|
+
*/
|
|
802
|
+
skills?: string[];
|
|
803
|
+
/**
|
|
804
|
+
* Paths to rule files for future injection (reserved)
|
|
805
|
+
*/
|
|
806
|
+
rulePaths?: string[];
|
|
807
|
+
/**
|
|
808
|
+
* Spec content or path for future injection (reserved)
|
|
809
|
+
*/
|
|
810
|
+
spec?: string;
|
|
811
|
+
/**
|
|
812
|
+
* Few-shot examples
|
|
813
|
+
*/
|
|
814
|
+
fewShot?: string;
|
|
815
|
+
/**
|
|
816
|
+
* Tool call manager pool size
|
|
817
|
+
* @default 5
|
|
818
|
+
*/
|
|
819
|
+
toolcallManagerPoolSize?: number;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* Main Agent class with tool use capabilities
|
|
824
|
+
*
|
|
825
|
+
* Converts Python's core/agent.py to TypeScript
|
|
826
|
+
*/
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Main Agent class
|
|
830
|
+
*/
|
|
831
|
+
declare class Agent {
|
|
832
|
+
name: string;
|
|
833
|
+
private profile;
|
|
834
|
+
private system;
|
|
835
|
+
private tools;
|
|
836
|
+
private functionCallingTools;
|
|
837
|
+
private mcpServerNames;
|
|
838
|
+
private modelConfig;
|
|
839
|
+
private verbose;
|
|
840
|
+
private model;
|
|
841
|
+
private history;
|
|
842
|
+
private subAgents;
|
|
843
|
+
private toolcallManagerPoolSize;
|
|
844
|
+
private postProcessor;
|
|
845
|
+
private useFunctionCalling;
|
|
846
|
+
agentId: string;
|
|
847
|
+
workspaceDir: string;
|
|
848
|
+
executor: ToolExecutorProtocol$1 | null;
|
|
849
|
+
autoShutdownExecutor: boolean;
|
|
850
|
+
private parallelExecution;
|
|
851
|
+
private observeTimeout;
|
|
852
|
+
private skills;
|
|
853
|
+
constructor(config: AgentConfig);
|
|
854
|
+
/**
|
|
855
|
+
* Get the current system prompt
|
|
856
|
+
*/
|
|
857
|
+
get systemPrompt(): string;
|
|
858
|
+
/**
|
|
859
|
+
* Set the system prompt and update history
|
|
860
|
+
*/
|
|
861
|
+
set systemPrompt(value: string);
|
|
862
|
+
/**
|
|
863
|
+
* Set the system prompt with system tools descriptions
|
|
864
|
+
* @private
|
|
865
|
+
*/
|
|
866
|
+
private setSystem;
|
|
867
|
+
/**
|
|
868
|
+
* Set up function calling tools for OpenAI-style function calling
|
|
869
|
+
* @private
|
|
870
|
+
*/
|
|
871
|
+
private setFunctionCallingTools;
|
|
872
|
+
/**
|
|
873
|
+
* Agent loop - processes user input and handles tool calls
|
|
874
|
+
* @private
|
|
875
|
+
*/
|
|
876
|
+
private _agentLoop;
|
|
877
|
+
/**
|
|
878
|
+
* Run the agent with given instruction
|
|
879
|
+
*/
|
|
880
|
+
run(instruction: string, images?: string | string[]): Promise<string | any>;
|
|
881
|
+
/**
|
|
882
|
+
* Get agent profile
|
|
883
|
+
*/
|
|
884
|
+
getProfile(): string;
|
|
885
|
+
/**
|
|
886
|
+
* Get tools
|
|
887
|
+
*/
|
|
888
|
+
getTools(): string[];
|
|
889
|
+
/**
|
|
890
|
+
* Get function calling tools schemas
|
|
891
|
+
*/
|
|
892
|
+
getFunctionCallingTools(): any[];
|
|
893
|
+
/**
|
|
894
|
+
* Get MCP server names
|
|
895
|
+
*/
|
|
896
|
+
getMcpServerNames(): string[];
|
|
897
|
+
/**
|
|
898
|
+
* Get model config (string or ModelConfig object)
|
|
899
|
+
*/
|
|
900
|
+
getModelConfig(): string | ModelConfig;
|
|
901
|
+
/**
|
|
902
|
+
* Get model name (for backward compatibility)
|
|
903
|
+
*/
|
|
904
|
+
getModelName(): string;
|
|
905
|
+
/**
|
|
906
|
+
* Get verbose setting
|
|
907
|
+
*/
|
|
908
|
+
getVerbose(): boolean | number;
|
|
909
|
+
/**
|
|
910
|
+
* Get sub-agents
|
|
911
|
+
*/
|
|
912
|
+
getSubAgents(): any[];
|
|
913
|
+
/**
|
|
914
|
+
* Get agent ID
|
|
915
|
+
*/
|
|
916
|
+
getAgentId(): string;
|
|
917
|
+
/**
|
|
918
|
+
* Get workspace directory
|
|
919
|
+
*/
|
|
920
|
+
getWorkspaceDir(): string;
|
|
921
|
+
/**
|
|
922
|
+
* Get parallel execution setting
|
|
923
|
+
*/
|
|
924
|
+
getParallelExecution(): boolean;
|
|
925
|
+
/**
|
|
926
|
+
* Get observe timeout setting
|
|
927
|
+
*/
|
|
928
|
+
getObserveTimeout(): number;
|
|
929
|
+
/**
|
|
930
|
+
* Get skills
|
|
931
|
+
*/
|
|
932
|
+
getSkills(): string[];
|
|
933
|
+
/**
|
|
934
|
+
* Get executor
|
|
935
|
+
*/
|
|
936
|
+
getExecutor(): ToolExecutorProtocol$1 | null;
|
|
937
|
+
/**
|
|
938
|
+
* Set executor
|
|
939
|
+
*/
|
|
940
|
+
setExecutor(executor: ToolExecutorProtocol$1): void;
|
|
941
|
+
/**
|
|
942
|
+
* Get chat history message
|
|
943
|
+
*/
|
|
944
|
+
get chatHistoryMessage(): MessageHistory;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Model abstraction layer using official SDKs
|
|
949
|
+
*
|
|
950
|
+
* Provides a unified interface for multiple LLM providers:
|
|
951
|
+
* - OpenAI (and compatible APIs like DeepSeek)
|
|
952
|
+
* - Anthropic Claude
|
|
953
|
+
* - Google Gemini
|
|
954
|
+
*/
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* Model response interface
|
|
958
|
+
*/
|
|
959
|
+
interface ModelResponse {
|
|
960
|
+
type: 'system' | 'user' | 'TaskCompletion';
|
|
961
|
+
extractedResult: () => string | any[] | Record<string, any>;
|
|
962
|
+
rawContentFromLlm?: string;
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Model class for interacting with LLM providers
|
|
966
|
+
* Uses official SDKs for better reliability and type safety
|
|
967
|
+
*/
|
|
968
|
+
declare class Model {
|
|
969
|
+
private modelName;
|
|
970
|
+
private config;
|
|
971
|
+
private openaiClient?;
|
|
972
|
+
private anthropicClient?;
|
|
973
|
+
private geminiClient?;
|
|
974
|
+
constructor(model?: string | ModelConfig);
|
|
975
|
+
/**
|
|
976
|
+
* Initialize the appropriate SDK client based on provider
|
|
977
|
+
*/
|
|
978
|
+
private _initializeClient;
|
|
979
|
+
/**
|
|
980
|
+
* Asynchronous chat completion
|
|
981
|
+
*/
|
|
982
|
+
achat(messages: any[], tools?: any[], stream?: boolean): Promise<ModelResponse[]>;
|
|
983
|
+
/**
|
|
984
|
+
* Call OpenAI-compatible API (OpenAI, DeepSeek, etc.)
|
|
985
|
+
*/
|
|
986
|
+
private _callOpenAICompatible;
|
|
987
|
+
/**
|
|
988
|
+
* Call Anthropic API
|
|
989
|
+
*/
|
|
990
|
+
private _callAnthropic;
|
|
991
|
+
/**
|
|
992
|
+
* Call Google Gemini API
|
|
993
|
+
*/
|
|
994
|
+
private _callGemini;
|
|
995
|
+
/**
|
|
996
|
+
* Convert OpenAI format messages to Gemini format
|
|
997
|
+
*/
|
|
998
|
+
private _convertMessagesToGeminiFormat;
|
|
999
|
+
/**
|
|
1000
|
+
* Get model configuration
|
|
1001
|
+
*/
|
|
1002
|
+
getConfig(): ModelConfig;
|
|
1003
|
+
/**
|
|
1004
|
+
* Get model name
|
|
1005
|
+
*/
|
|
1006
|
+
getName(): string;
|
|
1007
|
+
/**
|
|
1008
|
+
* Check if model supports tool calling
|
|
1009
|
+
*/
|
|
1010
|
+
supportsToolCalling(): boolean;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Toolcall class and types
|
|
1015
|
+
*
|
|
1016
|
+
* Extracted from src/utils/toolUtil.ts to mirror Python evolt/schemas/toolcall.py
|
|
1017
|
+
*/
|
|
1018
|
+
/**
|
|
1019
|
+
* Toolcall execution state
|
|
1020
|
+
*/
|
|
1021
|
+
type ToolcallState = 'pending' | 'running' | 'success' | 'failed';
|
|
1022
|
+
/**
|
|
1023
|
+
* Toolcall type
|
|
1024
|
+
*/
|
|
1025
|
+
type ToolcallType = 'system' | 'user' | 'TaskCompletion';
|
|
1026
|
+
/**
|
|
1027
|
+
* Toolcall class representing a single tool call
|
|
1028
|
+
*/
|
|
1029
|
+
declare class Toolcall {
|
|
1030
|
+
name: string;
|
|
1031
|
+
input: Record<string, any>;
|
|
1032
|
+
isExtractedSuccess: boolean;
|
|
1033
|
+
failedExtractedReason?: string;
|
|
1034
|
+
executedState: ToolcallState;
|
|
1035
|
+
executedContent?: string;
|
|
1036
|
+
toolCallId: string;
|
|
1037
|
+
type: ToolcallType;
|
|
1038
|
+
rawContentFromLlm?: string;
|
|
1039
|
+
constructor(config: {
|
|
1040
|
+
name: string;
|
|
1041
|
+
input?: Record<string, any>;
|
|
1042
|
+
isExtractedSuccess?: boolean;
|
|
1043
|
+
failedExtractedReason?: string;
|
|
1044
|
+
executedState?: ToolcallState;
|
|
1045
|
+
executedContent?: string;
|
|
1046
|
+
toolCallId?: string;
|
|
1047
|
+
type?: ToolcallType;
|
|
1048
|
+
rawContentFromLlm?: string;
|
|
1049
|
+
});
|
|
1050
|
+
/**
|
|
1051
|
+
* Toolcall extraction result description
|
|
1052
|
+
*/
|
|
1053
|
+
extractedResult(): string | Record<string, any> | Record<string, any>[];
|
|
1054
|
+
/**
|
|
1055
|
+
* Toolcall execution result: Feedback to LLM
|
|
1056
|
+
*/
|
|
1057
|
+
executedResult(): string | Record<string, any>;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* Feedback class for environment evaluation results
|
|
1062
|
+
*
|
|
1063
|
+
* Corresponds to Python's schemas/feedback.py
|
|
1064
|
+
* Used by ReflexionOrchestrator for environment feedback
|
|
1065
|
+
*/
|
|
1066
|
+
|
|
1067
|
+
/**
|
|
1068
|
+
* Feedback class representing evaluation results from an Environment
|
|
1069
|
+
*
|
|
1070
|
+
* Used in Reflexion loops where:
|
|
1071
|
+
* - Actor Agent generates/improves implementation
|
|
1072
|
+
* - Environment evaluates the implementation
|
|
1073
|
+
* - Feedback is returned with pass/fail status and detailed feedback message
|
|
1074
|
+
*/
|
|
1075
|
+
declare class Feedback {
|
|
1076
|
+
/**
|
|
1077
|
+
* Whether the test/evaluation passed
|
|
1078
|
+
*/
|
|
1079
|
+
isPassing: boolean;
|
|
1080
|
+
/**
|
|
1081
|
+
* Detailed feedback message
|
|
1082
|
+
*/
|
|
1083
|
+
feedback: Message;
|
|
1084
|
+
constructor(isPassing?: boolean, feedback?: Message);
|
|
1085
|
+
/**
|
|
1086
|
+
* Validate the feedback
|
|
1087
|
+
*/
|
|
1088
|
+
private _validate;
|
|
1089
|
+
/**
|
|
1090
|
+
* Convert feedback to a Message, optionally with pre/post content
|
|
1091
|
+
*
|
|
1092
|
+
* @param preContent - Content to prepend to the feedback
|
|
1093
|
+
* @param postContent - Content to append to the feedback
|
|
1094
|
+
* @returns Combined Message
|
|
1095
|
+
*/
|
|
1096
|
+
toMessage(preContent?: string, postContent?: string): Message;
|
|
1097
|
+
/**
|
|
1098
|
+
* Merge two messages into one
|
|
1099
|
+
*/
|
|
1100
|
+
private _mergeMessages;
|
|
1101
|
+
/**
|
|
1102
|
+
* Format feedback for API calls
|
|
1103
|
+
*
|
|
1104
|
+
* @param preContent - Content to prepend
|
|
1105
|
+
* @param postContent - Content to append
|
|
1106
|
+
* @returns Formatted object for API
|
|
1107
|
+
*/
|
|
1108
|
+
formatForApi(preContent?: string, postContent?: string): Record<string, any>;
|
|
1109
|
+
/**
|
|
1110
|
+
* Create a passing feedback
|
|
1111
|
+
*/
|
|
1112
|
+
static pass(content: string): Feedback;
|
|
1113
|
+
/**
|
|
1114
|
+
* Create a failing feedback
|
|
1115
|
+
*/
|
|
1116
|
+
static fail(content: string): Feedback;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Base orchestrator for multi-agent management
|
|
1121
|
+
*
|
|
1122
|
+
* Renamed from BaseEnvironment to BaseOrchestrator in 0.2.x
|
|
1123
|
+
* Converts Python's runtime/orchestrator/base.py to TypeScript
|
|
1124
|
+
*/
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* Instruction type enumeration
|
|
1128
|
+
*/
|
|
1129
|
+
declare enum InstructionType {
|
|
1130
|
+
VALID = "valid",
|
|
1131
|
+
QUIT = "quit",
|
|
1132
|
+
SEND_TO_ALL = "sendToAll",
|
|
1133
|
+
NO_AGENT_NAME = "noAgentName",
|
|
1134
|
+
NO_AVAILABLE_AGENT_NAME = "noAvailableAgentName"
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Base orchestrator for multi-agent coordination
|
|
1138
|
+
*
|
|
1139
|
+
* Renamed from BaseEnvironment in Python 0.2.x.
|
|
1140
|
+
* The old "Environment" name now refers to evaluation environments used by Reflexion.
|
|
1141
|
+
*/
|
|
1142
|
+
declare class BaseOrchestrator {
|
|
1143
|
+
/**
|
|
1144
|
+
* List of agents in the orchestrator
|
|
1145
|
+
*/
|
|
1146
|
+
agents: Agent[];
|
|
1147
|
+
/**
|
|
1148
|
+
* Assign skills to agent with their names
|
|
1149
|
+
*/
|
|
1150
|
+
agentSkills: Record<string, string[]>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Whether to always wait for human input
|
|
1153
|
+
*/
|
|
1154
|
+
alwaysWaitHumanInput: boolean;
|
|
1155
|
+
/**
|
|
1156
|
+
* Maximum number of rounds for agent execution
|
|
1157
|
+
*/
|
|
1158
|
+
maxRounds: number;
|
|
1159
|
+
constructor(options?: {
|
|
1160
|
+
agents?: Agent[];
|
|
1161
|
+
agentSkills?: Record<string, string[]>;
|
|
1162
|
+
alwaysWaitHumanInput?: boolean;
|
|
1163
|
+
maxRounds?: number;
|
|
1164
|
+
});
|
|
1165
|
+
/**
|
|
1166
|
+
* Set agent skills after initialization
|
|
1167
|
+
*/
|
|
1168
|
+
private setAgentSkills;
|
|
1169
|
+
/**
|
|
1170
|
+
* Check if instruction has agent name
|
|
1171
|
+
*/
|
|
1172
|
+
hasAgentName(instruction: string): boolean;
|
|
770
1173
|
/**
|
|
771
1174
|
* Post process instruction
|
|
772
1175
|
*/
|
|
773
|
-
postProcessInstruction(instruction: string, agentNames: string[]): [InstructionType, string];
|
|
1176
|
+
postProcessInstruction(instruction: string, agentNames: string[]): [InstructionType, string];
|
|
1177
|
+
/**
|
|
1178
|
+
* Shutdown all agent executors
|
|
1179
|
+
*/
|
|
1180
|
+
shutdownAllExecutors(options?: {
|
|
1181
|
+
wait?: boolean;
|
|
1182
|
+
}): Promise<void>;
|
|
1183
|
+
/**
|
|
1184
|
+
* Run with a single goal until completion (non-interactive mode)
|
|
1185
|
+
*/
|
|
1186
|
+
runGoal(goal: string): Promise<void>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Run the orchestrator (interactive mode)
|
|
1189
|
+
*/
|
|
1190
|
+
run(instruction?: string): Promise<void>;
|
|
1191
|
+
}
|
|
1192
|
+
/**
|
|
1193
|
+
* @deprecated Use BaseOrchestrator instead. This alias is kept for backward compatibility.
|
|
1194
|
+
*/
|
|
1195
|
+
declare const BaseEnvironment: typeof BaseOrchestrator;
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* Coding orchestrator for multi-agent management
|
|
1199
|
+
*
|
|
1200
|
+
* Renamed from CodingEnvironment to CodingOrchestrator in 0.2.x
|
|
1201
|
+
* Converts Python's runtime/orchestrator/coding.py to TypeScript
|
|
1202
|
+
*/
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* Orchestrator for coding tasks
|
|
1206
|
+
*
|
|
1207
|
+
* Renamed from CodingEnvironment in Python 0.2.x.
|
|
1208
|
+
* Extends BaseOrchestrator with workspace directory management.
|
|
1209
|
+
*/
|
|
1210
|
+
declare class CodingOrchestrator extends BaseOrchestrator {
|
|
1211
|
+
/**
|
|
1212
|
+
* Workspace directory
|
|
1213
|
+
*/
|
|
1214
|
+
workspaceDir: string;
|
|
1215
|
+
constructor(options?: {
|
|
1216
|
+
agents?: Agent[];
|
|
1217
|
+
agentSkills?: Record<string, string[]>;
|
|
1218
|
+
workspaceDir?: string;
|
|
1219
|
+
alwaysWaitHumanInput?: boolean;
|
|
1220
|
+
maxRounds?: number;
|
|
1221
|
+
});
|
|
1222
|
+
/**
|
|
1223
|
+
* Set workspace directory after initialization
|
|
1224
|
+
*/
|
|
1225
|
+
private setWorkspaceDir;
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* @deprecated Use CodingOrchestrator instead. This alias is kept for backward compatibility.
|
|
1229
|
+
*/
|
|
1230
|
+
declare const CodingEnvironment: typeof CodingOrchestrator;
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Abstract Environment class for Reflexion evaluation
|
|
1234
|
+
*
|
|
1235
|
+
* This is a NEW concept in 0.2.x, different from the old BaseEnvironment
|
|
1236
|
+
* (which has been renamed to BaseOrchestrator).
|
|
1237
|
+
*
|
|
1238
|
+
* The Environment is used by ReflexionOrchestrator to:
|
|
1239
|
+
* 1. Evaluate implementations against test cases
|
|
1240
|
+
* 2. Provide feedback on whether tests pass or fail
|
|
1241
|
+
* 3. Support iterative improvement cycles
|
|
1242
|
+
*
|
|
1243
|
+
* Corresponds to Python's runtime/environment/base.py
|
|
1244
|
+
*/
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* Environment options
|
|
1248
|
+
*/
|
|
1249
|
+
interface EnvironmentOptions {
|
|
1250
|
+
/**
|
|
1251
|
+
* Path to the initial implementation file
|
|
1252
|
+
*/
|
|
1253
|
+
initImpl: string;
|
|
1254
|
+
/**
|
|
1255
|
+
* Path to the improved implementation file
|
|
1256
|
+
* Must be different from initImpl
|
|
1257
|
+
*/
|
|
1258
|
+
improvedImpl: string;
|
|
1259
|
+
/**
|
|
1260
|
+
* Arguments passed to step() for initial implementation
|
|
1261
|
+
*/
|
|
1262
|
+
initStepKwargs?: Record<string, any>;
|
|
1263
|
+
/**
|
|
1264
|
+
* Arguments passed to step() for improved implementation
|
|
1265
|
+
*/
|
|
1266
|
+
improvedStepKwargs?: Record<string, any>;
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Abstract Environment class for Reflexion evaluation
|
|
1270
|
+
*
|
|
1271
|
+
* Subclasses should implement:
|
|
1272
|
+
* - hasImpl(): Check if implementation exists
|
|
1273
|
+
* - step(): Execute and evaluate implementation, returning Feedback
|
|
1274
|
+
*/
|
|
1275
|
+
declare abstract class Environment {
|
|
1276
|
+
/**
|
|
1277
|
+
* Arguments for the step method (initial implementation)
|
|
1278
|
+
*/
|
|
1279
|
+
initStepKwargs: Record<string, any>;
|
|
1280
|
+
/**
|
|
1281
|
+
* Arguments for the step method (improved implementation)
|
|
1282
|
+
*/
|
|
1283
|
+
improvedStepKwargs: Record<string, any>;
|
|
1284
|
+
/**
|
|
1285
|
+
* Path to the initial implementation file
|
|
1286
|
+
*/
|
|
1287
|
+
initImpl: string;
|
|
1288
|
+
/**
|
|
1289
|
+
* Path to the improved implementation file
|
|
1290
|
+
*/
|
|
1291
|
+
improvedImpl: string;
|
|
1292
|
+
constructor(options: EnvironmentOptions);
|
|
1293
|
+
/**
|
|
1294
|
+
* Initialize the improved implementation by copying from init
|
|
1295
|
+
*/
|
|
1296
|
+
private _initImprovedImpl;
|
|
1297
|
+
/**
|
|
1298
|
+
* Check if the initial implementation exists
|
|
1299
|
+
*/
|
|
1300
|
+
abstract hasImpl(): boolean;
|
|
1301
|
+
/**
|
|
1302
|
+
* Check if the improved implementation exists
|
|
1303
|
+
*/
|
|
1304
|
+
hasImprovedImpl(): boolean;
|
|
1305
|
+
/**
|
|
1306
|
+
* Execute and evaluate the implementation
|
|
1307
|
+
*
|
|
1308
|
+
* This method should:
|
|
1309
|
+
* 1. Run the implementation (or tests against it)
|
|
1310
|
+
* 2. Determine if it passes or fails
|
|
1311
|
+
* 3. Return a Feedback object with results
|
|
1312
|
+
*
|
|
1313
|
+
* @param args - Additional arguments
|
|
1314
|
+
* @returns Feedback with isPassing status and feedback message
|
|
1315
|
+
*/
|
|
1316
|
+
abstract step(...args: any[]): Promise<Feedback>;
|
|
1317
|
+
/**
|
|
1318
|
+
* Shutdown the environment
|
|
1319
|
+
*
|
|
1320
|
+
* Called when the evaluation is complete or interrupted.
|
|
1321
|
+
* Override to clean up resources.
|
|
1322
|
+
*/
|
|
1323
|
+
shutdown(): Promise<void>;
|
|
1324
|
+
/**
|
|
1325
|
+
* Evaluate the environment on a benchmark
|
|
1326
|
+
*
|
|
1327
|
+
* TODO: Add benchmark support for self-evolving
|
|
1328
|
+
*
|
|
1329
|
+
* @returns Whether the benchmark passed
|
|
1330
|
+
*/
|
|
1331
|
+
bench(): Promise<boolean>;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* Reflexion Orchestrator
|
|
1336
|
+
*
|
|
1337
|
+
* Orchestrator for self-improvement loops using actor-critic pattern.
|
|
1338
|
+
*
|
|
1339
|
+
* Corresponds to Python's runtime/orchestrator/reflexion.py
|
|
1340
|
+
*/
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* Configuration for the critic agent
|
|
1344
|
+
*/
|
|
1345
|
+
interface CriticAgentConfig extends Partial<AgentConfig> {
|
|
1346
|
+
name?: string;
|
|
1347
|
+
profile?: string;
|
|
1348
|
+
tools?: string[];
|
|
1349
|
+
udfModelName?: string;
|
|
1350
|
+
workspaceDir?: string;
|
|
1351
|
+
fewShot?: string;
|
|
1352
|
+
verbose?: boolean | number;
|
|
1353
|
+
saveSelfReflection?: boolean;
|
|
1354
|
+
postContent?: string;
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* Configuration for the actor agent
|
|
1358
|
+
*/
|
|
1359
|
+
interface ActorAgentConfig extends Partial<AgentConfig> {
|
|
1360
|
+
name?: string;
|
|
1361
|
+
profile?: string;
|
|
1362
|
+
tools?: string[];
|
|
1363
|
+
udfModelName?: string;
|
|
1364
|
+
workspaceDir?: string;
|
|
1365
|
+
fewShot?: string;
|
|
1366
|
+
verbose?: boolean | number;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Options for ReflexionOrchestrator
|
|
1370
|
+
*/
|
|
1371
|
+
interface ReflexionOrchestratorOptions {
|
|
1372
|
+
/**
|
|
1373
|
+
* The task description
|
|
1374
|
+
*/
|
|
1375
|
+
task: string;
|
|
1376
|
+
/**
|
|
1377
|
+
* The type of task (e.g., "coding", "writing")
|
|
1378
|
+
*/
|
|
1379
|
+
taskType: string;
|
|
1380
|
+
/**
|
|
1381
|
+
* The type of feedback expected
|
|
1382
|
+
*/
|
|
1383
|
+
feedbackType: string;
|
|
1384
|
+
/**
|
|
1385
|
+
* The evaluation environment
|
|
1386
|
+
*/
|
|
1387
|
+
environment: Environment;
|
|
1388
|
+
/**
|
|
1389
|
+
* Configuration for the critic agent
|
|
1390
|
+
*/
|
|
1391
|
+
criticAgentConfig?: CriticAgentConfig;
|
|
1392
|
+
/**
|
|
1393
|
+
* Configuration for the actor agent
|
|
1394
|
+
*/
|
|
1395
|
+
actorAgentConfig?: ActorAgentConfig;
|
|
1396
|
+
/**
|
|
1397
|
+
* Maximum number of reflection rounds
|
|
1398
|
+
*/
|
|
1399
|
+
maxIterations?: number;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Result of a reflexion run
|
|
1403
|
+
*/
|
|
1404
|
+
interface ReflexionResult {
|
|
1405
|
+
success: boolean;
|
|
1406
|
+
iterations: number;
|
|
1407
|
+
finalOutput: string;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Reflexion Orchestrator for self-improvement loops
|
|
1411
|
+
*
|
|
1412
|
+
* Implements the Reflexion pattern:
|
|
1413
|
+
* 1. Environment evaluates current implementation
|
|
1414
|
+
* 2. Critic agent generates self-reflection based on feedback
|
|
1415
|
+
* 3. Actor agent improves implementation based on reflection
|
|
1416
|
+
* 4. Repeat until passing or max iterations reached
|
|
1417
|
+
*/
|
|
1418
|
+
declare class ReflexionOrchestrator {
|
|
1419
|
+
private task;
|
|
1420
|
+
private taskType;
|
|
1421
|
+
private feedbackType;
|
|
1422
|
+
private environment;
|
|
1423
|
+
private criticAgentConfig;
|
|
1424
|
+
private actorAgentConfig;
|
|
1425
|
+
private maxIterations;
|
|
1426
|
+
constructor(options: ReflexionOrchestratorOptions);
|
|
1427
|
+
/**
|
|
1428
|
+
* Create system prompt for critic agent
|
|
1429
|
+
*/
|
|
1430
|
+
private createCriticSystemPrompt;
|
|
1431
|
+
/**
|
|
1432
|
+
* Create system prompt for actor agent
|
|
1433
|
+
*/
|
|
1434
|
+
private createActorSystemPrompt;
|
|
1435
|
+
/**
|
|
1436
|
+
* Build history message for critic agent
|
|
1437
|
+
*/
|
|
1438
|
+
private buildCriticHistoryMessage;
|
|
1439
|
+
/**
|
|
1440
|
+
* Build history message for actor agent
|
|
1441
|
+
*/
|
|
1442
|
+
private buildActorHistoryMessage;
|
|
1443
|
+
/**
|
|
1444
|
+
* Run the reflexion loop
|
|
1445
|
+
*/
|
|
1446
|
+
run(): Promise<ReflexionResult>;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
/**
|
|
1450
|
+
* Tool Executor Protocol definitions
|
|
1451
|
+
*
|
|
1452
|
+
* Corresponds to Python's runtime/executors/base.py
|
|
1453
|
+
*
|
|
1454
|
+
* This module defines the protocol interfaces for tool execution:
|
|
1455
|
+
* - GeneratedToolcallProtocol: Represents a parsed tool call from LLM output
|
|
1456
|
+
* - ExecutedToolcallProtocol: Represents the result of executing a tool call
|
|
1457
|
+
* - ToolExecutorProtocol: Interface for tool execution backends
|
|
1458
|
+
*/
|
|
1459
|
+
/**
|
|
1460
|
+
* Source of the tool call
|
|
1461
|
+
*/
|
|
1462
|
+
type ToolcallSource = 'chat' | 'function_call';
|
|
1463
|
+
/**
|
|
1464
|
+
* Protocol for a generated tool call (parsed from LLM output)
|
|
1465
|
+
*/
|
|
1466
|
+
interface GeneratedToolcallProtocol {
|
|
1467
|
+
/**
|
|
1468
|
+
* Name of the tool to execute
|
|
1469
|
+
*/
|
|
1470
|
+
toolName: string;
|
|
1471
|
+
/**
|
|
1472
|
+
* Arguments for the tool
|
|
1473
|
+
*/
|
|
1474
|
+
toolArguments: Record<string, any>;
|
|
1475
|
+
/**
|
|
1476
|
+
* Unique identifier for this tool call
|
|
1477
|
+
*/
|
|
1478
|
+
toolCallId: string;
|
|
1479
|
+
/**
|
|
1480
|
+
* Source of the tool call (chat = XML extraction, function_call = OpenAI function calling)
|
|
1481
|
+
*/
|
|
1482
|
+
source: ToolcallSource;
|
|
1483
|
+
/**
|
|
1484
|
+
* Whether the tool call was successfully parsed
|
|
1485
|
+
*/
|
|
1486
|
+
isSuccess: boolean;
|
|
1487
|
+
/**
|
|
1488
|
+
* Reason for failure if isSuccess is false
|
|
1489
|
+
*/
|
|
1490
|
+
failedReason?: string;
|
|
1491
|
+
/**
|
|
1492
|
+
* Raw content from LLM that generated this tool call
|
|
1493
|
+
*/
|
|
1494
|
+
rawContentFromLlm?: string;
|
|
774
1495
|
/**
|
|
775
|
-
*
|
|
1496
|
+
* Idempotency key for deduplication
|
|
776
1497
|
*/
|
|
777
|
-
|
|
1498
|
+
idempotencyKey: string;
|
|
1499
|
+
}
|
|
1500
|
+
/**
|
|
1501
|
+
* Protocol for an executed tool call (result)
|
|
1502
|
+
*/
|
|
1503
|
+
interface ExecutedToolcallProtocol {
|
|
1504
|
+
/**
|
|
1505
|
+
* The original tool call metadata
|
|
1506
|
+
*/
|
|
1507
|
+
metadata: GeneratedToolcallProtocol;
|
|
1508
|
+
/**
|
|
1509
|
+
* Whether the tool execution was successful
|
|
1510
|
+
*/
|
|
1511
|
+
isSuccess: boolean;
|
|
1512
|
+
/**
|
|
1513
|
+
* Result of the tool execution (can be any type)
|
|
1514
|
+
*/
|
|
1515
|
+
result: any;
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Status information returned by executor.status()
|
|
1519
|
+
*/
|
|
1520
|
+
interface ExecutorStatus {
|
|
1521
|
+
/**
|
|
1522
|
+
* Number of pending tasks in queue
|
|
1523
|
+
*/
|
|
1524
|
+
pending: number;
|
|
1525
|
+
/**
|
|
1526
|
+
* Number of currently running tasks
|
|
1527
|
+
*/
|
|
1528
|
+
running: number;
|
|
1529
|
+
/**
|
|
1530
|
+
* Number of completed tasks
|
|
1531
|
+
*/
|
|
1532
|
+
finished: number;
|
|
1533
|
+
/**
|
|
1534
|
+
* Number of failed tasks
|
|
1535
|
+
*/
|
|
1536
|
+
failed: number;
|
|
1537
|
+
/**
|
|
1538
|
+
* Total tasks submitted
|
|
1539
|
+
*/
|
|
1540
|
+
totalSubmitted: number;
|
|
1541
|
+
/**
|
|
1542
|
+
* Whether the executor is running
|
|
1543
|
+
*/
|
|
1544
|
+
isRunning: boolean;
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Protocol interface for tool executors
|
|
1548
|
+
*
|
|
1549
|
+
* Tool executors are responsible for:
|
|
1550
|
+
* 1. Managing a pool of concurrent tool executions
|
|
1551
|
+
* 2. Tracking execution status and results
|
|
1552
|
+
* 3. Providing idempotency (avoiding duplicate executions)
|
|
1553
|
+
*/
|
|
1554
|
+
interface ToolExecutorProtocol {
|
|
778
1555
|
/**
|
|
779
|
-
*
|
|
1556
|
+
* Initialize executor resources
|
|
780
1557
|
*/
|
|
781
|
-
|
|
1558
|
+
start(): Promise<void>;
|
|
1559
|
+
/**
|
|
1560
|
+
* Shutdown executor and optionally wait for running tasks
|
|
1561
|
+
*
|
|
1562
|
+
* @param options.wait - Whether to wait for running tasks to complete
|
|
1563
|
+
*/
|
|
1564
|
+
shutdown(options?: {
|
|
1565
|
+
wait?: boolean;
|
|
1566
|
+
}): Promise<void>;
|
|
1567
|
+
/**
|
|
1568
|
+
* Submit a tool call for background execution (non-blocking)
|
|
1569
|
+
*
|
|
1570
|
+
* @param toolcall - The tool call to execute
|
|
1571
|
+
*/
|
|
1572
|
+
submit(toolcall: GeneratedToolcallProtocol): Promise<void>;
|
|
1573
|
+
/**
|
|
1574
|
+
* Submit multiple tool calls
|
|
1575
|
+
*
|
|
1576
|
+
* @param toolcalls - Tool calls to execute
|
|
1577
|
+
* @param options.parallel - Whether to execute in parallel (default: true)
|
|
1578
|
+
*/
|
|
1579
|
+
submitMany(toolcalls: Iterable<GeneratedToolcallProtocol>, options?: {
|
|
1580
|
+
parallel?: boolean;
|
|
1581
|
+
}): Promise<void>;
|
|
1582
|
+
/**
|
|
1583
|
+
* Observe finished executions
|
|
1584
|
+
*
|
|
1585
|
+
* @param options.wait - Whether to wait for results
|
|
1586
|
+
* @param options.timeout - Timeout in seconds
|
|
1587
|
+
* @param options.maxItems - Maximum number of items to return
|
|
1588
|
+
* @returns List of executed tool calls
|
|
1589
|
+
*/
|
|
1590
|
+
observe(options?: {
|
|
1591
|
+
wait?: boolean;
|
|
1592
|
+
timeout?: number;
|
|
1593
|
+
maxItems?: number;
|
|
1594
|
+
}): Promise<ExecutedToolcallProtocol[]>;
|
|
1595
|
+
/**
|
|
1596
|
+
* Wait until all submitted tool calls are finished
|
|
1597
|
+
*/
|
|
1598
|
+
waitAll(): Promise<void>;
|
|
1599
|
+
/**
|
|
1600
|
+
* Return executor runtime status
|
|
1601
|
+
*/
|
|
1602
|
+
status(): ExecutorStatus;
|
|
1603
|
+
/**
|
|
1604
|
+
* Clear finished execution results
|
|
1605
|
+
*/
|
|
1606
|
+
clear(): void;
|
|
782
1607
|
}
|
|
1608
|
+
/**
|
|
1609
|
+
* Helper function to create a GeneratedToolcallProtocol from basic info
|
|
1610
|
+
*/
|
|
1611
|
+
declare function createGeneratedToolcall(options: {
|
|
1612
|
+
toolName: string;
|
|
1613
|
+
toolArguments: Record<string, any>;
|
|
1614
|
+
toolCallId?: string;
|
|
1615
|
+
source?: ToolcallSource;
|
|
1616
|
+
rawContentFromLlm?: string;
|
|
1617
|
+
}): GeneratedToolcallProtocol;
|
|
1618
|
+
/**
|
|
1619
|
+
* Helper function to create an ExecutedToolcallProtocol
|
|
1620
|
+
*/
|
|
1621
|
+
declare function createExecutedToolcall(metadata: GeneratedToolcallProtocol, isSuccess: boolean, result: any): ExecutedToolcallProtocol;
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* Tool execution utilities
|
|
1625
|
+
*
|
|
1626
|
+
* Corresponds to Python's runtime/executors/utils.py
|
|
1627
|
+
*/
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* Execute a single tool and handle errors
|
|
1631
|
+
*
|
|
1632
|
+
* @param generatedToolcall - The tool call to execute
|
|
1633
|
+
* @param toolStore - Tool store(s) containing the tool implementations
|
|
1634
|
+
* @returns Executed tool call result
|
|
1635
|
+
*/
|
|
1636
|
+
declare function _executeSingleTool(generatedToolcall: GeneratedToolcallProtocol, toolStore: ToolStore | ToolStore[]): Promise<ExecutedToolcallProtocol>;
|
|
1637
|
+
/**
|
|
1638
|
+
* Execute multiple tools sequentially
|
|
1639
|
+
*
|
|
1640
|
+
* @param toolcalls - Tool calls to execute
|
|
1641
|
+
* @param toolStore - Tool store(s) containing the tool implementations
|
|
1642
|
+
* @returns Array of executed tool call results
|
|
1643
|
+
*/
|
|
1644
|
+
declare function executeToolsSequential(toolcalls: GeneratedToolcallProtocol[], toolStore: ToolStore | ToolStore[]): Promise<ExecutedToolcallProtocol[]>;
|
|
1645
|
+
/**
|
|
1646
|
+
* Execute multiple tools in parallel
|
|
1647
|
+
*
|
|
1648
|
+
* @param toolcalls - Tool calls to execute
|
|
1649
|
+
* @param toolStore - Tool store(s) containing the tool implementations
|
|
1650
|
+
* @param maxConcurrency - Maximum concurrent executions (default: 5)
|
|
1651
|
+
* @returns Array of executed tool call results
|
|
1652
|
+
*/
|
|
1653
|
+
declare function executeToolsParallel(toolcalls: GeneratedToolcallProtocol[], toolStore: ToolStore | ToolStore[], maxConcurrency?: number): Promise<ExecutedToolcallProtocol[]>;
|
|
783
1654
|
|
|
784
1655
|
/**
|
|
785
|
-
*
|
|
1656
|
+
* LocalToolExecutor - Local tool executor implementation
|
|
786
1657
|
*
|
|
787
|
-
*
|
|
1658
|
+
* Implements ToolExecutorProtocol for local execution:
|
|
1659
|
+
* - Background async tool call execution
|
|
1660
|
+
* - Configurable concurrency limits
|
|
1661
|
+
* - Task queue management
|
|
1662
|
+
* - Execution result observation
|
|
1663
|
+
* - Background process management
|
|
1664
|
+
*
|
|
1665
|
+
* Corresponds to Python's runtime/executors/local_executor.py
|
|
1666
|
+
*/
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* Get current executor from context
|
|
1670
|
+
*/
|
|
1671
|
+
declare function getCurrentExecutor(): LocalToolExecutor | null;
|
|
1672
|
+
/**
|
|
1673
|
+
* Set current executor in context
|
|
788
1674
|
*/
|
|
1675
|
+
declare function setCurrentExecutor(executor: LocalToolExecutor | null): void;
|
|
1676
|
+
/**
|
|
1677
|
+
* Local tool executor implementation
|
|
1678
|
+
*
|
|
1679
|
+
* Implements ToolExecutorProtocol for local execution.
|
|
1680
|
+
*/
|
|
1681
|
+
declare class LocalToolExecutor implements ToolExecutorProtocol {
|
|
1682
|
+
private poolSize;
|
|
1683
|
+
private toolStores;
|
|
1684
|
+
private semaphore;
|
|
1685
|
+
private pendingTasks;
|
|
1686
|
+
private runningTasks;
|
|
1687
|
+
private finishedResults;
|
|
1688
|
+
private successTasks;
|
|
1689
|
+
private failedTasks;
|
|
1690
|
+
private totalSubmitted;
|
|
1691
|
+
private totalFinished;
|
|
1692
|
+
private totalFailed;
|
|
1693
|
+
private started;
|
|
1694
|
+
private isShutdown;
|
|
1695
|
+
private backgroundProcesses;
|
|
1696
|
+
constructor(poolSize?: number, toolStores?: ToolStore[]);
|
|
1697
|
+
start(): Promise<void>;
|
|
1698
|
+
shutdown(options?: {
|
|
1699
|
+
wait?: boolean;
|
|
1700
|
+
}): Promise<void>;
|
|
1701
|
+
submit(toolcall: GeneratedToolcallProtocol): Promise<void>;
|
|
1702
|
+
submitMany(toolcalls: Iterable<GeneratedToolcallProtocol>, options?: {
|
|
1703
|
+
parallel?: boolean;
|
|
1704
|
+
}): Promise<void>;
|
|
1705
|
+
observe(options?: {
|
|
1706
|
+
wait?: boolean;
|
|
1707
|
+
timeout?: number;
|
|
1708
|
+
maxItems?: number;
|
|
1709
|
+
}): Promise<ExecutedToolcallProtocol[]>;
|
|
1710
|
+
waitAll(): Promise<void>;
|
|
1711
|
+
status(): ExecutorStatus;
|
|
1712
|
+
clear(): void;
|
|
1713
|
+
private _executeToolcall;
|
|
1714
|
+
registerBackgroundProcess(process: ChildProcess, command: string, cwd: string): string;
|
|
1715
|
+
listBackgroundProcesses(): string;
|
|
1716
|
+
stopBackgroundProcess(processId: string, force?: boolean): Promise<string>;
|
|
1717
|
+
cleanupBackgroundProcesses(): Promise<string>;
|
|
1718
|
+
}
|
|
789
1719
|
|
|
790
1720
|
/**
|
|
791
|
-
*
|
|
1721
|
+
* Agent State Store Protocol and Record Model
|
|
1722
|
+
*
|
|
1723
|
+
* Defines the interface for agent state persistence backends.
|
|
1724
|
+
*
|
|
1725
|
+
* Corresponds to Python's runtime/state/store.py
|
|
1726
|
+
*/
|
|
1727
|
+
/**
|
|
1728
|
+
* Record type for state persistence
|
|
792
1729
|
*/
|
|
793
|
-
|
|
1730
|
+
type StateRecordType = 'message' | 'tool_call' | 'instruction' | 'system' | 'completion';
|
|
1731
|
+
/**
|
|
1732
|
+
* A single state record for persistence
|
|
1733
|
+
*/
|
|
1734
|
+
interface StateRecord {
|
|
794
1735
|
/**
|
|
795
|
-
*
|
|
1736
|
+
* Session identifier
|
|
796
1737
|
*/
|
|
797
|
-
|
|
798
|
-
constructor(agents?: Agent[], agentSkills?: Record<string, string[]>, workspaceDir?: string);
|
|
1738
|
+
sessionId: string;
|
|
799
1739
|
/**
|
|
800
|
-
*
|
|
1740
|
+
* Agent name
|
|
801
1741
|
*/
|
|
802
|
-
|
|
1742
|
+
agentName: string;
|
|
1743
|
+
/**
|
|
1744
|
+
* Unix timestamp when the record was created
|
|
1745
|
+
*/
|
|
1746
|
+
timestamp: number;
|
|
1747
|
+
/**
|
|
1748
|
+
* Record type
|
|
1749
|
+
*/
|
|
1750
|
+
type: StateRecordType;
|
|
1751
|
+
/**
|
|
1752
|
+
* The actual payload data (serialized message or toolcall)
|
|
1753
|
+
*/
|
|
1754
|
+
data: Record<string, any>;
|
|
1755
|
+
}
|
|
1756
|
+
/**
|
|
1757
|
+
* Session metadata information
|
|
1758
|
+
*/
|
|
1759
|
+
interface SessionMeta {
|
|
1760
|
+
/**
|
|
1761
|
+
* Session identifier
|
|
1762
|
+
*/
|
|
1763
|
+
sessionId: string;
|
|
1764
|
+
/**
|
|
1765
|
+
* Session creation timestamp (Unix timestamp)
|
|
1766
|
+
*/
|
|
1767
|
+
timestamp: number;
|
|
1768
|
+
/**
|
|
1769
|
+
* First instruction content for display (optional)
|
|
1770
|
+
*/
|
|
1771
|
+
firstInstruction?: string;
|
|
1772
|
+
/**
|
|
1773
|
+
* List of agent names that have records in this session
|
|
1774
|
+
*/
|
|
1775
|
+
agents: string[];
|
|
1776
|
+
}
|
|
1777
|
+
/**
|
|
1778
|
+
* Protocol interface for agent state persistence backends
|
|
1779
|
+
*
|
|
1780
|
+
* All implementations must provide async append, getAll, and clear methods.
|
|
1781
|
+
* The sessionId + agentName combination uniquely identifies a record set.
|
|
1782
|
+
*/
|
|
1783
|
+
interface AgentStateStore {
|
|
1784
|
+
/**
|
|
1785
|
+
* Append a single state record
|
|
1786
|
+
*
|
|
1787
|
+
* @param sessionId - Session identifier
|
|
1788
|
+
* @param agentName - Agent name
|
|
1789
|
+
* @param record - Record data containing type, data, and timestamp
|
|
1790
|
+
*/
|
|
1791
|
+
append(sessionId: string, agentName: string, record: Omit<StateRecord, 'sessionId' | 'agentName'>): Promise<void>;
|
|
1792
|
+
/**
|
|
1793
|
+
* Get all records for a session/agent combination
|
|
1794
|
+
*
|
|
1795
|
+
* @param sessionId - Session identifier
|
|
1796
|
+
* @param agentName - Agent name
|
|
1797
|
+
* @returns List of StateRecord objects ordered by timestamp
|
|
1798
|
+
*/
|
|
1799
|
+
getAll(sessionId: string, agentName: string): Promise<StateRecord[]>;
|
|
1800
|
+
/**
|
|
1801
|
+
* Clear all records for a session/agent combination
|
|
1802
|
+
*
|
|
1803
|
+
* @param sessionId - Session identifier
|
|
1804
|
+
* @param agentName - Agent name
|
|
1805
|
+
*/
|
|
1806
|
+
clear(sessionId: string, agentName: string): Promise<void>;
|
|
1807
|
+
/**
|
|
1808
|
+
* Export records to a JSON file
|
|
1809
|
+
*
|
|
1810
|
+
* @param sessionId - Session identifier
|
|
1811
|
+
* @param agentName - Agent name
|
|
1812
|
+
* @param filename - Output file path
|
|
1813
|
+
*/
|
|
1814
|
+
exportJson(sessionId: string, agentName: string, filename: string): void;
|
|
1815
|
+
/**
|
|
1816
|
+
* Import records from a JSON file
|
|
1817
|
+
*
|
|
1818
|
+
* @param filename - Input file path
|
|
1819
|
+
*/
|
|
1820
|
+
importJson(filename: string): void;
|
|
1821
|
+
/**
|
|
1822
|
+
* Delete the last n records for a session/agent combination
|
|
1823
|
+
*
|
|
1824
|
+
* Records are ordered by timestamp, and the last n records
|
|
1825
|
+
* (most recent) will be deleted.
|
|
1826
|
+
*
|
|
1827
|
+
* @param sessionId - Session identifier
|
|
1828
|
+
* @param agentName - Agent name
|
|
1829
|
+
* @param n - Number of records to delete from the end
|
|
1830
|
+
* @returns Number of records actually deleted
|
|
1831
|
+
*/
|
|
1832
|
+
deleteLastN(sessionId: string, agentName: string, n: number): Promise<number>;
|
|
1833
|
+
/**
|
|
1834
|
+
* Check if a session exists (regardless of agent)
|
|
1835
|
+
*
|
|
1836
|
+
* This method checks if any records exist for the given sessionId,
|
|
1837
|
+
* without filtering by agentName. Useful for distinguishing between
|
|
1838
|
+
* "session does not exist" and "session exists but agent has no records".
|
|
1839
|
+
*
|
|
1840
|
+
* @param sessionId - Session identifier
|
|
1841
|
+
* @returns True if any records exist for this sessionId, False otherwise
|
|
1842
|
+
*/
|
|
1843
|
+
sessionExists(sessionId: string): Promise<boolean>;
|
|
1844
|
+
/**
|
|
1845
|
+
* List all available sessions
|
|
1846
|
+
*
|
|
1847
|
+
* @returns List of SessionMeta objects containing session metadata
|
|
1848
|
+
*/
|
|
1849
|
+
listSessions(): SessionMeta[];
|
|
1850
|
+
/**
|
|
1851
|
+
* Get list of agent names that have records in a session
|
|
1852
|
+
*
|
|
1853
|
+
* @param sessionId - Session identifier
|
|
1854
|
+
* @returns List of unique agent names in this session
|
|
1855
|
+
*/
|
|
1856
|
+
getAgentsInSession(sessionId: string): Promise<string[]>;
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* Create a StateRecord from data
|
|
1860
|
+
*/
|
|
1861
|
+
declare function createStateRecord(sessionId: string, agentName: string, type: StateRecordType, data: Record<string, any>): StateRecord;
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* JSONL Agent State Store Implementation
|
|
1865
|
+
*
|
|
1866
|
+
* File-based persistence using JSON Lines format for append-friendly storage.
|
|
1867
|
+
*
|
|
1868
|
+
* Corresponds to Python's runtime/state/jsonl_store.py
|
|
1869
|
+
*/
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* JSONL file-based state store implementation
|
|
1873
|
+
*
|
|
1874
|
+
* Stores records as JSON Lines (one JSON object per line) for efficient
|
|
1875
|
+
* append operations. Each session gets its own file named by session_id.
|
|
1876
|
+
*
|
|
1877
|
+
* File naming: {session_id}.jsonl
|
|
1878
|
+
*/
|
|
1879
|
+
declare class JsonlAgentStateStore implements AgentStateStore {
|
|
1880
|
+
private storageDir;
|
|
1881
|
+
private maxSessions;
|
|
1882
|
+
private sessionFileMap;
|
|
1883
|
+
/**
|
|
1884
|
+
* Create a new JSONL state store
|
|
1885
|
+
*
|
|
1886
|
+
* @param storageDir - Directory to store JSONL files. Defaults to ~/.evolt/state/
|
|
1887
|
+
* @param maxSessions - Maximum number of session files to keep. Older sessions are automatically cleaned up.
|
|
1888
|
+
*/
|
|
1889
|
+
constructor(storageDir?: string, maxSessions?: number);
|
|
1890
|
+
/**
|
|
1891
|
+
* Load existing session_id to file mappings from disk
|
|
1892
|
+
*/
|
|
1893
|
+
private _loadSessionMap;
|
|
1894
|
+
/**
|
|
1895
|
+
* Get existing file path for session or create a new one
|
|
1896
|
+
*/
|
|
1897
|
+
private _getOrCreateFilePath;
|
|
1898
|
+
/**
|
|
1899
|
+
* Cleanup old session files to maintain max_sessions limit
|
|
1900
|
+
*/
|
|
1901
|
+
private _cleanupOldSessions;
|
|
1902
|
+
/**
|
|
1903
|
+
* Get the latest record timestamp from a session file
|
|
1904
|
+
*/
|
|
1905
|
+
private _getLatestTimestamp;
|
|
1906
|
+
append(sessionId: string, agentName: string, record: Omit<StateRecord, 'sessionId' | 'agentName'>): Promise<void>;
|
|
1907
|
+
getAll(sessionId: string, agentName: string): Promise<StateRecord[]>;
|
|
1908
|
+
clear(sessionId: string, agentName: string): Promise<void>;
|
|
1909
|
+
exportJson(sessionId: string, agentName: string, filename: string): void;
|
|
1910
|
+
importJson(filename: string): void;
|
|
1911
|
+
deleteLastN(sessionId: string, agentName: string, n: number): Promise<number>;
|
|
1912
|
+
sessionExists(sessionId: string): Promise<boolean>;
|
|
1913
|
+
listSessions(): SessionMeta[];
|
|
1914
|
+
getAgentsInSession(sessionId: string): Promise<string[]>;
|
|
803
1915
|
}
|
|
804
1916
|
|
|
1917
|
+
/**
|
|
1918
|
+
* Persistence Context Management
|
|
1919
|
+
*
|
|
1920
|
+
* Provides:
|
|
1921
|
+
* - Process-level session_id management (shared across all agents)
|
|
1922
|
+
* - Agent name tracking (per async context)
|
|
1923
|
+
* - Global store management for single-store-per-process pattern
|
|
1924
|
+
*
|
|
1925
|
+
* Corresponds to Python's runtime/state/context.py
|
|
1926
|
+
*/
|
|
1927
|
+
|
|
1928
|
+
/**
|
|
1929
|
+
* Use a specific session_id for restoring a historical session.
|
|
1930
|
+
*
|
|
1931
|
+
* @param sessionId - The session ID to restore from.
|
|
1932
|
+
* @param options.skipExecutorRestore - If true, skip restoring executor state (tool calls).
|
|
1933
|
+
*
|
|
1934
|
+
* @throws Error if session_id has already been set
|
|
1935
|
+
*/
|
|
1936
|
+
declare function useSessionId(sessionId: string, options?: {
|
|
1937
|
+
skipExecutorRestore?: boolean;
|
|
1938
|
+
}): void;
|
|
1939
|
+
/**
|
|
1940
|
+
* Get current session_id, or auto-create one if not set.
|
|
1941
|
+
*
|
|
1942
|
+
* The same session_id is shared across the entire process runtime.
|
|
1943
|
+
* Auto-created sessions will not attempt to restore.
|
|
1944
|
+
*/
|
|
1945
|
+
declare function getOrCreateSessionId(): string;
|
|
1946
|
+
/**
|
|
1947
|
+
* Get current session_id, or null if not set (will not auto-create).
|
|
1948
|
+
*/
|
|
1949
|
+
declare function getSessionId(): string | null;
|
|
1950
|
+
/**
|
|
1951
|
+
* Check if this is a new session (auto-created, no restore needed).
|
|
1952
|
+
*/
|
|
1953
|
+
declare function isNewSession(): boolean;
|
|
1954
|
+
/**
|
|
1955
|
+
* Reset session_id (for testing or when starting a new session).
|
|
1956
|
+
*/
|
|
1957
|
+
declare function resetSessionId(): void;
|
|
1958
|
+
/**
|
|
1959
|
+
* Check if executor restore should be skipped during session recovery.
|
|
1960
|
+
*/
|
|
1961
|
+
declare function shouldSkipExecutorRestore(): boolean;
|
|
1962
|
+
/**
|
|
1963
|
+
* Enable the global state store for persistence.
|
|
1964
|
+
*
|
|
1965
|
+
* Call this once at application startup to set up persistence.
|
|
1966
|
+
* All agents will automatically use this store.
|
|
1967
|
+
*
|
|
1968
|
+
* @param store - A pre-configured store instance. If not provided, creates a default JSONL store.
|
|
1969
|
+
* @param options.backend - Store backend type: "jsonl". Used if store is null.
|
|
1970
|
+
* @param options.storageDir - Directory for state storage. Defaults to ~/.evolt/state.
|
|
1971
|
+
* @returns The configured global store instance.
|
|
1972
|
+
*/
|
|
1973
|
+
declare function enableStateStore(store?: AgentStateStore | null, options?: {
|
|
1974
|
+
backend?: 'jsonl';
|
|
1975
|
+
storageDir?: string;
|
|
1976
|
+
}): AgentStateStore | null;
|
|
1977
|
+
/**
|
|
1978
|
+
* Get the global persistence store.
|
|
1979
|
+
*
|
|
1980
|
+
* @returns The global store instance, or null if not configured.
|
|
1981
|
+
*/
|
|
1982
|
+
declare function getGlobalStore(): AgentStateStore | null;
|
|
1983
|
+
/**
|
|
1984
|
+
* Check if persistence is enabled globally.
|
|
1985
|
+
*
|
|
1986
|
+
* @returns True if a global store is configured.
|
|
1987
|
+
*/
|
|
1988
|
+
declare function isPersistenceEnabled(): boolean;
|
|
1989
|
+
/**
|
|
1990
|
+
* Set the current agent name.
|
|
1991
|
+
*
|
|
1992
|
+
* @param agentName - Agent name to set
|
|
1993
|
+
*/
|
|
1994
|
+
declare function setAgentName(agentName: string): void;
|
|
1995
|
+
/**
|
|
1996
|
+
* Get the current agent name.
|
|
1997
|
+
*
|
|
1998
|
+
* @returns Current agent name, or null if not set
|
|
1999
|
+
*/
|
|
2000
|
+
declare function getAgentName(): string | null;
|
|
2001
|
+
/**
|
|
2002
|
+
* Reset the agent name.
|
|
2003
|
+
*/
|
|
2004
|
+
declare function resetAgentName(): void;
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* Persistent State Decorator
|
|
2008
|
+
*
|
|
2009
|
+
* Decorator for automatically persisting state changes after successful
|
|
2010
|
+
* function execution.
|
|
2011
|
+
*
|
|
2012
|
+
* Corresponds to Python's runtime/state/decorator.py
|
|
2013
|
+
*/
|
|
2014
|
+
|
|
2015
|
+
/**
|
|
2016
|
+
* Decorator to persist state after successful function execution.
|
|
2017
|
+
*
|
|
2018
|
+
* This decorator records state changes to the persistence store after
|
|
2019
|
+
* the decorated function completes successfully.
|
|
2020
|
+
*
|
|
2021
|
+
* @param recordType - Type of record to create ("message" or "tool_call")
|
|
2022
|
+
*
|
|
2023
|
+
* @example
|
|
2024
|
+
* ```typescript
|
|
2025
|
+
* class MyClass {
|
|
2026
|
+
* @persistentState("message")
|
|
2027
|
+
* async addMessage(message: Message): Promise<void> {
|
|
2028
|
+
* // ... add message logic ...
|
|
2029
|
+
* }
|
|
2030
|
+
* }
|
|
2031
|
+
* ```
|
|
2032
|
+
*/
|
|
2033
|
+
declare function persistentState(recordType: StateRecordType): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
2034
|
+
/**
|
|
2035
|
+
* Decorator to handle session state for Agent.run method.
|
|
2036
|
+
*
|
|
2037
|
+
* This decorator manages the session lifecycle:
|
|
2038
|
+
* 1. Get or create session_id
|
|
2039
|
+
* 2. Set agent_name context
|
|
2040
|
+
* 3. Try restore from state store (if applicable)
|
|
2041
|
+
* 4. On success, record completion event
|
|
2042
|
+
*
|
|
2043
|
+
* @example
|
|
2044
|
+
* ```typescript
|
|
2045
|
+
* class Agent {
|
|
2046
|
+
* @agentAutoRestore
|
|
2047
|
+
* async run(instruction: string): Promise<string> {
|
|
2048
|
+
* // ... run logic ...
|
|
2049
|
+
* }
|
|
2050
|
+
* }
|
|
2051
|
+
* ```
|
|
2052
|
+
*/
|
|
2053
|
+
declare function agentAutoRestore(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
2054
|
+
|
|
2055
|
+
/**
|
|
2056
|
+
* Tools prompts and output format templates
|
|
2057
|
+
*
|
|
2058
|
+
* Converts Python's prompts/tools.py to TypeScript
|
|
2059
|
+
*/
|
|
2060
|
+
declare const REFLECT_OUTPUT_FORMAT_PROMPT = "**Reflection Prompt: Output Format Error** \nYour output does not follow the required XML format: \n<OutputFormat> \n<ToolName.method_name><arg1_name>value1</arg1_name><arg2_name>value2</arg2_name></ToolName.method_name> \n</OutputFormat> \n\nYour erroneous output: \n{output_text} \n\nPlease analyze the format discrepancies and re-output, ensuring: \n\n- Use the correct XML tag structure \n- All tags are properly closed \n- Parameter values are placed within the corresponding tags \n\nRe-output: \n";
|
|
2061
|
+
/**
|
|
2062
|
+
* Simplified output format prompt (aligned with Python 0.2.2)
|
|
2063
|
+
*
|
|
2064
|
+
* This version removes the task classification (Generative/Analytical/Operational)
|
|
2065
|
+
* and uses a unified react-style format.
|
|
2066
|
+
*/
|
|
2067
|
+
declare const OUTPUT_FORMAT_PROMPT = "<OutputFormat>\n\nYou should use one tool or multiple tools (depends on your task), follow the format below, replace the <ToolName.method_name> and <args_name> with the actual tool name.\n\nThought: ...\nAction: <ToolName1.method_name1><args_name1>args_value1</args_name1><args_name2>args_value2</args_name2>...</ToolName1.method_name1>\n\n**YOUR OUTPUT MUST INCLUDE THE ACTUAL <args_name> AND <args_value>!!!**\n**If the task is completed, simply return the completion information like <TaskCompletion>your_completion_information</TaskCompletion>, No any tool call should be included.**\n</OutputFormat>\n";
|
|
2068
|
+
/**
|
|
2069
|
+
* Tools prompt template (new name aligned with Python 0.2.2)
|
|
2070
|
+
*
|
|
2071
|
+
* Placeholders:
|
|
2072
|
+
* - {available_tools}: List of available tool names
|
|
2073
|
+
* - {desc_of_tools}: Descriptions of available tools
|
|
2074
|
+
* - {output_format}: Output format instructions
|
|
2075
|
+
*/
|
|
2076
|
+
declare const TOOLS_PROMPT = "\n## Tools And Tool Calls Format\n\nTools are represented by a predefined XML-like syntax structure. This structure encapsulates parameter lists within tags such as `<ToolName.method_name>`. \nBy identifying and matching keywords inside these tags, the system automatically parses the target tool name and its corresponding input parameter values to execute subsequent tool calls.\n\n### Available Tools\n{available_tools}\n\n### Description of Available Tools\n{desc_of_tools}\n\n### Output Format\n{output_format}\n";
|
|
2077
|
+
/**
|
|
2078
|
+
* System tools prompt template (legacy name, kept for backward compatibility)
|
|
2079
|
+
*
|
|
2080
|
+
* @deprecated Use TOOLS_PROMPT instead. This is an alias with camelCase placeholders.
|
|
2081
|
+
*
|
|
2082
|
+
* Placeholders:
|
|
2083
|
+
* - {availableSystemTools}: List of available tool names
|
|
2084
|
+
* - {descOfSystemTools}: Descriptions of available tools
|
|
2085
|
+
* - {outputFormat}: Output format instructions
|
|
2086
|
+
*/
|
|
2087
|
+
declare const SYSTEM_TOOLS_PROMPT = "\n## System Tools And System Tools Call Format\n\nSystem Tools are represented by a predefined XML-like syntax structure. This structure encapsulates parameter lists within tags such as `<ToolName.method_name>`.\nBy identifying and matching keywords inside these tags, the system automatically parses the target tool name and its corresponding input parameter values to execute subsequent tool calls.\n\n### Available System Tools\n{availableSystemTools}\n\n### Description of Available System Tools\n{descOfSystemTools}\n\n### System Tools Output Format\n{outputFormat}\n";
|
|
2088
|
+
|
|
805
2089
|
/**
|
|
806
2090
|
* Model configuration loader
|
|
807
2091
|
*
|
|
@@ -1005,6 +2289,35 @@ declare function getSettings(): AppSettings;
|
|
|
1005
2289
|
*/
|
|
1006
2290
|
declare function updateSettings(newSettings: Partial<AppSettings>): void;
|
|
1007
2291
|
|
|
2292
|
+
/**
|
|
2293
|
+
* Deprecated decorator for marking methods as deprecated
|
|
2294
|
+
*
|
|
2295
|
+
* Corresponds to Python's utils/deprecated.py
|
|
2296
|
+
*/
|
|
2297
|
+
interface DeprecatedOptions {
|
|
2298
|
+
version?: string;
|
|
2299
|
+
replacement?: string;
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* Decorator to mark a method as deprecated.
|
|
2303
|
+
* Logs a warning when the method is called.
|
|
2304
|
+
*
|
|
2305
|
+
* @param options - Configuration options
|
|
2306
|
+
* @param options.version - Version in which the method will be removed
|
|
2307
|
+
* @param options.replacement - Suggested replacement method
|
|
2308
|
+
*
|
|
2309
|
+
* @example
|
|
2310
|
+
* ```typescript
|
|
2311
|
+
* class MyClass {
|
|
2312
|
+
* @deprecated({ version: '0.2.2', replacement: 'formatForApi' })
|
|
2313
|
+
* oldMethod() {
|
|
2314
|
+
* // ...
|
|
2315
|
+
* }
|
|
2316
|
+
* }
|
|
2317
|
+
* ```
|
|
2318
|
+
*/
|
|
2319
|
+
declare function deprecated(options?: DeprecatedOptions): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
2320
|
+
|
|
1008
2321
|
/**
|
|
1009
2322
|
* Winston logger configuration
|
|
1010
2323
|
*
|
|
@@ -1049,4 +2362,4 @@ declare const _default: {
|
|
|
1049
2362
|
getDisableLog: () => boolean;
|
|
1050
2363
|
};
|
|
1051
2364
|
|
|
1052
|
-
export { Agent, type AgentConfig, ApiTool, type AppSettings, BaseEnvironment, CodingEnvironment, CommandLineTool, DEFAULT_CONFIG, DEFAULT_SETTINGS, ENV_VARS, ERROR_MESSAGES, type EnvironmentConfig, EvoltError, ExtendStateMachineTool, FileEditor, FunctionCallingStore, GitTool, LOG_LEVELS, MESSAGE_ROLES, Message, MessageHistory, Model, type ModelConfig, ModelError, type ModelResponse
|
|
2365
|
+
export { type ActorAgentConfig, Agent, type AgentConfig, type AgentStateStore, ApiTool, type AppSettings, BaseEnvironment, BaseOrchestrator, CodingEnvironment, CodingOrchestrator, CommandLineTool, type CriticAgentConfig, DEFAULT_CONFIG, DEFAULT_SETTINGS, ENV_VARS, ERROR_MESSAGES, Environment, type EnvironmentConfig, type EnvironmentOptions, EvoltError, type ExecutedToolcallProtocol, type ExecutorStatus, ExtendStateMachineTool, Feedback, FileEditor, FunctionCallingStore, type GeneratedToolcallProtocol, GitTool, type ImageContent, ImageTool, InstructionType, JsonlAgentStateStore, LOG_LEVELS, LocalToolExecutor, MESSAGE_ROLES, Message, MessageHistory, Model, type ModelConfig, ModelError, type ModelResponse, OUTPUT_FORMAT_PROMPT, PatchTool, type PostProcessor, REFLECT_OUTPUT_FORMAT_PROMPT, ReflectTool, ReflexionOrchestrator, type ReflexionOrchestratorOptions, type ReflexionResult, Reply2HumanTool, SKILLS_DIR, SYSTEM_TOOLS_PROMPT, type SessionMeta, SkillsTool, type StateRecord, type StateRecordType, SystemToolStore, TOOLS_PROMPT, TOOL_CALL_TYPES, TOOL_CONSTANTS, ThinkTool, TodoListTool, type ToolCall, type ToolDescription, ToolExecutionError, type ToolExecutorProtocol$1 as ToolExecutorProtocol, type ToolStore, Toolcall, type ToolcallSource, type ToolcallState, type ToolcallType, UserToolStore, WORKSPACE_DIR, WriteUIDesignDocument, _executeSingleTool, agentAutoRestore, areadImage, createExecutedToolcall, createGeneratedToolcall, createStateRecord, deprecated, enableStateStore, ensureDir, executeToolsParallel, executeToolsSequential, fileExists, getAgentName, getCacheDir, getConfigDir, getConfigPath, getCurrentExecutor, getFileExtension, getGlobalStore, getLogsDir, getOrCreateSessionId, getSessionId, getSettings, getSkillsDir, getTempFilePath, getWorkspaceDir, getWorkspacePath, initializeSettings, isInWorkspace, isNewSession, isPersistenceEnabled, isSupportedImageFile, loadModelConfig, _default as logger, normalizePath, persistentState, readImage, registerAgentAsTool, resetAgentName, resetSessionId, setAgentName, setCurrentExecutor, settings, shouldSkipExecutorRestore, tools, updateSettings, useSessionId };
|