@inkeep/agents-sdk 0.39.5 → 0.40.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/_virtual/rolldown_runtime.js +7 -0
- package/dist/agent.d.ts +186 -0
- package/dist/agent.js +720 -0
- package/dist/agentFullClient.d.ts +22 -0
- package/dist/agentFullClient.js +120 -0
- package/dist/artifact-component.d.ts +34 -0
- package/dist/artifact-component.js +104 -0
- package/dist/builderFunctions.d.ts +283 -0
- package/dist/builderFunctions.js +327 -0
- package/dist/builderFunctionsExperimental.d.ts +24 -0
- package/dist/builderFunctionsExperimental.js +27 -0
- package/dist/builders.d.ts +111 -0
- package/dist/builders.js +52 -0
- package/dist/credential-provider.d.ts +176 -0
- package/dist/credential-provider.js +237 -0
- package/dist/credential-ref.d.ts +60 -0
- package/dist/credential-ref.js +33 -0
- package/dist/data-component.d.ts +39 -0
- package/dist/data-component.js +109 -0
- package/dist/environment-settings.d.ts +27 -0
- package/dist/environment-settings.js +41 -0
- package/dist/external-agent.d.ts +64 -0
- package/dist/external-agent.js +156 -0
- package/dist/function-tool.d.ts +37 -0
- package/dist/function-tool.js +66 -0
- package/dist/index.d.ts +19 -1825
- package/dist/index.js +19 -4058
- package/dist/module-hosted-tool-manager.d.ts +40 -0
- package/dist/module-hosted-tool-manager.js +359 -0
- package/dist/project.d.ts +214 -0
- package/dist/project.js +615 -0
- package/dist/projectFullClient.d.ts +23 -0
- package/dist/projectFullClient.js +162 -0
- package/dist/runner.d.ts +41 -0
- package/dist/runner.js +145 -0
- package/dist/status-component.d.ts +22 -0
- package/dist/status-component.js +36 -0
- package/dist/subAgent.d.ts +52 -0
- package/dist/subAgent.js +616 -0
- package/dist/telemetry-provider.d.ts +218 -0
- package/dist/telemetry-provider.js +390 -0
- package/dist/tool.d.ts +53 -0
- package/dist/tool.js +130 -0
- package/dist/types.d.ts +296 -0
- package/dist/types.js +39 -0
- package/dist/utils/generateIdFromName.d.ts +9 -0
- package/dist/utils/generateIdFromName.js +12 -0
- package/dist/utils/getFunctionToolDeps.d.ts +17 -0
- package/dist/utils/getFunctionToolDeps.js +131 -0
- package/dist/utils/tool-normalization.d.ts +42 -0
- package/dist/utils/tool-normalization.js +41 -0
- package/dist/utils/validateFunction.d.ts +10 -0
- package/dist/utils/validateFunction.js +13 -0
- package/package.json +11 -16
- package/dist/index.cjs +0 -4147
- package/dist/index.d.cts +0 -1825
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { AgentConfig, AgentInterface, AllDelegateInputInterface, GenerateOptions, MessageInput, ModelSettings, RunResult, StreamResponse, SubAgentInterface, subAgentTeamAgentInterface } from "./types.js";
|
|
2
|
+
import { AgentStopWhen, FullAgentDefinition, StatusUpdateSettings } from "@inkeep/agents-core";
|
|
3
|
+
|
|
4
|
+
//#region src/agent.d.ts
|
|
5
|
+
declare class Agent implements AgentInterface {
|
|
6
|
+
private subAgents;
|
|
7
|
+
private agentMap;
|
|
8
|
+
private defaultSubAgent?;
|
|
9
|
+
private baseURL;
|
|
10
|
+
private tenantId;
|
|
11
|
+
private projectId;
|
|
12
|
+
private agentId;
|
|
13
|
+
private agentName;
|
|
14
|
+
private agentDescription?;
|
|
15
|
+
private initialized;
|
|
16
|
+
private contextConfig?;
|
|
17
|
+
private credentials?;
|
|
18
|
+
private models?;
|
|
19
|
+
private statusUpdateSettings?;
|
|
20
|
+
private prompt?;
|
|
21
|
+
private stopWhen?;
|
|
22
|
+
constructor(config: AgentConfig);
|
|
23
|
+
/**
|
|
24
|
+
* Set or update the configuration (tenantId, projectId and apiUrl)
|
|
25
|
+
* This is used by the CLI to inject configuration from inkeep.config.ts
|
|
26
|
+
*/
|
|
27
|
+
setConfig(tenantId: string, projectId: string, apiUrl: string): void;
|
|
28
|
+
/**
|
|
29
|
+
* Convert the Agent to FullAgentDefinition format for the new agent endpoint
|
|
30
|
+
*/
|
|
31
|
+
toFullAgentDefinition(): Promise<FullAgentDefinition>;
|
|
32
|
+
/**
|
|
33
|
+
* Initialize all tools in all agents (especially IPCTools that need MCP server URLs)
|
|
34
|
+
*/
|
|
35
|
+
private initializeAllTools;
|
|
36
|
+
/**
|
|
37
|
+
* Initialize the agent and all agents in the backend using the new agent endpoint
|
|
38
|
+
*/
|
|
39
|
+
init(): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Generate a response using the default agent
|
|
42
|
+
*/
|
|
43
|
+
generate(input: MessageInput, options?: GenerateOptions): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Stream a response using the default agent
|
|
46
|
+
*/
|
|
47
|
+
stream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Alias for stream() method for consistency with naming patterns
|
|
50
|
+
*/
|
|
51
|
+
generateStream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Run with a specific agent from the agent
|
|
54
|
+
*/
|
|
55
|
+
runWith(subAgentId: string, input: MessageInput, options?: GenerateOptions): Promise<RunResult>;
|
|
56
|
+
/**
|
|
57
|
+
* Get an agent by name (unified method for all agent types)
|
|
58
|
+
*/
|
|
59
|
+
getSubAgent(name: string): SubAgentInterface | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Add an agent to the agent
|
|
62
|
+
*/
|
|
63
|
+
addSubAgent(agent: SubAgentInterface): void;
|
|
64
|
+
/**
|
|
65
|
+
* Remove an agent from the agent
|
|
66
|
+
*/
|
|
67
|
+
removeSubAgent(id: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get all agents in the agent
|
|
70
|
+
*/
|
|
71
|
+
getSubAgents(): SubAgentInterface[];
|
|
72
|
+
/**
|
|
73
|
+
* Get all agent ids (unified method for all agent types)
|
|
74
|
+
*/
|
|
75
|
+
getSubAgentIds(): string[];
|
|
76
|
+
/**
|
|
77
|
+
* Set the default agent
|
|
78
|
+
*/
|
|
79
|
+
setDefaultSubAgent(agent: SubAgentInterface): void;
|
|
80
|
+
/**
|
|
81
|
+
* Get the default agent
|
|
82
|
+
*/
|
|
83
|
+
getDefaultSubAgent(): SubAgentInterface | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Get the agent ID
|
|
86
|
+
*/
|
|
87
|
+
getId(): string;
|
|
88
|
+
getName(): string;
|
|
89
|
+
getDescription(): string | undefined;
|
|
90
|
+
getTenantId(): string;
|
|
91
|
+
/**
|
|
92
|
+
* Get the agent's model settingsuration
|
|
93
|
+
*/
|
|
94
|
+
getModels(): typeof this.models;
|
|
95
|
+
/**
|
|
96
|
+
* Set the agent's model settingsuration
|
|
97
|
+
*/
|
|
98
|
+
setModels(models: typeof this.models): void;
|
|
99
|
+
/**
|
|
100
|
+
* Get the agent's prompt configuration
|
|
101
|
+
*/
|
|
102
|
+
getPrompt(): string | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Get the agent's stopWhen configuration
|
|
105
|
+
*/
|
|
106
|
+
getStopWhen(): AgentStopWhen;
|
|
107
|
+
/**
|
|
108
|
+
* Get the agent's status updates configuration
|
|
109
|
+
*/
|
|
110
|
+
getStatusUpdateSettings(): StatusUpdateSettings | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Get the summarizer model from the agent's model settings
|
|
113
|
+
*/
|
|
114
|
+
getSummarizerModel(): ModelSettings | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Get agent statistics
|
|
117
|
+
*/
|
|
118
|
+
getStats(): {
|
|
119
|
+
agentCount: number;
|
|
120
|
+
defaultSubAgent: string | null;
|
|
121
|
+
initialized: boolean;
|
|
122
|
+
agentId: string;
|
|
123
|
+
tenantId: string;
|
|
124
|
+
};
|
|
125
|
+
with(options: {
|
|
126
|
+
headers?: Record<string, string>;
|
|
127
|
+
}): subAgentTeamAgentInterface;
|
|
128
|
+
/**
|
|
129
|
+
* Validate the agent configuration
|
|
130
|
+
*/
|
|
131
|
+
validate(): {
|
|
132
|
+
valid: boolean;
|
|
133
|
+
errors: string[];
|
|
134
|
+
};
|
|
135
|
+
private _init;
|
|
136
|
+
/**
|
|
137
|
+
* Type guard to check if an agent is an internal AgentInterface
|
|
138
|
+
*/
|
|
139
|
+
isInternalAgent(agent: AllDelegateInputInterface): agent is SubAgentInterface;
|
|
140
|
+
/**
|
|
141
|
+
* Get project-level model settingsuration defaults
|
|
142
|
+
*/
|
|
143
|
+
private getProjectModelDefaults;
|
|
144
|
+
/**
|
|
145
|
+
* Get project-level stopWhen configuration defaults
|
|
146
|
+
*/
|
|
147
|
+
private getProjectStopWhenDefaults;
|
|
148
|
+
/**
|
|
149
|
+
* Apply model inheritance hierarchy: Project -> Agent -> Agent
|
|
150
|
+
*/
|
|
151
|
+
private applyModelInheritance;
|
|
152
|
+
/**
|
|
153
|
+
* Apply stopWhen inheritance hierarchy: Project -> Agent -> Agent
|
|
154
|
+
*/
|
|
155
|
+
private applyStopWhenInheritance;
|
|
156
|
+
/**
|
|
157
|
+
* Propagate agent-level model settings to agents (supporting partial inheritance)
|
|
158
|
+
*/
|
|
159
|
+
private propagateModelSettingsToAgent;
|
|
160
|
+
/**
|
|
161
|
+
* Immediately propagate agent-level models to all agents during construction
|
|
162
|
+
*/
|
|
163
|
+
private propagateImmediateModelSettings;
|
|
164
|
+
/**
|
|
165
|
+
* Execute agent using the backend system instead of local runner
|
|
166
|
+
*/
|
|
167
|
+
private executeWithBackend;
|
|
168
|
+
/**
|
|
169
|
+
* Parse streaming response in SSE format
|
|
170
|
+
*/
|
|
171
|
+
private parseStreamingResponse;
|
|
172
|
+
/**
|
|
173
|
+
* Normalize input messages to the expected format
|
|
174
|
+
*/
|
|
175
|
+
private normalizeMessages;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Helper function to create agent - OpenAI style
|
|
179
|
+
*/
|
|
180
|
+
declare function agent(config: AgentConfig): Agent;
|
|
181
|
+
/**
|
|
182
|
+
* Factory function to create agent from configuration file
|
|
183
|
+
*/
|
|
184
|
+
declare function generateAgent(configPath: string): Promise<Agent>;
|
|
185
|
+
//#endregion
|
|
186
|
+
export { Agent, agent, generateAgent };
|