@inkeep/agents-sdk 0.0.0-dev-20251012022558 → 0.0.0-dev-20251012045242
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.cjs +346 -345
- package/dist/index.d.cts +114 -114
- package/dist/index.d.ts +114 -114
- package/dist/index.js +345 -344
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
|
-
import { MCPToolConfig as MCPToolConfig$1,
|
|
1
|
+
import { ArtifactComponentInsert, MCPToolConfig as MCPToolConfig$1, CredentialReferenceApiInsert, DataComponentInsert, CredentialReferenceSelect, FunctionToolConfig, SubAgentApiInsert, DataComponentApiInsert, ArtifactComponentApiInsert, AgentConversationHistoryConfig, AgentStopWhen, ModelSettings, StatusUpdateSettings, FullAgentDefinition, ToolInsert, McpTransportConfig, StopWhen, SandboxConfig, FullProjectDefinition } from '@inkeep/agents-core';
|
|
2
2
|
export { ANTHROPIC_MODELS, FunctionToolConfig, GOOGLE_MODELS, ModelSettings, OPENAI_MODELS, SandboxConfig } from '@inkeep/agents-core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
+
type ArtifactComponentConfigWithZod = Omit<ArtifactComponentInsert, 'tenantId' | 'projectId' | 'props'> & {
|
|
6
|
+
props?: Record<string, unknown> | z.ZodObject<any> | null;
|
|
7
|
+
};
|
|
8
|
+
interface ArtifactComponentInterface {
|
|
9
|
+
config: Omit<ArtifactComponentInsert, 'tenantId' | 'projectId'>;
|
|
10
|
+
init(): Promise<void>;
|
|
11
|
+
getId(): ArtifactComponentInsert['id'];
|
|
12
|
+
getName(): ArtifactComponentInsert['name'];
|
|
13
|
+
getDescription(): ArtifactComponentInsert['description'];
|
|
14
|
+
getProps(): ArtifactComponentInsert['props'];
|
|
15
|
+
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
16
|
+
}
|
|
17
|
+
declare class ArtifactComponent implements ArtifactComponentInterface {
|
|
18
|
+
config: Omit<ArtifactComponentInsert, 'tenantId' | 'projectId'>;
|
|
19
|
+
private baseURL;
|
|
20
|
+
private tenantId;
|
|
21
|
+
private projectId;
|
|
22
|
+
private initialized;
|
|
23
|
+
private id;
|
|
24
|
+
constructor(config: ArtifactComponentConfigWithZod);
|
|
25
|
+
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
26
|
+
getId(): string;
|
|
27
|
+
getName(): string;
|
|
28
|
+
getDescription(): string;
|
|
29
|
+
getProps(): ArtifactComponentInsert['props'];
|
|
30
|
+
init(): Promise<void>;
|
|
31
|
+
private upsertArtifactComponent;
|
|
32
|
+
}
|
|
33
|
+
|
|
5
34
|
interface ToolInterface {
|
|
6
35
|
config: MCPToolConfig$1;
|
|
7
36
|
init(): Promise<void>;
|
|
@@ -32,35 +61,6 @@ declare class Tool implements ToolInterface {
|
|
|
32
61
|
private upsertTool;
|
|
33
62
|
}
|
|
34
63
|
|
|
35
|
-
type ArtifactComponentConfigWithZod = Omit<ArtifactComponentInsert, 'tenantId' | 'projectId' | 'props'> & {
|
|
36
|
-
props?: Record<string, unknown> | z.ZodObject<any> | null;
|
|
37
|
-
};
|
|
38
|
-
interface ArtifactComponentInterface {
|
|
39
|
-
config: Omit<ArtifactComponentInsert, 'tenantId' | 'projectId'>;
|
|
40
|
-
init(): Promise<void>;
|
|
41
|
-
getId(): ArtifactComponentInsert['id'];
|
|
42
|
-
getName(): ArtifactComponentInsert['name'];
|
|
43
|
-
getDescription(): ArtifactComponentInsert['description'];
|
|
44
|
-
getProps(): ArtifactComponentInsert['props'];
|
|
45
|
-
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
46
|
-
}
|
|
47
|
-
declare class ArtifactComponent implements ArtifactComponentInterface {
|
|
48
|
-
config: Omit<ArtifactComponentInsert, 'tenantId' | 'projectId'>;
|
|
49
|
-
private baseURL;
|
|
50
|
-
private tenantId;
|
|
51
|
-
private projectId;
|
|
52
|
-
private initialized;
|
|
53
|
-
private id;
|
|
54
|
-
constructor(config: ArtifactComponentConfigWithZod);
|
|
55
|
-
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
56
|
-
getId(): string;
|
|
57
|
-
getName(): string;
|
|
58
|
-
getDescription(): string;
|
|
59
|
-
getProps(): ArtifactComponentInsert['props'];
|
|
60
|
-
init(): Promise<void>;
|
|
61
|
-
private upsertArtifactComponent;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
64
|
/**
|
|
65
65
|
* Function signature for transfer conditions
|
|
66
66
|
*/
|
|
@@ -100,7 +100,7 @@ type AgentMcpConfig = {
|
|
|
100
100
|
headers?: Record<string, string>;
|
|
101
101
|
};
|
|
102
102
|
/**
|
|
103
|
-
* Creates a transfer configuration for agent
|
|
103
|
+
* Creates a transfer configuration for agent transfers.
|
|
104
104
|
*
|
|
105
105
|
* Transfers allow one agent to hand off control to another agent
|
|
106
106
|
* based on optional conditions.
|
|
@@ -113,7 +113,7 @@ type AgentMcpConfig = {
|
|
|
113
113
|
* @example
|
|
114
114
|
* ```typescript
|
|
115
115
|
* // Simple transfer
|
|
116
|
-
* const
|
|
116
|
+
* const transfer = transfer(supportAgent, 'Transfer to support');
|
|
117
117
|
*
|
|
118
118
|
* // Conditional transfer
|
|
119
119
|
* const conditionalHandoff = transfer(
|
|
@@ -406,7 +406,7 @@ interface RunResult {
|
|
|
406
406
|
transfers: TransferConfig[];
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
-
interface
|
|
409
|
+
interface AgentConfig {
|
|
410
410
|
id: string;
|
|
411
411
|
name?: string;
|
|
412
412
|
description?: string;
|
|
@@ -414,8 +414,8 @@ interface GraphConfig {
|
|
|
414
414
|
subAgents?: () => AllSubAgentInterface[];
|
|
415
415
|
contextConfig?: any;
|
|
416
416
|
credentials?: () => CredentialReferenceApiInsert[];
|
|
417
|
-
stopWhen?:
|
|
418
|
-
|
|
417
|
+
stopWhen?: AgentStopWhen;
|
|
418
|
+
agentPrompt?: string;
|
|
419
419
|
models?: {
|
|
420
420
|
base?: ModelSettings;
|
|
421
421
|
structuredOutput?: ModelSettings;
|
|
@@ -467,7 +467,7 @@ interface ExternalAgentInterface {
|
|
|
467
467
|
getHeaders(): Record<string, string> | undefined;
|
|
468
468
|
setContext?(tenantId: string, baseURL?: string): void;
|
|
469
469
|
}
|
|
470
|
-
interface
|
|
470
|
+
interface AgentInterface {
|
|
471
471
|
init(): Promise<void>;
|
|
472
472
|
setConfig(tenantId: string, projectId: string, apiUrl: string): void;
|
|
473
473
|
getId(): string;
|
|
@@ -477,10 +477,10 @@ interface GraphInterface {
|
|
|
477
477
|
generate(input: MessageInput, options?: GenerateOptions): Promise<string>;
|
|
478
478
|
stream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
479
479
|
generateStream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
getDefaultSubAgent(): SubAgentInterface | undefined;
|
|
481
|
+
getSubAgent(name: string): AllSubAgentInterface | undefined;
|
|
482
482
|
getSubAgents(): AllSubAgentInterface[];
|
|
483
|
-
|
|
483
|
+
toFullAgentDefinition(): Promise<FullAgentDefinition>;
|
|
484
484
|
}
|
|
485
485
|
interface BuilderToolConfig {
|
|
486
486
|
name: string;
|
|
@@ -549,45 +549,45 @@ declare class SubAgent implements SubAgentInterface {
|
|
|
549
549
|
private createAgentToolRelation;
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
-
declare class
|
|
552
|
+
declare class Agent implements AgentInterface {
|
|
553
553
|
private subAgents;
|
|
554
554
|
private agentMap;
|
|
555
555
|
private defaultSubAgent?;
|
|
556
556
|
private baseURL;
|
|
557
557
|
private tenantId;
|
|
558
558
|
private projectId;
|
|
559
|
-
private
|
|
560
|
-
private
|
|
561
|
-
private
|
|
559
|
+
private agentId;
|
|
560
|
+
private agentName;
|
|
561
|
+
private agentDescription?;
|
|
562
562
|
private initialized;
|
|
563
563
|
private contextConfig?;
|
|
564
564
|
private credentials?;
|
|
565
565
|
private models?;
|
|
566
566
|
private statusUpdateSettings?;
|
|
567
|
-
private
|
|
567
|
+
private agentPrompt?;
|
|
568
568
|
private stopWhen?;
|
|
569
569
|
private dbClient;
|
|
570
|
-
constructor(config:
|
|
570
|
+
constructor(config: AgentConfig);
|
|
571
571
|
/**
|
|
572
572
|
* Set or update the configuration (tenantId, projectId and apiUrl)
|
|
573
573
|
* This is used by the CLI to inject configuration from inkeep.config.ts
|
|
574
574
|
*/
|
|
575
575
|
setConfig(tenantId: string, projectId: string, apiUrl: string): void;
|
|
576
576
|
/**
|
|
577
|
-
* Convert the
|
|
577
|
+
* Convert the Agent to FullAgentDefinition format for the new agent endpoint
|
|
578
578
|
*/
|
|
579
|
-
|
|
579
|
+
toFullAgentDefinition(): Promise<FullAgentDefinition>;
|
|
580
580
|
/**
|
|
581
581
|
* Initialize all tools in all agents (especially IPCTools that need MCP server URLs)
|
|
582
582
|
*/
|
|
583
583
|
private initializeAllTools;
|
|
584
584
|
/**
|
|
585
|
-
* Initialize the
|
|
585
|
+
* Initialize the agent and all agents in the backend using the new agent endpoint
|
|
586
586
|
*/
|
|
587
587
|
init(): Promise<void>;
|
|
588
588
|
/**
|
|
589
589
|
* Legacy initialization method - kept for backward compatibility
|
|
590
|
-
* Initialize the
|
|
590
|
+
* Initialize the agent and all agents in the backend using individual endpoints
|
|
591
591
|
*/
|
|
592
592
|
initLegacy(): Promise<void>;
|
|
593
593
|
/**
|
|
@@ -603,23 +603,23 @@ declare class AgentGraph implements GraphInterface {
|
|
|
603
603
|
*/
|
|
604
604
|
generateStream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
605
605
|
/**
|
|
606
|
-
* Run with a specific agent from the
|
|
606
|
+
* Run with a specific agent from the agent
|
|
607
607
|
*/
|
|
608
608
|
runWith(subAgentId: string, input: MessageInput, options?: GenerateOptions): Promise<RunResult>;
|
|
609
609
|
/**
|
|
610
610
|
* Get an agent by name (unified method for all agent types)
|
|
611
611
|
*/
|
|
612
|
-
|
|
612
|
+
getSubAgent(name: string): AllSubAgentInterface | undefined;
|
|
613
613
|
/**
|
|
614
|
-
* Add an agent to the
|
|
614
|
+
* Add an agent to the agent
|
|
615
615
|
*/
|
|
616
616
|
addSubAgent(agent: SubAgentInterface): void;
|
|
617
617
|
/**
|
|
618
|
-
* Remove an agent from the
|
|
618
|
+
* Remove an agent from the agent
|
|
619
619
|
*/
|
|
620
620
|
removeSubAgent(id: string): boolean;
|
|
621
621
|
/**
|
|
622
|
-
* Get all agents in the
|
|
622
|
+
* Get all agents in the agent
|
|
623
623
|
*/
|
|
624
624
|
getSubAgents(): AllSubAgentInterface[];
|
|
625
625
|
/**
|
|
@@ -629,54 +629,54 @@ declare class AgentGraph implements GraphInterface {
|
|
|
629
629
|
/**
|
|
630
630
|
* Set the default agent
|
|
631
631
|
*/
|
|
632
|
-
|
|
632
|
+
setDefaultSubAgent(agent: SubAgentInterface): void;
|
|
633
633
|
/**
|
|
634
634
|
* Get the default agent
|
|
635
635
|
*/
|
|
636
|
-
|
|
636
|
+
getDefaultSubAgent(): SubAgentInterface | undefined;
|
|
637
637
|
/**
|
|
638
|
-
* Get the
|
|
638
|
+
* Get the agent ID
|
|
639
639
|
*/
|
|
640
640
|
getId(): string;
|
|
641
641
|
getName(): string;
|
|
642
642
|
getDescription(): string | undefined;
|
|
643
643
|
getTenantId(): string;
|
|
644
644
|
/**
|
|
645
|
-
* Get the
|
|
645
|
+
* Get the agent's model settingsuration
|
|
646
646
|
*/
|
|
647
647
|
getModels(): typeof this.models;
|
|
648
648
|
/**
|
|
649
|
-
* Set the
|
|
649
|
+
* Set the agent's model settingsuration
|
|
650
650
|
*/
|
|
651
651
|
setModels(models: typeof this.models): void;
|
|
652
652
|
/**
|
|
653
|
-
* Get the
|
|
653
|
+
* Get the agent's prompt configuration
|
|
654
654
|
*/
|
|
655
|
-
|
|
655
|
+
getAgentPrompt(): string | undefined;
|
|
656
656
|
/**
|
|
657
|
-
* Get the
|
|
657
|
+
* Get the agent's stopWhen configuration
|
|
658
658
|
*/
|
|
659
|
-
getStopWhen():
|
|
659
|
+
getStopWhen(): AgentStopWhen;
|
|
660
660
|
/**
|
|
661
|
-
* Get the
|
|
661
|
+
* Get the agent's status updates configuration
|
|
662
662
|
*/
|
|
663
663
|
getStatusUpdateSettings(): StatusUpdateSettings | undefined;
|
|
664
664
|
/**
|
|
665
|
-
* Get the summarizer model from the
|
|
665
|
+
* Get the summarizer model from the agent's model settings
|
|
666
666
|
*/
|
|
667
667
|
getSummarizerModel(): ModelSettings | undefined;
|
|
668
668
|
/**
|
|
669
|
-
* Get
|
|
669
|
+
* Get agent statistics
|
|
670
670
|
*/
|
|
671
671
|
getStats(): {
|
|
672
672
|
agentCount: number;
|
|
673
673
|
defaultSubAgent: string | null;
|
|
674
674
|
initialized: boolean;
|
|
675
|
-
|
|
675
|
+
agentId: string;
|
|
676
676
|
tenantId: string;
|
|
677
677
|
};
|
|
678
678
|
/**
|
|
679
|
-
* Validate the
|
|
679
|
+
* Validate the agent configuration
|
|
680
680
|
*/
|
|
681
681
|
validate(): {
|
|
682
682
|
valid: boolean;
|
|
@@ -696,19 +696,19 @@ declare class AgentGraph implements GraphInterface {
|
|
|
696
696
|
*/
|
|
697
697
|
private getProjectStopWhenDefaults;
|
|
698
698
|
/**
|
|
699
|
-
* Apply model inheritance hierarchy: Project ->
|
|
699
|
+
* Apply model inheritance hierarchy: Project -> Agent -> Agent
|
|
700
700
|
*/
|
|
701
701
|
private applyModelInheritance;
|
|
702
702
|
/**
|
|
703
|
-
* Apply stopWhen inheritance hierarchy: Project ->
|
|
703
|
+
* Apply stopWhen inheritance hierarchy: Project -> Agent -> Agent
|
|
704
704
|
*/
|
|
705
705
|
private applyStopWhenInheritance;
|
|
706
706
|
/**
|
|
707
|
-
* Propagate
|
|
707
|
+
* Propagate agent-level model settings to agents (supporting partial inheritance)
|
|
708
708
|
*/
|
|
709
709
|
private propagateModelSettingsToAgent;
|
|
710
710
|
/**
|
|
711
|
-
* Immediately propagate
|
|
711
|
+
* Immediately propagate agent-level models to all agents during construction
|
|
712
712
|
*/
|
|
713
713
|
private propagateImmediateModelSettings;
|
|
714
714
|
/**
|
|
@@ -752,7 +752,7 @@ interface ProjectConfig {
|
|
|
752
752
|
};
|
|
753
753
|
stopWhen?: StopWhen;
|
|
754
754
|
sandboxConfig?: SandboxConfig;
|
|
755
|
-
|
|
755
|
+
agents?: () => Agent[];
|
|
756
756
|
tools?: () => Tool[];
|
|
757
757
|
dataComponents?: () => DataComponent[];
|
|
758
758
|
artifactComponents?: () => ArtifactComponent[];
|
|
@@ -770,13 +770,13 @@ interface ProjectInterface {
|
|
|
770
770
|
getTenantId(): string;
|
|
771
771
|
getModels(): ProjectConfig['models'];
|
|
772
772
|
getStopWhen(): ProjectConfig['stopWhen'];
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
773
|
+
getAgents(): Agent[];
|
|
774
|
+
addAgent(agent: Agent): void;
|
|
775
|
+
removeAgent(id: string): boolean;
|
|
776
776
|
getStats(): {
|
|
777
777
|
projectId: string;
|
|
778
778
|
tenantId: string;
|
|
779
|
-
|
|
779
|
+
agentCount: number;
|
|
780
780
|
initialized: boolean;
|
|
781
781
|
};
|
|
782
782
|
validate(): {
|
|
@@ -787,8 +787,8 @@ interface ProjectInterface {
|
|
|
787
787
|
/**
|
|
788
788
|
* Project class for managing agent projects
|
|
789
789
|
*
|
|
790
|
-
* Projects are the top-level organizational unit that contains
|
|
791
|
-
* They provide model inheritance and execution limits that cascade down to
|
|
790
|
+
* Projects are the top-level organizational unit that contains agent, agents, and shared configurations.
|
|
791
|
+
* They provide model inheritance and execution limits that cascade down to agent and agents.
|
|
792
792
|
*
|
|
793
793
|
* @example
|
|
794
794
|
* ```typescript
|
|
@@ -821,8 +821,8 @@ declare class Project implements ProjectInterface {
|
|
|
821
821
|
private models?;
|
|
822
822
|
private stopWhen?;
|
|
823
823
|
private sandboxConfig?;
|
|
824
|
-
private
|
|
825
|
-
private
|
|
824
|
+
private agents;
|
|
825
|
+
private agentMap;
|
|
826
826
|
private credentialReferences?;
|
|
827
827
|
private projectTools;
|
|
828
828
|
private projectDataComponents;
|
|
@@ -882,33 +882,33 @@ declare class Project implements ProjectInterface {
|
|
|
882
882
|
usage: Record<string, Array<{
|
|
883
883
|
type: string;
|
|
884
884
|
id: string;
|
|
885
|
-
|
|
885
|
+
agentId?: string;
|
|
886
886
|
}>>;
|
|
887
887
|
}>;
|
|
888
888
|
getFullDefinition(): Promise<FullProjectDefinition>;
|
|
889
889
|
/**
|
|
890
|
-
* Get all
|
|
890
|
+
* Get all agent in the project
|
|
891
891
|
*/
|
|
892
|
-
|
|
892
|
+
getAgents(): Agent[];
|
|
893
893
|
/**
|
|
894
|
-
* Get
|
|
894
|
+
* Get an agent by ID
|
|
895
895
|
*/
|
|
896
|
-
|
|
896
|
+
getAgent(id: string): Agent | undefined;
|
|
897
897
|
/**
|
|
898
|
-
* Add
|
|
898
|
+
* Add an agent to the project
|
|
899
899
|
*/
|
|
900
|
-
|
|
900
|
+
addAgent(agent: Agent): void;
|
|
901
901
|
/**
|
|
902
|
-
* Remove
|
|
902
|
+
* Remove an agent from the project
|
|
903
903
|
*/
|
|
904
|
-
|
|
904
|
+
removeAgent(id: string): boolean;
|
|
905
905
|
/**
|
|
906
906
|
* Get project statistics
|
|
907
907
|
*/
|
|
908
908
|
getStats(): {
|
|
909
909
|
projectId: string;
|
|
910
910
|
tenantId: string;
|
|
911
|
-
|
|
911
|
+
agentCount: number;
|
|
912
912
|
initialized: boolean;
|
|
913
913
|
};
|
|
914
914
|
/**
|
|
@@ -925,14 +925,14 @@ declare class Project implements ProjectInterface {
|
|
|
925
925
|
}
|
|
926
926
|
|
|
927
927
|
/**
|
|
928
|
-
* Helper function to create
|
|
928
|
+
* Helper function to create agent - OpenAI style
|
|
929
929
|
*/
|
|
930
|
-
declare function
|
|
930
|
+
declare function agent(config: AgentConfig): Agent;
|
|
931
931
|
/**
|
|
932
932
|
* Helper function to create projects - OpenAI style
|
|
933
933
|
*
|
|
934
|
-
* Projects are the top-level organizational unit that contains
|
|
935
|
-
* They provide model inheritance and execution limits that cascade down to
|
|
934
|
+
* Projects are the top-level organizational unit that contains agent, agents, and shared configurations.
|
|
935
|
+
* They provide model inheritance and execution limits that cascade down to agent and agents.
|
|
936
936
|
*
|
|
937
937
|
* @param config - Project configuration
|
|
938
938
|
* @returns A new Project instance
|
|
@@ -951,11 +951,11 @@ declare function agentGraph(config: GraphConfig): AgentGraph;
|
|
|
951
951
|
* transferCountIs: 10,
|
|
952
952
|
* stepCountIs: 50
|
|
953
953
|
* },
|
|
954
|
-
*
|
|
955
|
-
*
|
|
956
|
-
* id: 'support-
|
|
957
|
-
* name: 'Support
|
|
958
|
-
* // ...
|
|
954
|
+
* agent: () => [
|
|
955
|
+
* agent({
|
|
956
|
+
* id: 'support-agent',
|
|
957
|
+
* name: 'Support Agent',
|
|
958
|
+
* // ... agent config
|
|
959
959
|
* })
|
|
960
960
|
* ]
|
|
961
961
|
* });
|
|
@@ -1243,39 +1243,39 @@ declare function deleteFullProjectViaAPI(tenantId: string, apiUrl: string, proje
|
|
|
1243
1243
|
|
|
1244
1244
|
declare class Runner {
|
|
1245
1245
|
/**
|
|
1246
|
-
* Run
|
|
1246
|
+
* Run an agent until completion, handling transfers and tool calls
|
|
1247
1247
|
* Similar to OpenAI's Runner.run() pattern
|
|
1248
|
-
* NOTE: This now requires
|
|
1248
|
+
* NOTE: This now requires an agent instead of an agent
|
|
1249
1249
|
*/
|
|
1250
|
-
static run(
|
|
1250
|
+
static run(agent: AgentInterface, messages: MessageInput, options?: GenerateOptions): Promise<RunResult>;
|
|
1251
1251
|
/**
|
|
1252
|
-
* Stream
|
|
1252
|
+
* Stream an agent's response
|
|
1253
1253
|
*/
|
|
1254
|
-
static stream(
|
|
1254
|
+
static stream(agent: AgentInterface, messages: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
1255
1255
|
/**
|
|
1256
|
-
* Execute multiple
|
|
1256
|
+
* Execute multiple agent in parallel and return the first successful result
|
|
1257
1257
|
*/
|
|
1258
|
-
static
|
|
1258
|
+
static raceAgents(agent: AgentInterface[], messages: MessageInput, options?: GenerateOptions): Promise<RunResult>;
|
|
1259
1259
|
private static normalizeToMessageHistory;
|
|
1260
1260
|
/**
|
|
1261
|
-
* Validate
|
|
1261
|
+
* Validate agent configuration before running
|
|
1262
1262
|
*/
|
|
1263
|
-
static
|
|
1263
|
+
static validateAgent(agent: AgentInterface): {
|
|
1264
1264
|
valid: boolean;
|
|
1265
1265
|
errors: string[];
|
|
1266
1266
|
};
|
|
1267
1267
|
/**
|
|
1268
|
-
* Get execution statistics for
|
|
1268
|
+
* Get execution statistics for an agent
|
|
1269
1269
|
*/
|
|
1270
|
-
static getExecutionStats(
|
|
1270
|
+
static getExecutionStats(agent: AgentInterface, messages: MessageInput, options?: GenerateOptions): Promise<{
|
|
1271
1271
|
estimatedTurns: number;
|
|
1272
1272
|
estimatedTokens: number;
|
|
1273
|
-
|
|
1273
|
+
subAgentCount: number;
|
|
1274
1274
|
defaultSubAgent: string | undefined;
|
|
1275
1275
|
}>;
|
|
1276
1276
|
}
|
|
1277
1277
|
declare const run: typeof Runner.run;
|
|
1278
1278
|
declare const stream: typeof Runner.stream;
|
|
1279
|
-
declare const
|
|
1279
|
+
declare const raceAgents: typeof Runner.raceAgents;
|
|
1280
1280
|
|
|
1281
|
-
export {
|
|
1281
|
+
export { type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AgentTool, type AllSubAgentInterface, ArtifactComponent, type ArtifactComponentInterface, type ArtifactComponentWithZodProps, type AssistantMessage, type BuilderAgentConfig, type BuilderRelationConfig, type BuilderToolConfig, type CredentialReference, DataComponent, type DataComponentInterface, type DataComponentWithZodProps, ExternalAgent, type ExternalAgentInterface, type ExtractCredentialIds, type FetchDefinitionConfig, FunctionTool, type GenerateOptions, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, Project, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StreamEvent, type StreamResponse, SubAgent, type SubAgentCanUseType, type SubAgentConfig, type SubAgentInterface, type SystemMessage, Tool, type ToolCall, type ToolConfig, ToolExecutionError, type ToolMessage, type ToolResult, type TransferConfig, TransferError, type UnionCredentialIds, type UserMessage, agent, agentMcp, artifactComponent, createEnvironmentSettings, createFullProjectViaAPI, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, functionTool, getFullProjectViaAPI, isCredentialReference, mcpServer, mcpTool, project, raceAgents, registerEnvironmentSettings, run, stream, subAgent, transfer, updateFullProjectViaAPI };
|