@inkeep/agents-sdk 0.17.0 → 0.18.1
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/README.md +2 -2
- package/dist/index.cjs +251 -226
- package/dist/index.d.cts +45 -56
- package/dist/index.d.ts +45 -56
- package/dist/index.js +250 -225
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MCPToolConfig as MCPToolConfig$1, ArtifactComponentInsert, CredentialReferenceApiInsert, DataComponentInsert, CredentialReferenceSelect, FunctionToolConfig,
|
|
1
|
+
import { MCPToolConfig as MCPToolConfig$1, ArtifactComponentInsert, CredentialReferenceApiInsert, DataComponentInsert, CredentialReferenceSelect, FunctionToolConfig, SubAgentApiInsert, DataComponentApiInsert, ArtifactComponentApiInsert, AgentConversationHistoryConfig, GraphStopWhen, ModelSettings, StatusUpdateSettings, FullGraphDefinition, ToolInsert, McpTransportConfig, StopWhen, SandboxConfig, FullProjectDefinition } from '@inkeep/agents-core';
|
|
2
2
|
export { FunctionToolConfig, ModelSettings, SandboxConfig } from '@inkeep/agents-core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
@@ -120,7 +120,7 @@ type AgentMcpConfig = {
|
|
|
120
120
|
* );
|
|
121
121
|
* ```
|
|
122
122
|
*/
|
|
123
|
-
declare function transfer(targetAgent:
|
|
123
|
+
declare function transfer(targetAgent: SubAgent, description?: string, condition?: TransferConditionFunction): TransferConfig;
|
|
124
124
|
|
|
125
125
|
interface DataComponentInterface {
|
|
126
126
|
config: Omit<DataComponentInsert, 'tenantId' | 'projectId'>;
|
|
@@ -289,23 +289,13 @@ interface ToolResult {
|
|
|
289
289
|
result: any;
|
|
290
290
|
error?: string;
|
|
291
291
|
}
|
|
292
|
-
type
|
|
293
|
-
type
|
|
294
|
-
interface
|
|
292
|
+
type AllSubAgentInterface = SubAgentInterface | ExternalAgentInterface;
|
|
293
|
+
type SubAgentCanUseType = Tool | AgentMcpConfig | FunctionTool;
|
|
294
|
+
interface SubAgentConfig extends Omit<SubAgentApiInsert, 'projectId'> {
|
|
295
295
|
type?: 'internal';
|
|
296
|
-
canUse?: () =>
|
|
297
|
-
canTransferTo?: () =>
|
|
298
|
-
canDelegateTo?: () =>
|
|
299
|
-
models?: {
|
|
300
|
-
base?: ModelSettings;
|
|
301
|
-
structuredOutput?: ModelSettings;
|
|
302
|
-
summarizer?: ModelSettings;
|
|
303
|
-
};
|
|
304
|
-
stopWhen?: AgentStopWhen;
|
|
305
|
-
memory?: {
|
|
306
|
-
type: 'conversation' | 'episodic' | 'short_term';
|
|
307
|
-
capacity?: number;
|
|
308
|
-
};
|
|
296
|
+
canUse?: () => SubAgentCanUseType[];
|
|
297
|
+
canTransferTo?: () => SubAgentInterface[];
|
|
298
|
+
canDelegateTo?: () => AllSubAgentInterface[];
|
|
309
299
|
dataComponents?: () => (DataComponentApiInsert | DataComponentInterface | DataComponentWithZodProps)[];
|
|
310
300
|
artifactComponents?: () => (ArtifactComponentApiInsert | ArtifactComponentInterface | ArtifactComponentWithZodProps)[];
|
|
311
301
|
conversationHistoryConfig?: AgentConversationHistoryConfig;
|
|
@@ -360,7 +350,7 @@ interface RequestSchemaConfig {
|
|
|
360
350
|
optional?: ('body' | 'headers' | 'query' | 'params')[];
|
|
361
351
|
}
|
|
362
352
|
interface TransferConfig {
|
|
363
|
-
agent:
|
|
353
|
+
agent: SubAgentInterface;
|
|
364
354
|
description?: string;
|
|
365
355
|
condition?: (context: any) => boolean;
|
|
366
356
|
}
|
|
@@ -398,7 +388,7 @@ interface StreamEvent {
|
|
|
398
388
|
}
|
|
399
389
|
interface RunResult {
|
|
400
390
|
finalOutput: string;
|
|
401
|
-
agent:
|
|
391
|
+
agent: SubAgentInterface;
|
|
402
392
|
turnCount: number;
|
|
403
393
|
usage?: {
|
|
404
394
|
inputTokens: number;
|
|
@@ -414,8 +404,8 @@ interface GraphConfig {
|
|
|
414
404
|
id: string;
|
|
415
405
|
name?: string;
|
|
416
406
|
description?: string;
|
|
417
|
-
|
|
418
|
-
|
|
407
|
+
defaultSubAgent?: SubAgentInterface;
|
|
408
|
+
subAgents?: () => AllSubAgentInterface[];
|
|
419
409
|
contextConfig?: any;
|
|
420
410
|
credentials?: () => CredentialReferenceApiInsert[];
|
|
421
411
|
stopWhen?: GraphStopWhen;
|
|
@@ -441,8 +431,8 @@ declare class ToolExecutionError extends AgentError {
|
|
|
441
431
|
declare class TransferError extends AgentError {
|
|
442
432
|
constructor(sourceAgent: string, targetAgent: string, reason: string);
|
|
443
433
|
}
|
|
444
|
-
interface
|
|
445
|
-
config:
|
|
434
|
+
interface SubAgentInterface {
|
|
435
|
+
config: SubAgentConfig;
|
|
446
436
|
type: 'internal';
|
|
447
437
|
init(): Promise<void>;
|
|
448
438
|
getId(): string;
|
|
@@ -450,14 +440,14 @@ interface AgentInterface {
|
|
|
450
440
|
getDescription(): string;
|
|
451
441
|
getInstructions(): string;
|
|
452
442
|
getTools(): Record<string, AgentTool>;
|
|
453
|
-
getTransfers():
|
|
454
|
-
getDelegates():
|
|
443
|
+
getTransfers(): SubAgentInterface[];
|
|
444
|
+
getDelegates(): AllSubAgentInterface[];
|
|
455
445
|
getDataComponents(): DataComponentApiInsert[];
|
|
456
446
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
457
447
|
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
458
448
|
addTool(name: string, tool: any): void;
|
|
459
|
-
addTransfer(...agents:
|
|
460
|
-
addDelegate(...agents:
|
|
449
|
+
addTransfer(...agents: SubAgentInterface[]): void;
|
|
450
|
+
addDelegate(...agents: SubAgentInterface[]): void;
|
|
461
451
|
}
|
|
462
452
|
interface ExternalAgentInterface {
|
|
463
453
|
config: ExternalAgentConfig;
|
|
@@ -481,9 +471,9 @@ interface GraphInterface {
|
|
|
481
471
|
generate(input: MessageInput, options?: GenerateOptions): Promise<string>;
|
|
482
472
|
stream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
483
473
|
generateStream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
484
|
-
|
|
485
|
-
getAgent(name: string):
|
|
486
|
-
|
|
474
|
+
getdefaultSubAgent(): SubAgentInterface | undefined;
|
|
475
|
+
getAgent(name: string): AllSubAgentInterface | undefined;
|
|
476
|
+
getSubAgents(): AllSubAgentInterface[];
|
|
487
477
|
toFullGraphDefinition(): Promise<FullGraphDefinition>;
|
|
488
478
|
}
|
|
489
479
|
interface BuilderToolConfig {
|
|
@@ -511,16 +501,15 @@ interface BuilderAgentConfig {
|
|
|
511
501
|
relations?: BuilderRelationConfig[];
|
|
512
502
|
}
|
|
513
503
|
|
|
514
|
-
declare class
|
|
515
|
-
config:
|
|
504
|
+
declare class SubAgent implements SubAgentInterface {
|
|
505
|
+
config: SubAgentConfig;
|
|
516
506
|
readonly type: "internal";
|
|
517
507
|
private baseURL;
|
|
518
508
|
private tenantId;
|
|
519
509
|
private projectId;
|
|
520
|
-
private graphId;
|
|
521
510
|
private initialized;
|
|
522
|
-
constructor(config:
|
|
523
|
-
setContext(tenantId: string, projectId: string,
|
|
511
|
+
constructor(config: SubAgentConfig);
|
|
512
|
+
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
524
513
|
getId(): string;
|
|
525
514
|
getName(): string;
|
|
526
515
|
getInstructions(): string;
|
|
@@ -531,13 +520,13 @@ declare class Agent implements AgentInterface {
|
|
|
531
520
|
getTools(): Record<string, AgentTool>;
|
|
532
521
|
getModels(): typeof this$1.config.models;
|
|
533
522
|
setModels(models: typeof this$1.config.models): void;
|
|
534
|
-
getTransfers():
|
|
535
|
-
getDelegates():
|
|
523
|
+
getTransfers(): SubAgentInterface[];
|
|
524
|
+
getDelegates(): AllSubAgentInterface[];
|
|
536
525
|
getDataComponents(): DataComponentApiInsert[];
|
|
537
526
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
538
527
|
addTool(_name: string, tool: Tool): void;
|
|
539
|
-
addTransfer(...agents:
|
|
540
|
-
addDelegate(...agents:
|
|
528
|
+
addTransfer(...agents: SubAgentInterface[]): void;
|
|
529
|
+
addDelegate(...agents: AllSubAgentInterface[]): void;
|
|
541
530
|
init(): Promise<void>;
|
|
542
531
|
private upsertAgent;
|
|
543
532
|
private saveToolsAndRelations;
|
|
@@ -555,9 +544,9 @@ declare class Agent implements AgentInterface {
|
|
|
555
544
|
}
|
|
556
545
|
|
|
557
546
|
declare class AgentGraph implements GraphInterface {
|
|
558
|
-
private
|
|
547
|
+
private subAgents;
|
|
559
548
|
private agentMap;
|
|
560
|
-
private
|
|
549
|
+
private defaultSubAgent?;
|
|
561
550
|
private baseURL;
|
|
562
551
|
private tenantId;
|
|
563
552
|
private projectId;
|
|
@@ -610,35 +599,35 @@ declare class AgentGraph implements GraphInterface {
|
|
|
610
599
|
/**
|
|
611
600
|
* Run with a specific agent from the graph
|
|
612
601
|
*/
|
|
613
|
-
runWith(
|
|
602
|
+
runWith(subAgentId: string, input: MessageInput, options?: GenerateOptions): Promise<RunResult>;
|
|
614
603
|
/**
|
|
615
604
|
* Get an agent by name (unified method for all agent types)
|
|
616
605
|
*/
|
|
617
|
-
getAgent(name: string):
|
|
606
|
+
getAgent(name: string): AllSubAgentInterface | undefined;
|
|
618
607
|
/**
|
|
619
608
|
* Add an agent to the graph
|
|
620
609
|
*/
|
|
621
|
-
|
|
610
|
+
addSubAgent(agent: SubAgentInterface): void;
|
|
622
611
|
/**
|
|
623
612
|
* Remove an agent from the graph
|
|
624
613
|
*/
|
|
625
|
-
|
|
614
|
+
removeSubAgent(id: string): boolean;
|
|
626
615
|
/**
|
|
627
616
|
* Get all agents in the graph
|
|
628
617
|
*/
|
|
629
|
-
|
|
618
|
+
getSubAgents(): AllSubAgentInterface[];
|
|
630
619
|
/**
|
|
631
620
|
* Get all agent ids (unified method for all agent types)
|
|
632
621
|
*/
|
|
633
|
-
|
|
622
|
+
getSubAgentIds(): string[];
|
|
634
623
|
/**
|
|
635
624
|
* Set the default agent
|
|
636
625
|
*/
|
|
637
|
-
|
|
626
|
+
setdefaultSubAgent(agent: SubAgentInterface): void;
|
|
638
627
|
/**
|
|
639
628
|
* Get the default agent
|
|
640
629
|
*/
|
|
641
|
-
|
|
630
|
+
getdefaultSubAgent(): SubAgentInterface | undefined;
|
|
642
631
|
/**
|
|
643
632
|
* Get the graph ID
|
|
644
633
|
*/
|
|
@@ -675,7 +664,7 @@ declare class AgentGraph implements GraphInterface {
|
|
|
675
664
|
*/
|
|
676
665
|
getStats(): {
|
|
677
666
|
agentCount: number;
|
|
678
|
-
|
|
667
|
+
defaultSubAgent: string | null;
|
|
679
668
|
initialized: boolean;
|
|
680
669
|
graphId: string;
|
|
681
670
|
tenantId: string;
|
|
@@ -691,7 +680,7 @@ declare class AgentGraph implements GraphInterface {
|
|
|
691
680
|
/**
|
|
692
681
|
* Type guard to check if an agent is an internal AgentInterface
|
|
693
682
|
*/
|
|
694
|
-
isInternalAgent(agent:
|
|
683
|
+
isInternalAgent(agent: AllSubAgentInterface): agent is SubAgentInterface;
|
|
695
684
|
/**
|
|
696
685
|
* Get project-level model settingsuration defaults
|
|
697
686
|
*/
|
|
@@ -719,7 +708,7 @@ declare class AgentGraph implements GraphInterface {
|
|
|
719
708
|
/**
|
|
720
709
|
* Type guard to check if an agent is an external AgentInterface
|
|
721
710
|
*/
|
|
722
|
-
isExternalAgent(agent:
|
|
711
|
+
isExternalAgent(agent: AllSubAgentInterface): agent is ExternalAgentInterface;
|
|
723
712
|
/**
|
|
724
713
|
* Execute agent using the backend system instead of local runner
|
|
725
714
|
*/
|
|
@@ -985,7 +974,7 @@ declare function project(config: ProjectConfig): Project;
|
|
|
985
974
|
* });
|
|
986
975
|
* ```
|
|
987
976
|
*/
|
|
988
|
-
declare function
|
|
977
|
+
declare function subAgent(config: SubAgentConfig): SubAgent;
|
|
989
978
|
/**
|
|
990
979
|
* Creates a credential reference for authentication.
|
|
991
980
|
*
|
|
@@ -1275,11 +1264,11 @@ declare class Runner {
|
|
|
1275
1264
|
estimatedTurns: number;
|
|
1276
1265
|
estimatedTokens: number;
|
|
1277
1266
|
agentCount: number;
|
|
1278
|
-
|
|
1267
|
+
defaultSubAgent: string | undefined;
|
|
1279
1268
|
}>;
|
|
1280
1269
|
}
|
|
1281
1270
|
declare const run: typeof Runner.run;
|
|
1282
1271
|
declare const stream: typeof Runner.stream;
|
|
1283
1272
|
declare const raceGraphs: typeof Runner.raceGraphs;
|
|
1284
1273
|
|
|
1285
|
-
export {
|
|
1274
|
+
export { SubAgent as Agent, AgentError, 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 GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, Project, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StreamEvent, type StreamResponse, 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, subAgent as agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, createFullProjectViaAPI, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, functionTool, getFullProjectViaAPI, isCredentialReference, mcpServer, mcpTool, project, raceGraphs, registerEnvironmentSettings, run, stream, transfer, updateFullProjectViaAPI };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MCPToolConfig as MCPToolConfig$1, ArtifactComponentInsert, CredentialReferenceApiInsert, DataComponentInsert, CredentialReferenceSelect, FunctionToolConfig,
|
|
1
|
+
import { MCPToolConfig as MCPToolConfig$1, ArtifactComponentInsert, CredentialReferenceApiInsert, DataComponentInsert, CredentialReferenceSelect, FunctionToolConfig, SubAgentApiInsert, DataComponentApiInsert, ArtifactComponentApiInsert, AgentConversationHistoryConfig, GraphStopWhen, ModelSettings, StatusUpdateSettings, FullGraphDefinition, ToolInsert, McpTransportConfig, StopWhen, SandboxConfig, FullProjectDefinition } from '@inkeep/agents-core';
|
|
2
2
|
export { FunctionToolConfig, ModelSettings, SandboxConfig } from '@inkeep/agents-core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
@@ -120,7 +120,7 @@ type AgentMcpConfig = {
|
|
|
120
120
|
* );
|
|
121
121
|
* ```
|
|
122
122
|
*/
|
|
123
|
-
declare function transfer(targetAgent:
|
|
123
|
+
declare function transfer(targetAgent: SubAgent, description?: string, condition?: TransferConditionFunction): TransferConfig;
|
|
124
124
|
|
|
125
125
|
interface DataComponentInterface {
|
|
126
126
|
config: Omit<DataComponentInsert, 'tenantId' | 'projectId'>;
|
|
@@ -289,23 +289,13 @@ interface ToolResult {
|
|
|
289
289
|
result: any;
|
|
290
290
|
error?: string;
|
|
291
291
|
}
|
|
292
|
-
type
|
|
293
|
-
type
|
|
294
|
-
interface
|
|
292
|
+
type AllSubAgentInterface = SubAgentInterface | ExternalAgentInterface;
|
|
293
|
+
type SubAgentCanUseType = Tool | AgentMcpConfig | FunctionTool;
|
|
294
|
+
interface SubAgentConfig extends Omit<SubAgentApiInsert, 'projectId'> {
|
|
295
295
|
type?: 'internal';
|
|
296
|
-
canUse?: () =>
|
|
297
|
-
canTransferTo?: () =>
|
|
298
|
-
canDelegateTo?: () =>
|
|
299
|
-
models?: {
|
|
300
|
-
base?: ModelSettings;
|
|
301
|
-
structuredOutput?: ModelSettings;
|
|
302
|
-
summarizer?: ModelSettings;
|
|
303
|
-
};
|
|
304
|
-
stopWhen?: AgentStopWhen;
|
|
305
|
-
memory?: {
|
|
306
|
-
type: 'conversation' | 'episodic' | 'short_term';
|
|
307
|
-
capacity?: number;
|
|
308
|
-
};
|
|
296
|
+
canUse?: () => SubAgentCanUseType[];
|
|
297
|
+
canTransferTo?: () => SubAgentInterface[];
|
|
298
|
+
canDelegateTo?: () => AllSubAgentInterface[];
|
|
309
299
|
dataComponents?: () => (DataComponentApiInsert | DataComponentInterface | DataComponentWithZodProps)[];
|
|
310
300
|
artifactComponents?: () => (ArtifactComponentApiInsert | ArtifactComponentInterface | ArtifactComponentWithZodProps)[];
|
|
311
301
|
conversationHistoryConfig?: AgentConversationHistoryConfig;
|
|
@@ -360,7 +350,7 @@ interface RequestSchemaConfig {
|
|
|
360
350
|
optional?: ('body' | 'headers' | 'query' | 'params')[];
|
|
361
351
|
}
|
|
362
352
|
interface TransferConfig {
|
|
363
|
-
agent:
|
|
353
|
+
agent: SubAgentInterface;
|
|
364
354
|
description?: string;
|
|
365
355
|
condition?: (context: any) => boolean;
|
|
366
356
|
}
|
|
@@ -398,7 +388,7 @@ interface StreamEvent {
|
|
|
398
388
|
}
|
|
399
389
|
interface RunResult {
|
|
400
390
|
finalOutput: string;
|
|
401
|
-
agent:
|
|
391
|
+
agent: SubAgentInterface;
|
|
402
392
|
turnCount: number;
|
|
403
393
|
usage?: {
|
|
404
394
|
inputTokens: number;
|
|
@@ -414,8 +404,8 @@ interface GraphConfig {
|
|
|
414
404
|
id: string;
|
|
415
405
|
name?: string;
|
|
416
406
|
description?: string;
|
|
417
|
-
|
|
418
|
-
|
|
407
|
+
defaultSubAgent?: SubAgentInterface;
|
|
408
|
+
subAgents?: () => AllSubAgentInterface[];
|
|
419
409
|
contextConfig?: any;
|
|
420
410
|
credentials?: () => CredentialReferenceApiInsert[];
|
|
421
411
|
stopWhen?: GraphStopWhen;
|
|
@@ -441,8 +431,8 @@ declare class ToolExecutionError extends AgentError {
|
|
|
441
431
|
declare class TransferError extends AgentError {
|
|
442
432
|
constructor(sourceAgent: string, targetAgent: string, reason: string);
|
|
443
433
|
}
|
|
444
|
-
interface
|
|
445
|
-
config:
|
|
434
|
+
interface SubAgentInterface {
|
|
435
|
+
config: SubAgentConfig;
|
|
446
436
|
type: 'internal';
|
|
447
437
|
init(): Promise<void>;
|
|
448
438
|
getId(): string;
|
|
@@ -450,14 +440,14 @@ interface AgentInterface {
|
|
|
450
440
|
getDescription(): string;
|
|
451
441
|
getInstructions(): string;
|
|
452
442
|
getTools(): Record<string, AgentTool>;
|
|
453
|
-
getTransfers():
|
|
454
|
-
getDelegates():
|
|
443
|
+
getTransfers(): SubAgentInterface[];
|
|
444
|
+
getDelegates(): AllSubAgentInterface[];
|
|
455
445
|
getDataComponents(): DataComponentApiInsert[];
|
|
456
446
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
457
447
|
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
458
448
|
addTool(name: string, tool: any): void;
|
|
459
|
-
addTransfer(...agents:
|
|
460
|
-
addDelegate(...agents:
|
|
449
|
+
addTransfer(...agents: SubAgentInterface[]): void;
|
|
450
|
+
addDelegate(...agents: SubAgentInterface[]): void;
|
|
461
451
|
}
|
|
462
452
|
interface ExternalAgentInterface {
|
|
463
453
|
config: ExternalAgentConfig;
|
|
@@ -481,9 +471,9 @@ interface GraphInterface {
|
|
|
481
471
|
generate(input: MessageInput, options?: GenerateOptions): Promise<string>;
|
|
482
472
|
stream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
483
473
|
generateStream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
484
|
-
|
|
485
|
-
getAgent(name: string):
|
|
486
|
-
|
|
474
|
+
getdefaultSubAgent(): SubAgentInterface | undefined;
|
|
475
|
+
getAgent(name: string): AllSubAgentInterface | undefined;
|
|
476
|
+
getSubAgents(): AllSubAgentInterface[];
|
|
487
477
|
toFullGraphDefinition(): Promise<FullGraphDefinition>;
|
|
488
478
|
}
|
|
489
479
|
interface BuilderToolConfig {
|
|
@@ -511,16 +501,15 @@ interface BuilderAgentConfig {
|
|
|
511
501
|
relations?: BuilderRelationConfig[];
|
|
512
502
|
}
|
|
513
503
|
|
|
514
|
-
declare class
|
|
515
|
-
config:
|
|
504
|
+
declare class SubAgent implements SubAgentInterface {
|
|
505
|
+
config: SubAgentConfig;
|
|
516
506
|
readonly type: "internal";
|
|
517
507
|
private baseURL;
|
|
518
508
|
private tenantId;
|
|
519
509
|
private projectId;
|
|
520
|
-
private graphId;
|
|
521
510
|
private initialized;
|
|
522
|
-
constructor(config:
|
|
523
|
-
setContext(tenantId: string, projectId: string,
|
|
511
|
+
constructor(config: SubAgentConfig);
|
|
512
|
+
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
524
513
|
getId(): string;
|
|
525
514
|
getName(): string;
|
|
526
515
|
getInstructions(): string;
|
|
@@ -531,13 +520,13 @@ declare class Agent implements AgentInterface {
|
|
|
531
520
|
getTools(): Record<string, AgentTool>;
|
|
532
521
|
getModels(): typeof this$1.config.models;
|
|
533
522
|
setModels(models: typeof this$1.config.models): void;
|
|
534
|
-
getTransfers():
|
|
535
|
-
getDelegates():
|
|
523
|
+
getTransfers(): SubAgentInterface[];
|
|
524
|
+
getDelegates(): AllSubAgentInterface[];
|
|
536
525
|
getDataComponents(): DataComponentApiInsert[];
|
|
537
526
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
538
527
|
addTool(_name: string, tool: Tool): void;
|
|
539
|
-
addTransfer(...agents:
|
|
540
|
-
addDelegate(...agents:
|
|
528
|
+
addTransfer(...agents: SubAgentInterface[]): void;
|
|
529
|
+
addDelegate(...agents: AllSubAgentInterface[]): void;
|
|
541
530
|
init(): Promise<void>;
|
|
542
531
|
private upsertAgent;
|
|
543
532
|
private saveToolsAndRelations;
|
|
@@ -555,9 +544,9 @@ declare class Agent implements AgentInterface {
|
|
|
555
544
|
}
|
|
556
545
|
|
|
557
546
|
declare class AgentGraph implements GraphInterface {
|
|
558
|
-
private
|
|
547
|
+
private subAgents;
|
|
559
548
|
private agentMap;
|
|
560
|
-
private
|
|
549
|
+
private defaultSubAgent?;
|
|
561
550
|
private baseURL;
|
|
562
551
|
private tenantId;
|
|
563
552
|
private projectId;
|
|
@@ -610,35 +599,35 @@ declare class AgentGraph implements GraphInterface {
|
|
|
610
599
|
/**
|
|
611
600
|
* Run with a specific agent from the graph
|
|
612
601
|
*/
|
|
613
|
-
runWith(
|
|
602
|
+
runWith(subAgentId: string, input: MessageInput, options?: GenerateOptions): Promise<RunResult>;
|
|
614
603
|
/**
|
|
615
604
|
* Get an agent by name (unified method for all agent types)
|
|
616
605
|
*/
|
|
617
|
-
getAgent(name: string):
|
|
606
|
+
getAgent(name: string): AllSubAgentInterface | undefined;
|
|
618
607
|
/**
|
|
619
608
|
* Add an agent to the graph
|
|
620
609
|
*/
|
|
621
|
-
|
|
610
|
+
addSubAgent(agent: SubAgentInterface): void;
|
|
622
611
|
/**
|
|
623
612
|
* Remove an agent from the graph
|
|
624
613
|
*/
|
|
625
|
-
|
|
614
|
+
removeSubAgent(id: string): boolean;
|
|
626
615
|
/**
|
|
627
616
|
* Get all agents in the graph
|
|
628
617
|
*/
|
|
629
|
-
|
|
618
|
+
getSubAgents(): AllSubAgentInterface[];
|
|
630
619
|
/**
|
|
631
620
|
* Get all agent ids (unified method for all agent types)
|
|
632
621
|
*/
|
|
633
|
-
|
|
622
|
+
getSubAgentIds(): string[];
|
|
634
623
|
/**
|
|
635
624
|
* Set the default agent
|
|
636
625
|
*/
|
|
637
|
-
|
|
626
|
+
setdefaultSubAgent(agent: SubAgentInterface): void;
|
|
638
627
|
/**
|
|
639
628
|
* Get the default agent
|
|
640
629
|
*/
|
|
641
|
-
|
|
630
|
+
getdefaultSubAgent(): SubAgentInterface | undefined;
|
|
642
631
|
/**
|
|
643
632
|
* Get the graph ID
|
|
644
633
|
*/
|
|
@@ -675,7 +664,7 @@ declare class AgentGraph implements GraphInterface {
|
|
|
675
664
|
*/
|
|
676
665
|
getStats(): {
|
|
677
666
|
agentCount: number;
|
|
678
|
-
|
|
667
|
+
defaultSubAgent: string | null;
|
|
679
668
|
initialized: boolean;
|
|
680
669
|
graphId: string;
|
|
681
670
|
tenantId: string;
|
|
@@ -691,7 +680,7 @@ declare class AgentGraph implements GraphInterface {
|
|
|
691
680
|
/**
|
|
692
681
|
* Type guard to check if an agent is an internal AgentInterface
|
|
693
682
|
*/
|
|
694
|
-
isInternalAgent(agent:
|
|
683
|
+
isInternalAgent(agent: AllSubAgentInterface): agent is SubAgentInterface;
|
|
695
684
|
/**
|
|
696
685
|
* Get project-level model settingsuration defaults
|
|
697
686
|
*/
|
|
@@ -719,7 +708,7 @@ declare class AgentGraph implements GraphInterface {
|
|
|
719
708
|
/**
|
|
720
709
|
* Type guard to check if an agent is an external AgentInterface
|
|
721
710
|
*/
|
|
722
|
-
isExternalAgent(agent:
|
|
711
|
+
isExternalAgent(agent: AllSubAgentInterface): agent is ExternalAgentInterface;
|
|
723
712
|
/**
|
|
724
713
|
* Execute agent using the backend system instead of local runner
|
|
725
714
|
*/
|
|
@@ -985,7 +974,7 @@ declare function project(config: ProjectConfig): Project;
|
|
|
985
974
|
* });
|
|
986
975
|
* ```
|
|
987
976
|
*/
|
|
988
|
-
declare function
|
|
977
|
+
declare function subAgent(config: SubAgentConfig): SubAgent;
|
|
989
978
|
/**
|
|
990
979
|
* Creates a credential reference for authentication.
|
|
991
980
|
*
|
|
@@ -1275,11 +1264,11 @@ declare class Runner {
|
|
|
1275
1264
|
estimatedTurns: number;
|
|
1276
1265
|
estimatedTokens: number;
|
|
1277
1266
|
agentCount: number;
|
|
1278
|
-
|
|
1267
|
+
defaultSubAgent: string | undefined;
|
|
1279
1268
|
}>;
|
|
1280
1269
|
}
|
|
1281
1270
|
declare const run: typeof Runner.run;
|
|
1282
1271
|
declare const stream: typeof Runner.stream;
|
|
1283
1272
|
declare const raceGraphs: typeof Runner.raceGraphs;
|
|
1284
1273
|
|
|
1285
|
-
export {
|
|
1274
|
+
export { SubAgent as Agent, AgentError, 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 GraphConfig, type GraphInterface, type MCPToolConfig, MaxTurnsExceededError, type Message, type MessageInput, Project, type RequestSchemaConfig, type RequestSchemaDefinition, type RunResult, Runner, type ServerConfig, type StreamEvent, type StreamResponse, 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, subAgent as agent, agentGraph, agentMcp, artifactComponent, createEnvironmentSettings, createFullProjectViaAPI, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, functionTool, getFullProjectViaAPI, isCredentialReference, mcpServer, mcpTool, project, raceGraphs, registerEnvironmentSettings, run, stream, transfer, updateFullProjectViaAPI };
|