@inkeep/agents-sdk 0.24.1 → 0.25.0
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 +274 -362
- package/dist/index.d.cts +47 -31
- package/dist/index.d.ts +47 -31
- package/dist/index.js +274 -362
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArtifactComponentInsert, MCPToolConfig as MCPToolConfig$1, DataComponentApiInsert, ArtifactComponentApiInsert, CredentialReferenceApiInsert, DataComponentInsert,
|
|
1
|
+
import { ArtifactComponentInsert, MCPToolConfig as MCPToolConfig$1, DataComponentApiInsert, ArtifactComponentApiInsert, CredentialReferenceApiInsert, DataComponentInsert, FunctionToolConfig, SubAgentApiInsert, AgentConversationHistoryConfig, AgentStopWhen, ModelSettings, StatusUpdateSettings, FullAgentDefinition, ToolInsert, McpTransportConfig, StopWhen, FullProjectDefinition, StatusComponent as StatusComponent$1 } from '@inkeep/agents-core';
|
|
2
2
|
export { ANTHROPIC_MODELS, FunctionToolConfig, GOOGLE_MODELS, ModelSettings, OPENAI_MODELS } from '@inkeep/agents-core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
@@ -81,6 +81,8 @@ declare class SubAgent implements SubAgentInterface {
|
|
|
81
81
|
getModels(): typeof this$1.config.models;
|
|
82
82
|
setModels(models: typeof this$1.config.models): void;
|
|
83
83
|
getTransfers(): SubAgentInterface[];
|
|
84
|
+
getSubAgentDelegates(): SubAgentInterface[];
|
|
85
|
+
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
84
86
|
getDelegates(): AllSubAgentInterface[];
|
|
85
87
|
getDataComponents(): DataComponentApiInsert[];
|
|
86
88
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
@@ -207,22 +209,25 @@ type ExternalAgentConfig = {
|
|
|
207
209
|
name: string;
|
|
208
210
|
description: string;
|
|
209
211
|
baseUrl: string;
|
|
210
|
-
credentialReference?:
|
|
211
|
-
headers?: Record<string, string>;
|
|
212
|
+
credentialReference?: CredentialReferenceApiInsert;
|
|
212
213
|
};
|
|
213
214
|
declare class ExternalAgent implements ExternalAgentInterface {
|
|
214
215
|
config: ExternalAgentConfig;
|
|
215
216
|
readonly type: "external";
|
|
216
217
|
private initialized;
|
|
217
218
|
private tenantId;
|
|
219
|
+
private projectId;
|
|
218
220
|
private baseURL;
|
|
219
221
|
constructor(config: ExternalAgentConfig);
|
|
220
222
|
/**
|
|
221
223
|
* Initialize the external agent by upserting it in the database
|
|
222
224
|
*/
|
|
223
225
|
init(): Promise<void>;
|
|
224
|
-
setContext(tenantId: string,
|
|
226
|
+
setContext(tenantId: string, projectId: string): void;
|
|
225
227
|
getId(): string;
|
|
228
|
+
with(options: {
|
|
229
|
+
headers?: Record<string, string>;
|
|
230
|
+
}): subAgentExternalAgentInterface;
|
|
226
231
|
private upsertExternalAgent;
|
|
227
232
|
/**
|
|
228
233
|
* Get the external agent configuration
|
|
@@ -242,7 +247,7 @@ declare class ExternalAgent implements ExternalAgentInterface {
|
|
|
242
247
|
getTenantId(): string;
|
|
243
248
|
getDescription(): string;
|
|
244
249
|
getCredentialReferenceId(): string | undefined;
|
|
245
|
-
|
|
250
|
+
getCredentialReference(): CredentialReferenceApiInsert | undefined;
|
|
246
251
|
}
|
|
247
252
|
/**
|
|
248
253
|
* Factory function to create external agents - follows the same pattern as agent()
|
|
@@ -342,7 +347,7 @@ interface ToolResult {
|
|
|
342
347
|
result: any;
|
|
343
348
|
error?: string;
|
|
344
349
|
}
|
|
345
|
-
type AllSubAgentInterface = SubAgentInterface | ExternalAgentInterface;
|
|
350
|
+
type AllSubAgentInterface = SubAgentInterface | subAgentExternalAgentInterface | ExternalAgentInterface;
|
|
346
351
|
type SubAgentCanUseType = Tool | AgentMcpConfig | FunctionTool;
|
|
347
352
|
interface SubAgentConfig extends Omit<SubAgentApiInsert, 'projectId'> {
|
|
348
353
|
type?: 'internal';
|
|
@@ -458,7 +463,7 @@ interface AgentConfig {
|
|
|
458
463
|
name?: string;
|
|
459
464
|
description?: string;
|
|
460
465
|
defaultSubAgent?: SubAgentInterface;
|
|
461
|
-
subAgents?: () =>
|
|
466
|
+
subAgents?: () => SubAgentInterface[];
|
|
462
467
|
contextConfig?: any;
|
|
463
468
|
credentials?: () => CredentialReferenceApiInsert[];
|
|
464
469
|
stopWhen?: AgentStopWhen;
|
|
@@ -495,12 +500,14 @@ interface SubAgentInterface {
|
|
|
495
500
|
getTools(): Record<string, AgentTool>;
|
|
496
501
|
getTransfers(): SubAgentInterface[];
|
|
497
502
|
getDelegates(): AllSubAgentInterface[];
|
|
503
|
+
getSubAgentDelegates(): SubAgentInterface[];
|
|
504
|
+
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
498
505
|
getDataComponents(): DataComponentApiInsert[];
|
|
499
506
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
500
507
|
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
501
508
|
addTool(name: string, tool: any): void;
|
|
502
509
|
addTransfer(...agents: SubAgentInterface[]): void;
|
|
503
|
-
addDelegate(...agents:
|
|
510
|
+
addDelegate(...agents: AllSubAgentInterface[]): void;
|
|
504
511
|
}
|
|
505
512
|
interface ExternalAgentInterface {
|
|
506
513
|
config: ExternalAgentConfig;
|
|
@@ -510,10 +517,14 @@ interface ExternalAgentInterface {
|
|
|
510
517
|
getName(): string;
|
|
511
518
|
getDescription(): string;
|
|
512
519
|
getBaseUrl(): string;
|
|
513
|
-
setContext?(tenantId: string,
|
|
520
|
+
setContext?(tenantId: string, projectId: string): void;
|
|
514
521
|
getCredentialReferenceId(): string | undefined;
|
|
515
|
-
|
|
522
|
+
getCredentialReference(): CredentialReferenceApiInsert | undefined;
|
|
516
523
|
}
|
|
524
|
+
type subAgentExternalAgentInterface = {
|
|
525
|
+
externalAgent: ExternalAgentInterface;
|
|
526
|
+
headers?: Record<string, string>;
|
|
527
|
+
};
|
|
517
528
|
interface AgentInterface {
|
|
518
529
|
init(): Promise<void>;
|
|
519
530
|
setConfig(tenantId: string, projectId: string, apiUrl: string): void;
|
|
@@ -525,8 +536,8 @@ interface AgentInterface {
|
|
|
525
536
|
stream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
526
537
|
generateStream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
527
538
|
getDefaultSubAgent(): SubAgentInterface | undefined;
|
|
528
|
-
getSubAgent(name: string):
|
|
529
|
-
getSubAgents():
|
|
539
|
+
getSubAgent(name: string): SubAgentInterface | undefined;
|
|
540
|
+
getSubAgents(): SubAgentInterface[];
|
|
530
541
|
toFullAgentDefinition(): Promise<FullAgentDefinition>;
|
|
531
542
|
}
|
|
532
543
|
interface BuilderToolConfig {
|
|
@@ -590,11 +601,6 @@ declare class Agent implements AgentInterface {
|
|
|
590
601
|
* Initialize the agent and all agents in the backend using the new agent endpoint
|
|
591
602
|
*/
|
|
592
603
|
init(): Promise<void>;
|
|
593
|
-
/**
|
|
594
|
-
* Legacy initialization method - kept for backward compatibility
|
|
595
|
-
* Initialize the agent and all agents in the backend using individual endpoints
|
|
596
|
-
*/
|
|
597
|
-
initLegacy(): Promise<void>;
|
|
598
604
|
/**
|
|
599
605
|
* Generate a response using the default agent
|
|
600
606
|
*/
|
|
@@ -614,7 +620,7 @@ declare class Agent implements AgentInterface {
|
|
|
614
620
|
/**
|
|
615
621
|
* Get an agent by name (unified method for all agent types)
|
|
616
622
|
*/
|
|
617
|
-
getSubAgent(name: string):
|
|
623
|
+
getSubAgent(name: string): SubAgentInterface | undefined;
|
|
618
624
|
/**
|
|
619
625
|
* Add an agent to the agent
|
|
620
626
|
*/
|
|
@@ -626,7 +632,7 @@ declare class Agent implements AgentInterface {
|
|
|
626
632
|
/**
|
|
627
633
|
* Get all agents in the agent
|
|
628
634
|
*/
|
|
629
|
-
getSubAgents():
|
|
635
|
+
getSubAgents(): SubAgentInterface[];
|
|
630
636
|
/**
|
|
631
637
|
* Get all agent ids (unified method for all agent types)
|
|
632
638
|
*/
|
|
@@ -716,10 +722,6 @@ declare class Agent implements AgentInterface {
|
|
|
716
722
|
* Immediately propagate agent-level models to all agents during construction
|
|
717
723
|
*/
|
|
718
724
|
private propagateImmediateModelSettings;
|
|
719
|
-
/**
|
|
720
|
-
* Type guard to check if an agent is an external AgentInterface
|
|
721
|
-
*/
|
|
722
|
-
isExternalAgent(agent: AllSubAgentInterface): agent is ExternalAgentInterface;
|
|
723
725
|
/**
|
|
724
726
|
* Execute agent using the backend system instead of local runner
|
|
725
727
|
*/
|
|
@@ -734,13 +736,8 @@ declare class Agent implements AgentInterface {
|
|
|
734
736
|
private normalizeMessages;
|
|
735
737
|
private saveToDatabase;
|
|
736
738
|
private saveRelations;
|
|
737
|
-
private
|
|
738
|
-
private
|
|
739
|
-
private createExternalAgentRelation;
|
|
740
|
-
/**
|
|
741
|
-
* Create external agents in the database
|
|
742
|
-
*/
|
|
743
|
-
private createExternalAgents;
|
|
739
|
+
private createSubAgentRelations;
|
|
740
|
+
private createSubAgentRelation;
|
|
744
741
|
}
|
|
745
742
|
|
|
746
743
|
/**
|
|
@@ -758,6 +755,7 @@ interface ProjectConfig {
|
|
|
758
755
|
stopWhen?: StopWhen;
|
|
759
756
|
agents?: () => Agent[];
|
|
760
757
|
tools?: () => Tool[];
|
|
758
|
+
externalAgents?: () => ExternalAgent[];
|
|
761
759
|
dataComponents?: () => DataComponent[];
|
|
762
760
|
artifactComponents?: () => ArtifactComponent[];
|
|
763
761
|
credentialReferences?: () => CredentialReferenceApiInsert[];
|
|
@@ -830,6 +828,8 @@ declare class Project implements ProjectInterface {
|
|
|
830
828
|
private projectTools;
|
|
831
829
|
private projectDataComponents;
|
|
832
830
|
private projectArtifactComponents;
|
|
831
|
+
private projectExternalAgents;
|
|
832
|
+
private externalAgentMap;
|
|
833
833
|
constructor(config: ProjectConfig);
|
|
834
834
|
/**
|
|
835
835
|
* Set or update the configuration (tenantId and apiUrl)
|
|
@@ -893,6 +893,22 @@ declare class Project implements ProjectInterface {
|
|
|
893
893
|
* Get all agent in the project
|
|
894
894
|
*/
|
|
895
895
|
getAgents(): Agent[];
|
|
896
|
+
/**
|
|
897
|
+
* Get all external agents in the project
|
|
898
|
+
*/
|
|
899
|
+
getExternalAgents(): ExternalAgent[];
|
|
900
|
+
/**
|
|
901
|
+
* Get an external agent by ID
|
|
902
|
+
*/
|
|
903
|
+
getExternalAgent(id: string): ExternalAgent | undefined;
|
|
904
|
+
/**
|
|
905
|
+
* Add an external agent to the project
|
|
906
|
+
*/
|
|
907
|
+
addExternalAgent(externalAgent: ExternalAgent): void;
|
|
908
|
+
/**
|
|
909
|
+
* Remove an external agent from the project
|
|
910
|
+
*/
|
|
911
|
+
removeExternalAgent(id: string): boolean;
|
|
896
912
|
/**
|
|
897
913
|
* Get an agent by ID
|
|
898
914
|
*/
|
|
@@ -1323,4 +1339,4 @@ declare const run: typeof Runner.run;
|
|
|
1323
1339
|
declare const stream: typeof Runner.stream;
|
|
1324
1340
|
declare const raceAgents: typeof Runner.raceAgents;
|
|
1325
1341
|
|
|
1326
|
-
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, StatusComponent, type StatusComponentInterface, 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, statusComponent, stream, subAgent, transfer, updateFullProjectViaAPI };
|
|
1342
|
+
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, StatusComponent, type StatusComponentInterface, 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, statusComponent, stream, subAgent, type subAgentExternalAgentInterface, transfer, updateFullProjectViaAPI };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArtifactComponentInsert, MCPToolConfig as MCPToolConfig$1, DataComponentApiInsert, ArtifactComponentApiInsert, CredentialReferenceApiInsert, DataComponentInsert,
|
|
1
|
+
import { ArtifactComponentInsert, MCPToolConfig as MCPToolConfig$1, DataComponentApiInsert, ArtifactComponentApiInsert, CredentialReferenceApiInsert, DataComponentInsert, FunctionToolConfig, SubAgentApiInsert, AgentConversationHistoryConfig, AgentStopWhen, ModelSettings, StatusUpdateSettings, FullAgentDefinition, ToolInsert, McpTransportConfig, StopWhen, FullProjectDefinition, StatusComponent as StatusComponent$1 } from '@inkeep/agents-core';
|
|
2
2
|
export { ANTHROPIC_MODELS, FunctionToolConfig, GOOGLE_MODELS, ModelSettings, OPENAI_MODELS } from '@inkeep/agents-core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
@@ -81,6 +81,8 @@ declare class SubAgent implements SubAgentInterface {
|
|
|
81
81
|
getModels(): typeof this$1.config.models;
|
|
82
82
|
setModels(models: typeof this$1.config.models): void;
|
|
83
83
|
getTransfers(): SubAgentInterface[];
|
|
84
|
+
getSubAgentDelegates(): SubAgentInterface[];
|
|
85
|
+
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
84
86
|
getDelegates(): AllSubAgentInterface[];
|
|
85
87
|
getDataComponents(): DataComponentApiInsert[];
|
|
86
88
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
@@ -207,22 +209,25 @@ type ExternalAgentConfig = {
|
|
|
207
209
|
name: string;
|
|
208
210
|
description: string;
|
|
209
211
|
baseUrl: string;
|
|
210
|
-
credentialReference?:
|
|
211
|
-
headers?: Record<string, string>;
|
|
212
|
+
credentialReference?: CredentialReferenceApiInsert;
|
|
212
213
|
};
|
|
213
214
|
declare class ExternalAgent implements ExternalAgentInterface {
|
|
214
215
|
config: ExternalAgentConfig;
|
|
215
216
|
readonly type: "external";
|
|
216
217
|
private initialized;
|
|
217
218
|
private tenantId;
|
|
219
|
+
private projectId;
|
|
218
220
|
private baseURL;
|
|
219
221
|
constructor(config: ExternalAgentConfig);
|
|
220
222
|
/**
|
|
221
223
|
* Initialize the external agent by upserting it in the database
|
|
222
224
|
*/
|
|
223
225
|
init(): Promise<void>;
|
|
224
|
-
setContext(tenantId: string,
|
|
226
|
+
setContext(tenantId: string, projectId: string): void;
|
|
225
227
|
getId(): string;
|
|
228
|
+
with(options: {
|
|
229
|
+
headers?: Record<string, string>;
|
|
230
|
+
}): subAgentExternalAgentInterface;
|
|
226
231
|
private upsertExternalAgent;
|
|
227
232
|
/**
|
|
228
233
|
* Get the external agent configuration
|
|
@@ -242,7 +247,7 @@ declare class ExternalAgent implements ExternalAgentInterface {
|
|
|
242
247
|
getTenantId(): string;
|
|
243
248
|
getDescription(): string;
|
|
244
249
|
getCredentialReferenceId(): string | undefined;
|
|
245
|
-
|
|
250
|
+
getCredentialReference(): CredentialReferenceApiInsert | undefined;
|
|
246
251
|
}
|
|
247
252
|
/**
|
|
248
253
|
* Factory function to create external agents - follows the same pattern as agent()
|
|
@@ -342,7 +347,7 @@ interface ToolResult {
|
|
|
342
347
|
result: any;
|
|
343
348
|
error?: string;
|
|
344
349
|
}
|
|
345
|
-
type AllSubAgentInterface = SubAgentInterface | ExternalAgentInterface;
|
|
350
|
+
type AllSubAgentInterface = SubAgentInterface | subAgentExternalAgentInterface | ExternalAgentInterface;
|
|
346
351
|
type SubAgentCanUseType = Tool | AgentMcpConfig | FunctionTool;
|
|
347
352
|
interface SubAgentConfig extends Omit<SubAgentApiInsert, 'projectId'> {
|
|
348
353
|
type?: 'internal';
|
|
@@ -458,7 +463,7 @@ interface AgentConfig {
|
|
|
458
463
|
name?: string;
|
|
459
464
|
description?: string;
|
|
460
465
|
defaultSubAgent?: SubAgentInterface;
|
|
461
|
-
subAgents?: () =>
|
|
466
|
+
subAgents?: () => SubAgentInterface[];
|
|
462
467
|
contextConfig?: any;
|
|
463
468
|
credentials?: () => CredentialReferenceApiInsert[];
|
|
464
469
|
stopWhen?: AgentStopWhen;
|
|
@@ -495,12 +500,14 @@ interface SubAgentInterface {
|
|
|
495
500
|
getTools(): Record<string, AgentTool>;
|
|
496
501
|
getTransfers(): SubAgentInterface[];
|
|
497
502
|
getDelegates(): AllSubAgentInterface[];
|
|
503
|
+
getSubAgentDelegates(): SubAgentInterface[];
|
|
504
|
+
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
498
505
|
getDataComponents(): DataComponentApiInsert[];
|
|
499
506
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
500
507
|
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
501
508
|
addTool(name: string, tool: any): void;
|
|
502
509
|
addTransfer(...agents: SubAgentInterface[]): void;
|
|
503
|
-
addDelegate(...agents:
|
|
510
|
+
addDelegate(...agents: AllSubAgentInterface[]): void;
|
|
504
511
|
}
|
|
505
512
|
interface ExternalAgentInterface {
|
|
506
513
|
config: ExternalAgentConfig;
|
|
@@ -510,10 +517,14 @@ interface ExternalAgentInterface {
|
|
|
510
517
|
getName(): string;
|
|
511
518
|
getDescription(): string;
|
|
512
519
|
getBaseUrl(): string;
|
|
513
|
-
setContext?(tenantId: string,
|
|
520
|
+
setContext?(tenantId: string, projectId: string): void;
|
|
514
521
|
getCredentialReferenceId(): string | undefined;
|
|
515
|
-
|
|
522
|
+
getCredentialReference(): CredentialReferenceApiInsert | undefined;
|
|
516
523
|
}
|
|
524
|
+
type subAgentExternalAgentInterface = {
|
|
525
|
+
externalAgent: ExternalAgentInterface;
|
|
526
|
+
headers?: Record<string, string>;
|
|
527
|
+
};
|
|
517
528
|
interface AgentInterface {
|
|
518
529
|
init(): Promise<void>;
|
|
519
530
|
setConfig(tenantId: string, projectId: string, apiUrl: string): void;
|
|
@@ -525,8 +536,8 @@ interface AgentInterface {
|
|
|
525
536
|
stream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
526
537
|
generateStream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
527
538
|
getDefaultSubAgent(): SubAgentInterface | undefined;
|
|
528
|
-
getSubAgent(name: string):
|
|
529
|
-
getSubAgents():
|
|
539
|
+
getSubAgent(name: string): SubAgentInterface | undefined;
|
|
540
|
+
getSubAgents(): SubAgentInterface[];
|
|
530
541
|
toFullAgentDefinition(): Promise<FullAgentDefinition>;
|
|
531
542
|
}
|
|
532
543
|
interface BuilderToolConfig {
|
|
@@ -590,11 +601,6 @@ declare class Agent implements AgentInterface {
|
|
|
590
601
|
* Initialize the agent and all agents in the backend using the new agent endpoint
|
|
591
602
|
*/
|
|
592
603
|
init(): Promise<void>;
|
|
593
|
-
/**
|
|
594
|
-
* Legacy initialization method - kept for backward compatibility
|
|
595
|
-
* Initialize the agent and all agents in the backend using individual endpoints
|
|
596
|
-
*/
|
|
597
|
-
initLegacy(): Promise<void>;
|
|
598
604
|
/**
|
|
599
605
|
* Generate a response using the default agent
|
|
600
606
|
*/
|
|
@@ -614,7 +620,7 @@ declare class Agent implements AgentInterface {
|
|
|
614
620
|
/**
|
|
615
621
|
* Get an agent by name (unified method for all agent types)
|
|
616
622
|
*/
|
|
617
|
-
getSubAgent(name: string):
|
|
623
|
+
getSubAgent(name: string): SubAgentInterface | undefined;
|
|
618
624
|
/**
|
|
619
625
|
* Add an agent to the agent
|
|
620
626
|
*/
|
|
@@ -626,7 +632,7 @@ declare class Agent implements AgentInterface {
|
|
|
626
632
|
/**
|
|
627
633
|
* Get all agents in the agent
|
|
628
634
|
*/
|
|
629
|
-
getSubAgents():
|
|
635
|
+
getSubAgents(): SubAgentInterface[];
|
|
630
636
|
/**
|
|
631
637
|
* Get all agent ids (unified method for all agent types)
|
|
632
638
|
*/
|
|
@@ -716,10 +722,6 @@ declare class Agent implements AgentInterface {
|
|
|
716
722
|
* Immediately propagate agent-level models to all agents during construction
|
|
717
723
|
*/
|
|
718
724
|
private propagateImmediateModelSettings;
|
|
719
|
-
/**
|
|
720
|
-
* Type guard to check if an agent is an external AgentInterface
|
|
721
|
-
*/
|
|
722
|
-
isExternalAgent(agent: AllSubAgentInterface): agent is ExternalAgentInterface;
|
|
723
725
|
/**
|
|
724
726
|
* Execute agent using the backend system instead of local runner
|
|
725
727
|
*/
|
|
@@ -734,13 +736,8 @@ declare class Agent implements AgentInterface {
|
|
|
734
736
|
private normalizeMessages;
|
|
735
737
|
private saveToDatabase;
|
|
736
738
|
private saveRelations;
|
|
737
|
-
private
|
|
738
|
-
private
|
|
739
|
-
private createExternalAgentRelation;
|
|
740
|
-
/**
|
|
741
|
-
* Create external agents in the database
|
|
742
|
-
*/
|
|
743
|
-
private createExternalAgents;
|
|
739
|
+
private createSubAgentRelations;
|
|
740
|
+
private createSubAgentRelation;
|
|
744
741
|
}
|
|
745
742
|
|
|
746
743
|
/**
|
|
@@ -758,6 +755,7 @@ interface ProjectConfig {
|
|
|
758
755
|
stopWhen?: StopWhen;
|
|
759
756
|
agents?: () => Agent[];
|
|
760
757
|
tools?: () => Tool[];
|
|
758
|
+
externalAgents?: () => ExternalAgent[];
|
|
761
759
|
dataComponents?: () => DataComponent[];
|
|
762
760
|
artifactComponents?: () => ArtifactComponent[];
|
|
763
761
|
credentialReferences?: () => CredentialReferenceApiInsert[];
|
|
@@ -830,6 +828,8 @@ declare class Project implements ProjectInterface {
|
|
|
830
828
|
private projectTools;
|
|
831
829
|
private projectDataComponents;
|
|
832
830
|
private projectArtifactComponents;
|
|
831
|
+
private projectExternalAgents;
|
|
832
|
+
private externalAgentMap;
|
|
833
833
|
constructor(config: ProjectConfig);
|
|
834
834
|
/**
|
|
835
835
|
* Set or update the configuration (tenantId and apiUrl)
|
|
@@ -893,6 +893,22 @@ declare class Project implements ProjectInterface {
|
|
|
893
893
|
* Get all agent in the project
|
|
894
894
|
*/
|
|
895
895
|
getAgents(): Agent[];
|
|
896
|
+
/**
|
|
897
|
+
* Get all external agents in the project
|
|
898
|
+
*/
|
|
899
|
+
getExternalAgents(): ExternalAgent[];
|
|
900
|
+
/**
|
|
901
|
+
* Get an external agent by ID
|
|
902
|
+
*/
|
|
903
|
+
getExternalAgent(id: string): ExternalAgent | undefined;
|
|
904
|
+
/**
|
|
905
|
+
* Add an external agent to the project
|
|
906
|
+
*/
|
|
907
|
+
addExternalAgent(externalAgent: ExternalAgent): void;
|
|
908
|
+
/**
|
|
909
|
+
* Remove an external agent from the project
|
|
910
|
+
*/
|
|
911
|
+
removeExternalAgent(id: string): boolean;
|
|
896
912
|
/**
|
|
897
913
|
* Get an agent by ID
|
|
898
914
|
*/
|
|
@@ -1323,4 +1339,4 @@ declare const run: typeof Runner.run;
|
|
|
1323
1339
|
declare const stream: typeof Runner.stream;
|
|
1324
1340
|
declare const raceAgents: typeof Runner.raceAgents;
|
|
1325
1341
|
|
|
1326
|
-
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, StatusComponent, type StatusComponentInterface, 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, statusComponent, stream, subAgent, transfer, updateFullProjectViaAPI };
|
|
1342
|
+
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, StatusComponent, type StatusComponentInterface, 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, statusComponent, stream, subAgent, type subAgentExternalAgentInterface, transfer, updateFullProjectViaAPI };
|