@inkeep/agents-sdk 0.0.0-dev-20251022020737 → 0.0.0-dev-20251022190909
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 +48 -4
- package/dist/index.d.cts +25 -10
- package/dist/index.d.ts +25 -10
- package/dist/index.js +48 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -514,7 +514,12 @@ var Agent = class {
|
|
|
514
514
|
this.subAgents = resolveGetter(config.subAgents) || [];
|
|
515
515
|
this.agentMap = new Map(this.subAgents.map((agent2) => [agent2.getId(), agent2]));
|
|
516
516
|
if (this.defaultSubAgent) {
|
|
517
|
-
this.subAgents.
|
|
517
|
+
const isAlreadyPresent = this.subAgents.some(
|
|
518
|
+
(agent2) => agent2.getId() === this.defaultSubAgent?.getId()
|
|
519
|
+
);
|
|
520
|
+
if (!isAlreadyPresent) {
|
|
521
|
+
this.subAgents.push(this.defaultSubAgent);
|
|
522
|
+
}
|
|
518
523
|
this.agentMap.set(this.defaultSubAgent.getId(), this.defaultSubAgent);
|
|
519
524
|
}
|
|
520
525
|
if (this.models) {
|
|
@@ -655,9 +660,10 @@ var Agent = class {
|
|
|
655
660
|
externalAgentId: d.externalAgent.getId(),
|
|
656
661
|
...d.headers && { headers: d.headers }
|
|
657
662
|
};
|
|
658
|
-
} else if (typeof d === "object" && "
|
|
663
|
+
} else if (typeof d === "object" && "agent" in d) {
|
|
659
664
|
return {
|
|
660
|
-
|
|
665
|
+
agentId: d.agent.getId(),
|
|
666
|
+
...d.headers && { headers: d.headers }
|
|
661
667
|
};
|
|
662
668
|
}
|
|
663
669
|
return d.getId();
|
|
@@ -1037,6 +1043,12 @@ var Agent = class {
|
|
|
1037
1043
|
tenantId: this.tenantId
|
|
1038
1044
|
};
|
|
1039
1045
|
}
|
|
1046
|
+
with(options) {
|
|
1047
|
+
return {
|
|
1048
|
+
agent: this,
|
|
1049
|
+
headers: options.headers
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1040
1052
|
/**
|
|
1041
1053
|
* Validate the agent configuration
|
|
1042
1054
|
*/
|
|
@@ -2871,6 +2883,12 @@ var SubAgent = class {
|
|
|
2871
2883
|
if (typeof delegate === "object" && "externalAgent" in delegate) {
|
|
2872
2884
|
return false;
|
|
2873
2885
|
}
|
|
2886
|
+
if (typeof delegate === "object" && "agent" in delegate) {
|
|
2887
|
+
return false;
|
|
2888
|
+
}
|
|
2889
|
+
if (typeof delegate === "object" && "toFullAgentDefinition" in delegate) {
|
|
2890
|
+
return false;
|
|
2891
|
+
}
|
|
2874
2892
|
if (typeof delegate === "object" && "type" in delegate && delegate.type === "external") {
|
|
2875
2893
|
return false;
|
|
2876
2894
|
}
|
|
@@ -2899,8 +2917,34 @@ var SubAgent = class {
|
|
|
2899
2917
|
};
|
|
2900
2918
|
});
|
|
2901
2919
|
}
|
|
2920
|
+
getTeamAgentDelegates() {
|
|
2921
|
+
if (typeof this.config.canDelegateTo !== "function") {
|
|
2922
|
+
return [];
|
|
2923
|
+
}
|
|
2924
|
+
return this.config.canDelegateTo().filter((delegate) => {
|
|
2925
|
+
if (typeof delegate === "object" && "agent" in delegate) {
|
|
2926
|
+
return true;
|
|
2927
|
+
}
|
|
2928
|
+
if (typeof delegate === "object" && "toFullAgentDefinition" in delegate) {
|
|
2929
|
+
return true;
|
|
2930
|
+
}
|
|
2931
|
+
return false;
|
|
2932
|
+
}).map((delegate) => {
|
|
2933
|
+
if ("agent" in delegate) {
|
|
2934
|
+
return delegate;
|
|
2935
|
+
}
|
|
2936
|
+
return {
|
|
2937
|
+
agent: delegate,
|
|
2938
|
+
headers: void 0
|
|
2939
|
+
};
|
|
2940
|
+
});
|
|
2941
|
+
}
|
|
2902
2942
|
getDelegates() {
|
|
2903
|
-
return
|
|
2943
|
+
return [
|
|
2944
|
+
...this.getSubAgentDelegates(),
|
|
2945
|
+
...this.getTeamAgentDelegates(),
|
|
2946
|
+
...this.getExternalAgentDelegates()
|
|
2947
|
+
];
|
|
2904
2948
|
}
|
|
2905
2949
|
getDataComponents() {
|
|
2906
2950
|
const components = resolveGetter2(this.config.dataComponents) || [];
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArtifactComponentInsert, MCPToolConfig as MCPToolConfig$1, DataComponentApiInsert, ArtifactComponentApiInsert, CredentialReferenceApiInsert, DataComponentInsert, FunctionToolConfig, SubAgentApiInsert, AgentConversationHistoryConfig, AgentStopWhen, ModelSettings, StatusUpdateSettings,
|
|
1
|
+
import { ArtifactComponentInsert, MCPToolConfig as MCPToolConfig$1, DataComponentApiInsert, ArtifactComponentApiInsert, CredentialReferenceApiInsert, DataComponentInsert, FunctionToolConfig, SubAgentApiInsert, FullAgentDefinition, AgentConversationHistoryConfig, AgentStopWhen, ModelSettings, StatusUpdateSettings, 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
|
|
|
@@ -83,12 +83,13 @@ declare class SubAgent implements SubAgentInterface {
|
|
|
83
83
|
getTransfers(): SubAgentInterface[];
|
|
84
84
|
getSubAgentDelegates(): SubAgentInterface[];
|
|
85
85
|
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
86
|
-
|
|
86
|
+
getTeamAgentDelegates(): subAgentTeamAgentInterface[];
|
|
87
|
+
getDelegates(): AllDelegateOutputInterface[];
|
|
87
88
|
getDataComponents(): DataComponentApiInsert[];
|
|
88
89
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
89
90
|
addTool(_name: string, tool: Tool): void;
|
|
90
91
|
addTransfer(...agents: SubAgentInterface[]): void;
|
|
91
|
-
addDelegate(...agents:
|
|
92
|
+
addDelegate(...agents: AllDelegateInputInterface[]): void;
|
|
92
93
|
init(): Promise<void>;
|
|
93
94
|
private upsertAgent;
|
|
94
95
|
private saveToolsAndRelations;
|
|
@@ -347,13 +348,14 @@ interface ToolResult {
|
|
|
347
348
|
result: any;
|
|
348
349
|
error?: string;
|
|
349
350
|
}
|
|
350
|
-
type
|
|
351
|
+
type AllDelegateInputInterface = SubAgentInterface | subAgentExternalAgentInterface | ExternalAgentInterface | AgentInterface | subAgentTeamAgentInterface;
|
|
352
|
+
type AllDelegateOutputInterface = SubAgentInterface | subAgentExternalAgentInterface | subAgentTeamAgentInterface;
|
|
351
353
|
type SubAgentCanUseType = Tool | AgentMcpConfig | FunctionTool;
|
|
352
354
|
interface SubAgentConfig extends Omit<SubAgentApiInsert, 'projectId'> {
|
|
353
355
|
type?: 'internal';
|
|
354
356
|
canUse?: () => SubAgentCanUseType[];
|
|
355
357
|
canTransferTo?: () => SubAgentInterface[];
|
|
356
|
-
canDelegateTo?: () =>
|
|
358
|
+
canDelegateTo?: () => AllDelegateInputInterface[];
|
|
357
359
|
dataComponents?: () => (DataComponentApiInsert | DataComponentInterface | DataComponentWithZodProps)[];
|
|
358
360
|
artifactComponents?: () => (ArtifactComponentApiInsert | ArtifactComponentInterface | ArtifactComponentWithZodProps)[];
|
|
359
361
|
conversationHistoryConfig?: AgentConversationHistoryConfig;
|
|
@@ -462,7 +464,7 @@ interface AgentConfig {
|
|
|
462
464
|
id: string;
|
|
463
465
|
name?: string;
|
|
464
466
|
description?: string;
|
|
465
|
-
defaultSubAgent
|
|
467
|
+
defaultSubAgent: SubAgentInterface;
|
|
466
468
|
subAgents?: () => SubAgentInterface[];
|
|
467
469
|
contextConfig?: any;
|
|
468
470
|
credentials?: () => CredentialReferenceApiInsert[];
|
|
@@ -499,7 +501,7 @@ interface SubAgentInterface {
|
|
|
499
501
|
getInstructions(): string;
|
|
500
502
|
getTools(): Record<string, AgentTool>;
|
|
501
503
|
getTransfers(): SubAgentInterface[];
|
|
502
|
-
getDelegates():
|
|
504
|
+
getDelegates(): AllDelegateOutputInterface[];
|
|
503
505
|
getSubAgentDelegates(): SubAgentInterface[];
|
|
504
506
|
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
505
507
|
getDataComponents(): DataComponentApiInsert[];
|
|
@@ -507,7 +509,7 @@ interface SubAgentInterface {
|
|
|
507
509
|
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
508
510
|
addTool(name: string, tool: any): void;
|
|
509
511
|
addTransfer(...agents: SubAgentInterface[]): void;
|
|
510
|
-
addDelegate(...agents:
|
|
512
|
+
addDelegate(...agents: AllDelegateInputInterface[]): void;
|
|
511
513
|
}
|
|
512
514
|
interface ExternalAgentInterface {
|
|
513
515
|
config: ExternalAgentConfig;
|
|
@@ -518,6 +520,9 @@ interface ExternalAgentInterface {
|
|
|
518
520
|
getDescription(): string;
|
|
519
521
|
getBaseUrl(): string;
|
|
520
522
|
setContext?(tenantId: string, projectId: string): void;
|
|
523
|
+
with(options: {
|
|
524
|
+
headers?: Record<string, string>;
|
|
525
|
+
}): subAgentExternalAgentInterface;
|
|
521
526
|
getCredentialReferenceId(): string | undefined;
|
|
522
527
|
getCredentialReference(): CredentialReferenceApiInsert | undefined;
|
|
523
528
|
}
|
|
@@ -525,6 +530,10 @@ type subAgentExternalAgentInterface = {
|
|
|
525
530
|
externalAgent: ExternalAgentInterface;
|
|
526
531
|
headers?: Record<string, string>;
|
|
527
532
|
};
|
|
533
|
+
type subAgentTeamAgentInterface = {
|
|
534
|
+
agent: AgentInterface;
|
|
535
|
+
headers?: Record<string, string>;
|
|
536
|
+
};
|
|
528
537
|
interface AgentInterface {
|
|
529
538
|
init(): Promise<void>;
|
|
530
539
|
setConfig(tenantId: string, projectId: string, apiUrl: string): void;
|
|
@@ -539,6 +548,9 @@ interface AgentInterface {
|
|
|
539
548
|
getSubAgent(name: string): SubAgentInterface | undefined;
|
|
540
549
|
getSubAgents(): SubAgentInterface[];
|
|
541
550
|
toFullAgentDefinition(): Promise<FullAgentDefinition>;
|
|
551
|
+
with(options: {
|
|
552
|
+
headers?: Record<string, string>;
|
|
553
|
+
}): subAgentTeamAgentInterface;
|
|
542
554
|
}
|
|
543
555
|
interface BuilderToolConfig {
|
|
544
556
|
name: string;
|
|
@@ -686,6 +698,9 @@ declare class Agent implements AgentInterface {
|
|
|
686
698
|
agentId: string;
|
|
687
699
|
tenantId: string;
|
|
688
700
|
};
|
|
701
|
+
with(options: {
|
|
702
|
+
headers?: Record<string, string>;
|
|
703
|
+
}): subAgentTeamAgentInterface;
|
|
689
704
|
/**
|
|
690
705
|
* Validate the agent configuration
|
|
691
706
|
*/
|
|
@@ -697,7 +712,7 @@ declare class Agent implements AgentInterface {
|
|
|
697
712
|
/**
|
|
698
713
|
* Type guard to check if an agent is an internal AgentInterface
|
|
699
714
|
*/
|
|
700
|
-
isInternalAgent(agent:
|
|
715
|
+
isInternalAgent(agent: AllDelegateInputInterface): agent is SubAgentInterface;
|
|
701
716
|
/**
|
|
702
717
|
* Get project-level model settingsuration defaults
|
|
703
718
|
*/
|
|
@@ -1339,4 +1354,4 @@ declare const run: typeof Runner.run;
|
|
|
1339
1354
|
declare const stream: typeof Runner.stream;
|
|
1340
1355
|
declare const raceAgents: typeof Runner.raceAgents;
|
|
1341
1356
|
|
|
1342
|
-
export { type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AgentTool, type
|
|
1357
|
+
export { type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AgentTool, type AllDelegateInputInterface, type AllDelegateOutputInterface, 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, type subAgentTeamAgentInterface, transfer, updateFullProjectViaAPI };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ArtifactComponentInsert, MCPToolConfig as MCPToolConfig$1, DataComponentApiInsert, ArtifactComponentApiInsert, CredentialReferenceApiInsert, DataComponentInsert, FunctionToolConfig, SubAgentApiInsert, AgentConversationHistoryConfig, AgentStopWhen, ModelSettings, StatusUpdateSettings,
|
|
1
|
+
import { ArtifactComponentInsert, MCPToolConfig as MCPToolConfig$1, DataComponentApiInsert, ArtifactComponentApiInsert, CredentialReferenceApiInsert, DataComponentInsert, FunctionToolConfig, SubAgentApiInsert, FullAgentDefinition, AgentConversationHistoryConfig, AgentStopWhen, ModelSettings, StatusUpdateSettings, 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
|
|
|
@@ -83,12 +83,13 @@ declare class SubAgent implements SubAgentInterface {
|
|
|
83
83
|
getTransfers(): SubAgentInterface[];
|
|
84
84
|
getSubAgentDelegates(): SubAgentInterface[];
|
|
85
85
|
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
86
|
-
|
|
86
|
+
getTeamAgentDelegates(): subAgentTeamAgentInterface[];
|
|
87
|
+
getDelegates(): AllDelegateOutputInterface[];
|
|
87
88
|
getDataComponents(): DataComponentApiInsert[];
|
|
88
89
|
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
89
90
|
addTool(_name: string, tool: Tool): void;
|
|
90
91
|
addTransfer(...agents: SubAgentInterface[]): void;
|
|
91
|
-
addDelegate(...agents:
|
|
92
|
+
addDelegate(...agents: AllDelegateInputInterface[]): void;
|
|
92
93
|
init(): Promise<void>;
|
|
93
94
|
private upsertAgent;
|
|
94
95
|
private saveToolsAndRelations;
|
|
@@ -347,13 +348,14 @@ interface ToolResult {
|
|
|
347
348
|
result: any;
|
|
348
349
|
error?: string;
|
|
349
350
|
}
|
|
350
|
-
type
|
|
351
|
+
type AllDelegateInputInterface = SubAgentInterface | subAgentExternalAgentInterface | ExternalAgentInterface | AgentInterface | subAgentTeamAgentInterface;
|
|
352
|
+
type AllDelegateOutputInterface = SubAgentInterface | subAgentExternalAgentInterface | subAgentTeamAgentInterface;
|
|
351
353
|
type SubAgentCanUseType = Tool | AgentMcpConfig | FunctionTool;
|
|
352
354
|
interface SubAgentConfig extends Omit<SubAgentApiInsert, 'projectId'> {
|
|
353
355
|
type?: 'internal';
|
|
354
356
|
canUse?: () => SubAgentCanUseType[];
|
|
355
357
|
canTransferTo?: () => SubAgentInterface[];
|
|
356
|
-
canDelegateTo?: () =>
|
|
358
|
+
canDelegateTo?: () => AllDelegateInputInterface[];
|
|
357
359
|
dataComponents?: () => (DataComponentApiInsert | DataComponentInterface | DataComponentWithZodProps)[];
|
|
358
360
|
artifactComponents?: () => (ArtifactComponentApiInsert | ArtifactComponentInterface | ArtifactComponentWithZodProps)[];
|
|
359
361
|
conversationHistoryConfig?: AgentConversationHistoryConfig;
|
|
@@ -462,7 +464,7 @@ interface AgentConfig {
|
|
|
462
464
|
id: string;
|
|
463
465
|
name?: string;
|
|
464
466
|
description?: string;
|
|
465
|
-
defaultSubAgent
|
|
467
|
+
defaultSubAgent: SubAgentInterface;
|
|
466
468
|
subAgents?: () => SubAgentInterface[];
|
|
467
469
|
contextConfig?: any;
|
|
468
470
|
credentials?: () => CredentialReferenceApiInsert[];
|
|
@@ -499,7 +501,7 @@ interface SubAgentInterface {
|
|
|
499
501
|
getInstructions(): string;
|
|
500
502
|
getTools(): Record<string, AgentTool>;
|
|
501
503
|
getTransfers(): SubAgentInterface[];
|
|
502
|
-
getDelegates():
|
|
504
|
+
getDelegates(): AllDelegateOutputInterface[];
|
|
503
505
|
getSubAgentDelegates(): SubAgentInterface[];
|
|
504
506
|
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
505
507
|
getDataComponents(): DataComponentApiInsert[];
|
|
@@ -507,7 +509,7 @@ interface SubAgentInterface {
|
|
|
507
509
|
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
508
510
|
addTool(name: string, tool: any): void;
|
|
509
511
|
addTransfer(...agents: SubAgentInterface[]): void;
|
|
510
|
-
addDelegate(...agents:
|
|
512
|
+
addDelegate(...agents: AllDelegateInputInterface[]): void;
|
|
511
513
|
}
|
|
512
514
|
interface ExternalAgentInterface {
|
|
513
515
|
config: ExternalAgentConfig;
|
|
@@ -518,6 +520,9 @@ interface ExternalAgentInterface {
|
|
|
518
520
|
getDescription(): string;
|
|
519
521
|
getBaseUrl(): string;
|
|
520
522
|
setContext?(tenantId: string, projectId: string): void;
|
|
523
|
+
with(options: {
|
|
524
|
+
headers?: Record<string, string>;
|
|
525
|
+
}): subAgentExternalAgentInterface;
|
|
521
526
|
getCredentialReferenceId(): string | undefined;
|
|
522
527
|
getCredentialReference(): CredentialReferenceApiInsert | undefined;
|
|
523
528
|
}
|
|
@@ -525,6 +530,10 @@ type subAgentExternalAgentInterface = {
|
|
|
525
530
|
externalAgent: ExternalAgentInterface;
|
|
526
531
|
headers?: Record<string, string>;
|
|
527
532
|
};
|
|
533
|
+
type subAgentTeamAgentInterface = {
|
|
534
|
+
agent: AgentInterface;
|
|
535
|
+
headers?: Record<string, string>;
|
|
536
|
+
};
|
|
528
537
|
interface AgentInterface {
|
|
529
538
|
init(): Promise<void>;
|
|
530
539
|
setConfig(tenantId: string, projectId: string, apiUrl: string): void;
|
|
@@ -539,6 +548,9 @@ interface AgentInterface {
|
|
|
539
548
|
getSubAgent(name: string): SubAgentInterface | undefined;
|
|
540
549
|
getSubAgents(): SubAgentInterface[];
|
|
541
550
|
toFullAgentDefinition(): Promise<FullAgentDefinition>;
|
|
551
|
+
with(options: {
|
|
552
|
+
headers?: Record<string, string>;
|
|
553
|
+
}): subAgentTeamAgentInterface;
|
|
542
554
|
}
|
|
543
555
|
interface BuilderToolConfig {
|
|
544
556
|
name: string;
|
|
@@ -686,6 +698,9 @@ declare class Agent implements AgentInterface {
|
|
|
686
698
|
agentId: string;
|
|
687
699
|
tenantId: string;
|
|
688
700
|
};
|
|
701
|
+
with(options: {
|
|
702
|
+
headers?: Record<string, string>;
|
|
703
|
+
}): subAgentTeamAgentInterface;
|
|
689
704
|
/**
|
|
690
705
|
* Validate the agent configuration
|
|
691
706
|
*/
|
|
@@ -697,7 +712,7 @@ declare class Agent implements AgentInterface {
|
|
|
697
712
|
/**
|
|
698
713
|
* Type guard to check if an agent is an internal AgentInterface
|
|
699
714
|
*/
|
|
700
|
-
isInternalAgent(agent:
|
|
715
|
+
isInternalAgent(agent: AllDelegateInputInterface): agent is SubAgentInterface;
|
|
701
716
|
/**
|
|
702
717
|
* Get project-level model settingsuration defaults
|
|
703
718
|
*/
|
|
@@ -1339,4 +1354,4 @@ declare const run: typeof Runner.run;
|
|
|
1339
1354
|
declare const stream: typeof Runner.stream;
|
|
1340
1355
|
declare const raceAgents: typeof Runner.raceAgents;
|
|
1341
1356
|
|
|
1342
|
-
export { type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AgentTool, type
|
|
1357
|
+
export { type AgentConfig, AgentError, type AgentInterface, type AgentResponse, type AgentTool, type AllDelegateInputInterface, type AllDelegateOutputInterface, 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, type subAgentTeamAgentInterface, transfer, updateFullProjectViaAPI };
|
package/dist/index.js
CHANGED
|
@@ -487,7 +487,12 @@ var Agent = class {
|
|
|
487
487
|
this.subAgents = resolveGetter(config.subAgents) || [];
|
|
488
488
|
this.agentMap = new Map(this.subAgents.map((agent2) => [agent2.getId(), agent2]));
|
|
489
489
|
if (this.defaultSubAgent) {
|
|
490
|
-
this.subAgents.
|
|
490
|
+
const isAlreadyPresent = this.subAgents.some(
|
|
491
|
+
(agent2) => agent2.getId() === this.defaultSubAgent?.getId()
|
|
492
|
+
);
|
|
493
|
+
if (!isAlreadyPresent) {
|
|
494
|
+
this.subAgents.push(this.defaultSubAgent);
|
|
495
|
+
}
|
|
491
496
|
this.agentMap.set(this.defaultSubAgent.getId(), this.defaultSubAgent);
|
|
492
497
|
}
|
|
493
498
|
if (this.models) {
|
|
@@ -628,9 +633,10 @@ var Agent = class {
|
|
|
628
633
|
externalAgentId: d.externalAgent.getId(),
|
|
629
634
|
...d.headers && { headers: d.headers }
|
|
630
635
|
};
|
|
631
|
-
} else if (typeof d === "object" && "
|
|
636
|
+
} else if (typeof d === "object" && "agent" in d) {
|
|
632
637
|
return {
|
|
633
|
-
|
|
638
|
+
agentId: d.agent.getId(),
|
|
639
|
+
...d.headers && { headers: d.headers }
|
|
634
640
|
};
|
|
635
641
|
}
|
|
636
642
|
return d.getId();
|
|
@@ -1010,6 +1016,12 @@ var Agent = class {
|
|
|
1010
1016
|
tenantId: this.tenantId
|
|
1011
1017
|
};
|
|
1012
1018
|
}
|
|
1019
|
+
with(options) {
|
|
1020
|
+
return {
|
|
1021
|
+
agent: this,
|
|
1022
|
+
headers: options.headers
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1013
1025
|
/**
|
|
1014
1026
|
* Validate the agent configuration
|
|
1015
1027
|
*/
|
|
@@ -2844,6 +2856,12 @@ var SubAgent = class {
|
|
|
2844
2856
|
if (typeof delegate === "object" && "externalAgent" in delegate) {
|
|
2845
2857
|
return false;
|
|
2846
2858
|
}
|
|
2859
|
+
if (typeof delegate === "object" && "agent" in delegate) {
|
|
2860
|
+
return false;
|
|
2861
|
+
}
|
|
2862
|
+
if (typeof delegate === "object" && "toFullAgentDefinition" in delegate) {
|
|
2863
|
+
return false;
|
|
2864
|
+
}
|
|
2847
2865
|
if (typeof delegate === "object" && "type" in delegate && delegate.type === "external") {
|
|
2848
2866
|
return false;
|
|
2849
2867
|
}
|
|
@@ -2872,8 +2890,34 @@ var SubAgent = class {
|
|
|
2872
2890
|
};
|
|
2873
2891
|
});
|
|
2874
2892
|
}
|
|
2893
|
+
getTeamAgentDelegates() {
|
|
2894
|
+
if (typeof this.config.canDelegateTo !== "function") {
|
|
2895
|
+
return [];
|
|
2896
|
+
}
|
|
2897
|
+
return this.config.canDelegateTo().filter((delegate) => {
|
|
2898
|
+
if (typeof delegate === "object" && "agent" in delegate) {
|
|
2899
|
+
return true;
|
|
2900
|
+
}
|
|
2901
|
+
if (typeof delegate === "object" && "toFullAgentDefinition" in delegate) {
|
|
2902
|
+
return true;
|
|
2903
|
+
}
|
|
2904
|
+
return false;
|
|
2905
|
+
}).map((delegate) => {
|
|
2906
|
+
if ("agent" in delegate) {
|
|
2907
|
+
return delegate;
|
|
2908
|
+
}
|
|
2909
|
+
return {
|
|
2910
|
+
agent: delegate,
|
|
2911
|
+
headers: void 0
|
|
2912
|
+
};
|
|
2913
|
+
});
|
|
2914
|
+
}
|
|
2875
2915
|
getDelegates() {
|
|
2876
|
-
return
|
|
2916
|
+
return [
|
|
2917
|
+
...this.getSubAgentDelegates(),
|
|
2918
|
+
...this.getTeamAgentDelegates(),
|
|
2919
|
+
...this.getExternalAgentDelegates()
|
|
2920
|
+
];
|
|
2877
2921
|
}
|
|
2878
2922
|
getDataComponents() {
|
|
2879
2923
|
const components = resolveGetter2(this.config.dataComponents) || [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-sdk",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20251022190909",
|
|
4
4
|
"description": "Agents SDK for building and managing agents in the Inkeep Agent Framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"nanoid": "^5.1.5",
|
|
13
13
|
"typescript": "^5.3.3",
|
|
14
14
|
"zod": "^4.1.11",
|
|
15
|
-
"@inkeep/agents-core": "^0.0.0-dev-
|
|
15
|
+
"@inkeep/agents-core": "^0.0.0-dev-20251022190909"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/js-yaml": "^4.0.9",
|