@inkeep/agents-sdk 0.39.2 → 0.39.3
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 +3956 -4402
- package/dist/index.d.cts +1084 -1077
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +1084 -1077
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3913 -4365
- package/dist/index.js.map +1 -0
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,129 +1,132 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { z } from 'zod';
|
|
1
|
+
import { ANTHROPIC_MODELS, AgentConversationHistoryConfig, AgentStopWhen, ArtifactComponentApiInsert, ArtifactComponentInsert, CredentialReferenceApiInsert, DataComponentApiInsert, DataComponentInsert, FullAgentDefinition, FullProjectDefinition, FunctionToolConfig, GOOGLE_MODELS, MCPToolConfig as MCPToolConfig$1, McpToolSelection, McpTransportConfig, ModelSettings, OPENAI_MODELS, StatusComponent as StatusComponent$1, StatusUpdateSettings, StopWhen, SubAgentApiInsert, ToolInsert, ToolPolicy } from "@inkeep/agents-core";
|
|
2
|
+
import { z } from "zod";
|
|
4
3
|
|
|
4
|
+
//#region src/artifact-component.d.ts
|
|
5
5
|
type ArtifactComponentConfigWithZod = Omit<ArtifactComponentInsert, 'tenantId' | 'projectId' | 'props'> & {
|
|
6
|
-
|
|
6
|
+
props?: Record<string, unknown> | z.ZodObject<any> | null;
|
|
7
7
|
};
|
|
8
8
|
interface ArtifactComponentInterface {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
16
|
}
|
|
17
17
|
declare class ArtifactComponent implements ArtifactComponentInterface {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
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
|
+
//#endregion
|
|
34
|
+
//#region src/tool.d.ts
|
|
34
35
|
interface ToolInterface {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
config: MCPToolConfig$1;
|
|
37
|
+
init(): Promise<void>;
|
|
38
|
+
getId(): string;
|
|
39
|
+
getName(): string;
|
|
40
|
+
getDescription(): string;
|
|
41
|
+
getServerUrl(): string;
|
|
42
|
+
getActiveTools(): string[] | undefined;
|
|
43
|
+
getCredentialReferenceId(): string | null | undefined;
|
|
44
|
+
with(config: AgentMcpConfigInput): AgentMcpConfig;
|
|
44
45
|
}
|
|
45
46
|
declare class Tool implements ToolInterface {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
47
|
+
config: MCPToolConfig$1;
|
|
48
|
+
private baseURL;
|
|
49
|
+
private tenantId;
|
|
50
|
+
private initialized;
|
|
51
|
+
private projectId;
|
|
52
|
+
constructor(config: Omit<MCPToolConfig$1, 'tenantId' | 'projectId'>);
|
|
53
|
+
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
54
|
+
getId(): string;
|
|
55
|
+
getName(): string;
|
|
56
|
+
getDescription(): string;
|
|
57
|
+
getServerUrl(): string;
|
|
58
|
+
getActiveTools(): string[] | undefined;
|
|
59
|
+
getCredentialReferenceId(): string | null | undefined;
|
|
60
|
+
init(options?: {
|
|
61
|
+
skipDatabaseRegistration?: boolean;
|
|
62
|
+
}): Promise<void>;
|
|
63
|
+
private upsertTool;
|
|
64
|
+
/**
|
|
65
|
+
* Creates a new AgentMcpConfig with the given configuration.
|
|
66
|
+
*
|
|
67
|
+
* @param config - The configuration for the AgentMcpConfig
|
|
68
|
+
* @returns A new AgentMcpConfig
|
|
69
|
+
*
|
|
70
|
+
* example:
|
|
71
|
+
* ```typescript
|
|
72
|
+
* const tool = new Tool({
|
|
73
|
+
* id: 'tool-id',
|
|
74
|
+
* name: 'Tool Name',
|
|
75
|
+
* serverUrl: 'https://example.com/mcp',
|
|
76
|
+
* });
|
|
77
|
+
* const agentMcpConfig = tool.with({ selectedTools: ['tool-1', 'tool-2'], headers: { 'Authorization': 'Bearer token' } });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
with(config: AgentMcpConfigInput): AgentMcpConfig;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/subAgent.d.ts
|
|
82
84
|
declare class SubAgent implements SubAgentInterface {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
85
|
+
config: SubAgentConfig;
|
|
86
|
+
readonly type: "internal";
|
|
87
|
+
private baseURL;
|
|
88
|
+
private tenantId;
|
|
89
|
+
private projectId;
|
|
90
|
+
private initialized;
|
|
91
|
+
constructor(config: SubAgentConfig);
|
|
92
|
+
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
93
|
+
getId(): string;
|
|
94
|
+
getName(): string;
|
|
95
|
+
getInstructions(): string;
|
|
96
|
+
/**
|
|
97
|
+
* Get the agent's description (the human-readable description field)
|
|
98
|
+
*/
|
|
99
|
+
getDescription(): string;
|
|
100
|
+
getTools(): Record<string, AgentTool>;
|
|
101
|
+
getModels(): typeof this.config.models;
|
|
102
|
+
setModels(models: typeof this.config.models): void;
|
|
103
|
+
getTransfers(): SubAgentInterface[];
|
|
104
|
+
getSubAgentDelegates(): SubAgentInterface[];
|
|
105
|
+
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
106
|
+
getTeamAgentDelegates(): subAgentTeamAgentInterface[];
|
|
107
|
+
getDelegates(): AllDelegateOutputInterface[];
|
|
108
|
+
getDataComponents(): DataComponentApiInsert[];
|
|
109
|
+
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
110
|
+
addTool(_name: string, tool: Tool): void;
|
|
111
|
+
addTransfer(...agents: SubAgentInterface[]): void;
|
|
112
|
+
addDelegate(...agents: AllDelegateInputInterface[]): void;
|
|
113
|
+
init(): Promise<void>;
|
|
114
|
+
private upsertAgent;
|
|
115
|
+
private saveToolsAndRelations;
|
|
116
|
+
private saveDataComponents;
|
|
117
|
+
private saveArtifactComponents;
|
|
118
|
+
private loadDataComponents;
|
|
119
|
+
private loadArtifactComponents;
|
|
120
|
+
private createFunctionTool;
|
|
121
|
+
private createTool;
|
|
122
|
+
private createDataComponent;
|
|
123
|
+
private createArtifactComponent;
|
|
124
|
+
private createAgentDataComponentRelation;
|
|
125
|
+
private createAgentArtifactComponentRelation;
|
|
126
|
+
private createAgentToolRelation;
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/builders.d.ts
|
|
127
130
|
/**
|
|
128
131
|
* Function signature for transfer conditions
|
|
129
132
|
*/
|
|
@@ -132,60 +135,60 @@ type TransferConditionFunction = (context: unknown) => boolean;
|
|
|
132
135
|
* Configuration for MCP server builders
|
|
133
136
|
*/
|
|
134
137
|
interface MCPServerConfig {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
138
|
+
name: string;
|
|
139
|
+
description: string;
|
|
140
|
+
serverUrl: string;
|
|
141
|
+
id?: string;
|
|
142
|
+
parameters?: Record<string, z.ZodJSONSchema>;
|
|
143
|
+
credential?: CredentialReferenceApiInsert;
|
|
144
|
+
transport?: 'streamable_http' | 'sse';
|
|
145
|
+
activeTools?: string[];
|
|
146
|
+
headers?: Record<string, string>;
|
|
147
|
+
imageUrl?: string;
|
|
145
148
|
}
|
|
146
149
|
/**
|
|
147
150
|
* Configuration for component builders
|
|
148
151
|
*/
|
|
149
152
|
interface ComponentConfig {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
id?: string;
|
|
154
|
+
name: string;
|
|
155
|
+
description: string;
|
|
153
156
|
}
|
|
154
157
|
interface ArtifactComponentConfig extends ComponentConfig {
|
|
155
|
-
|
|
158
|
+
props: Record<string, unknown> | z.ZodObject<any>;
|
|
156
159
|
}
|
|
157
160
|
interface DataComponentConfig extends ComponentConfig {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
props: Record<string, unknown> | z.ZodObject<any>;
|
|
162
|
+
render?: {
|
|
163
|
+
component: string;
|
|
164
|
+
mockData: Record<string, unknown>;
|
|
165
|
+
};
|
|
163
166
|
}
|
|
164
167
|
interface StatusComponentConfig {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
type: string;
|
|
169
|
+
description?: string;
|
|
170
|
+
detailsSchema?: Record<string, unknown> | z.ZodObject<any>;
|
|
168
171
|
}
|
|
169
172
|
type AgentMcpConfig = {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
server: Tool;
|
|
174
|
+
selectedTools?: string[];
|
|
175
|
+
headers?: Record<string, string>;
|
|
176
|
+
toolPolicies?: Record<string, ToolPolicy>;
|
|
174
177
|
};
|
|
175
178
|
/**
|
|
176
179
|
* Input configuration for MCP tool customization
|
|
177
180
|
* Supports flexible tool selection with per-tool policies
|
|
178
181
|
*/
|
|
179
182
|
type AgentMcpConfigInput = {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
183
|
+
/**
|
|
184
|
+
* Tools to enable from the MCP server - can be strings or objects with policies
|
|
185
|
+
* - undefined or null: all tools enabled (no filtering)
|
|
186
|
+
* - []: zero tools enabled (explicit empty selection)
|
|
187
|
+
* - ['tool1', 'tool2']: specific tools enabled
|
|
188
|
+
*/
|
|
189
|
+
selectedTools?: McpToolSelection[] | null;
|
|
190
|
+
/** Custom headers for MCP server requests */
|
|
191
|
+
headers?: Record<string, string>;
|
|
189
192
|
};
|
|
190
193
|
/**
|
|
191
194
|
* Creates a transfer configuration for agent transfers.
|
|
@@ -212,86 +215,88 @@ type AgentMcpConfigInput = {
|
|
|
212
215
|
* ```
|
|
213
216
|
*/
|
|
214
217
|
declare function transfer(targetAgent: SubAgent, description?: string, condition?: TransferConditionFunction): TransferConfig;
|
|
215
|
-
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/data-component.d.ts
|
|
216
220
|
type DataComponentConfigWithZod = Omit<DataComponentInsert, 'tenantId' | 'projectId' | 'props' | 'render'> & {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
221
|
+
props?: Record<string, unknown> | z.ZodObject<any> | null;
|
|
222
|
+
render?: {
|
|
223
|
+
component: string;
|
|
224
|
+
mockData: Record<string, unknown>;
|
|
225
|
+
} | null;
|
|
222
226
|
};
|
|
223
227
|
interface DataComponentInterface {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
config: Omit<DataComponentInsert, 'tenantId' | 'projectId'>;
|
|
229
|
+
init(): Promise<void>;
|
|
230
|
+
getId(): DataComponentInsert['id'];
|
|
231
|
+
getName(): DataComponentInsert['name'];
|
|
232
|
+
getDescription(): DataComponentInsert['description'];
|
|
233
|
+
getProps(): DataComponentInsert['props'];
|
|
234
|
+
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
231
235
|
}
|
|
232
236
|
declare class DataComponent implements DataComponentInterface {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
237
|
+
config: Omit<DataComponentInsert, 'tenantId' | 'projectId'>;
|
|
238
|
+
private baseURL;
|
|
239
|
+
private tenantId;
|
|
240
|
+
private projectId;
|
|
241
|
+
private initialized;
|
|
242
|
+
private id;
|
|
243
|
+
constructor(config: DataComponentConfigWithZod);
|
|
244
|
+
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
245
|
+
getId(): string;
|
|
246
|
+
getName(): string;
|
|
247
|
+
getDescription(): string;
|
|
248
|
+
getProps(): DataComponentInsert['props'];
|
|
249
|
+
getRender(): DataComponentInsert['render'];
|
|
250
|
+
init(): Promise<void>;
|
|
251
|
+
private upsertDataComponent;
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/external-agent.d.ts
|
|
250
255
|
type ExternalAgentConfig = {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
256
|
+
type?: 'external';
|
|
257
|
+
id: string;
|
|
258
|
+
name: string;
|
|
259
|
+
description: string;
|
|
260
|
+
baseUrl: string;
|
|
261
|
+
credentialReference?: CredentialReferenceApiInsert;
|
|
257
262
|
};
|
|
258
263
|
declare class ExternalAgent implements ExternalAgentInterface {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
264
|
+
config: ExternalAgentConfig;
|
|
265
|
+
readonly type: "external";
|
|
266
|
+
private initialized;
|
|
267
|
+
private tenantId;
|
|
268
|
+
private projectId;
|
|
269
|
+
private baseURL;
|
|
270
|
+
constructor(config: ExternalAgentConfig);
|
|
271
|
+
/**
|
|
272
|
+
* Initialize the external agent by upserting it in the database
|
|
273
|
+
*/
|
|
274
|
+
init(): Promise<void>;
|
|
275
|
+
setContext(tenantId: string, projectId: string): void;
|
|
276
|
+
getId(): string;
|
|
277
|
+
with(options: {
|
|
278
|
+
headers?: Record<string, string>;
|
|
279
|
+
}): subAgentExternalAgentInterface;
|
|
280
|
+
private upsertExternalAgent;
|
|
281
|
+
/**
|
|
282
|
+
* Get the external agent configuration
|
|
283
|
+
*/
|
|
284
|
+
getConfig(): ExternalAgentConfig;
|
|
285
|
+
/**
|
|
286
|
+
* Get the external agent name
|
|
287
|
+
*/
|
|
288
|
+
getName(): string;
|
|
289
|
+
/**
|
|
290
|
+
* Get the external agent base URL
|
|
291
|
+
*/
|
|
292
|
+
getBaseUrl(): string;
|
|
293
|
+
/**
|
|
294
|
+
* Get the tenant ID
|
|
295
|
+
*/
|
|
296
|
+
getTenantId(): string;
|
|
297
|
+
getDescription(): string;
|
|
298
|
+
getCredentialReferenceId(): string | undefined;
|
|
299
|
+
getCredentialReference(): CredentialReferenceApiInsert | undefined;
|
|
295
300
|
}
|
|
296
301
|
/**
|
|
297
302
|
* Factory function to create external agents - follows the same pattern as agent()
|
|
@@ -301,545 +306,547 @@ declare function externalAgent(config: ExternalAgentConfig): ExternalAgent;
|
|
|
301
306
|
* Helper function to create multiple external agents
|
|
302
307
|
*/
|
|
303
308
|
declare function externalAgents(configs: Record<string, ExternalAgentConfig>): Record<string, ExternalAgent>;
|
|
304
|
-
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/function-tool.d.ts
|
|
305
311
|
interface FunctionToolInterface {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
312
|
+
config: FunctionToolConfig;
|
|
313
|
+
getId(): string;
|
|
314
|
+
getName(): string;
|
|
315
|
+
getDescription(): string;
|
|
316
|
+
getInputSchema(): Record<string, unknown>;
|
|
317
|
+
getDependencies(): Record<string, string>;
|
|
318
|
+
getExecuteFunction(): (params: any) => Promise<any>;
|
|
313
319
|
}
|
|
314
320
|
declare class FunctionTool implements FunctionToolInterface {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
id: string;
|
|
332
|
-
name: string;
|
|
333
|
-
description: string;
|
|
334
|
-
functionId: string;
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
interface ArtifactComponentWithZodProps {
|
|
321
|
+
config: FunctionToolConfig;
|
|
322
|
+
private id;
|
|
323
|
+
constructor(config: FunctionToolConfig);
|
|
324
|
+
getId(): string;
|
|
325
|
+
getName(): string;
|
|
326
|
+
getDescription(): string;
|
|
327
|
+
getInputSchema(): Record<string, unknown>;
|
|
328
|
+
getDependencies(): Record<string, string>;
|
|
329
|
+
getExecuteFunction(): (params: any) => Promise<any>;
|
|
330
|
+
serializeFunction(): {
|
|
331
|
+
id: string;
|
|
332
|
+
inputSchema: Record<string, unknown>;
|
|
333
|
+
executeCode: string;
|
|
334
|
+
dependencies: Record<string, string>;
|
|
335
|
+
};
|
|
336
|
+
serializeTool(): {
|
|
339
337
|
id: string;
|
|
340
338
|
name: string;
|
|
341
339
|
description: string;
|
|
342
|
-
|
|
340
|
+
functionId: string;
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
//#endregion
|
|
344
|
+
//#region src/types.d.ts
|
|
345
|
+
interface ArtifactComponentWithZodProps {
|
|
346
|
+
id: string;
|
|
347
|
+
name: string;
|
|
348
|
+
description: string;
|
|
349
|
+
props?: z.ZodObject<any>;
|
|
343
350
|
}
|
|
344
351
|
interface DataComponentWithZodProps {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
352
|
+
id: string;
|
|
353
|
+
name: string;
|
|
354
|
+
description: string;
|
|
355
|
+
props?: z.ZodObject<any>;
|
|
349
356
|
}
|
|
350
|
-
|
|
351
357
|
/**
|
|
352
358
|
* Tool instance that may have additional metadata attached during agent processing
|
|
353
359
|
*/
|
|
354
360
|
type AgentTool = (Tool & {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
361
|
+
selectedTools?: string[];
|
|
362
|
+
headers?: Record<string, string>;
|
|
363
|
+
toolPolicies?: Record<string, ToolPolicy>;
|
|
358
364
|
}) | (FunctionTool & {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
365
|
+
selectedTools?: string[];
|
|
366
|
+
headers?: Record<string, string>;
|
|
367
|
+
toolPolicies?: Record<string, ToolPolicy>;
|
|
362
368
|
});
|
|
363
369
|
interface UserMessage {
|
|
364
|
-
|
|
365
|
-
|
|
370
|
+
role: 'user';
|
|
371
|
+
content: string;
|
|
366
372
|
}
|
|
367
373
|
interface AssistantMessage {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
374
|
+
role: 'assistant';
|
|
375
|
+
content: string;
|
|
376
|
+
toolCalls?: ToolCall[];
|
|
371
377
|
}
|
|
372
378
|
interface ToolMessage {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
379
|
+
role: 'tool';
|
|
380
|
+
content: string;
|
|
381
|
+
toolCallId: string;
|
|
376
382
|
}
|
|
377
383
|
interface SystemMessage {
|
|
378
|
-
|
|
379
|
-
|
|
384
|
+
role: 'system';
|
|
385
|
+
content: string;
|
|
380
386
|
}
|
|
381
387
|
type Message = UserMessage | AssistantMessage | ToolMessage | SystemMessage;
|
|
382
388
|
type MessageInput = string | string[] | Message | Message[];
|
|
383
389
|
interface ToolCall {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
+
id: string;
|
|
391
|
+
type: 'function';
|
|
392
|
+
function: {
|
|
393
|
+
name: string;
|
|
394
|
+
arguments: string;
|
|
395
|
+
};
|
|
390
396
|
}
|
|
391
397
|
interface ToolResult {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
398
|
+
id: string;
|
|
399
|
+
result: any;
|
|
400
|
+
error?: string;
|
|
395
401
|
}
|
|
396
402
|
type AllDelegateInputInterface = SubAgentInterface | subAgentExternalAgentInterface | ExternalAgentInterface | AgentInterface | subAgentTeamAgentInterface;
|
|
397
403
|
type AllDelegateOutputInterface = SubAgentInterface | subAgentExternalAgentInterface | subAgentTeamAgentInterface;
|
|
398
404
|
type SubAgentCanUseType = Tool | AgentMcpConfig | FunctionTool;
|
|
399
405
|
interface SubAgentConfig extends Omit<SubAgentApiInsert, 'projectId'> {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
406
|
+
type?: 'internal';
|
|
407
|
+
canUse?: () => SubAgentCanUseType[];
|
|
408
|
+
canTransferTo?: () => SubAgentInterface[];
|
|
409
|
+
canDelegateTo?: () => AllDelegateInputInterface[];
|
|
410
|
+
dataComponents?: () => (DataComponentApiInsert | DataComponentInterface | DataComponentWithZodProps)[];
|
|
411
|
+
artifactComponents?: () => (ArtifactComponentApiInsert | ArtifactComponentInterface | ArtifactComponentWithZodProps)[];
|
|
412
|
+
conversationHistoryConfig?: AgentConversationHistoryConfig;
|
|
407
413
|
}
|
|
408
414
|
interface ToolConfig extends ToolInsert {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
415
|
+
execute: (params: any) => Promise<any>;
|
|
416
|
+
parameters?: Record<string, any>;
|
|
417
|
+
schema?: z.ZodJSONSchema;
|
|
412
418
|
}
|
|
413
419
|
interface ServerConfig {
|
|
414
|
-
|
|
415
|
-
|
|
420
|
+
type: string;
|
|
421
|
+
version?: string;
|
|
416
422
|
}
|
|
417
423
|
interface MCPToolConfig {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
424
|
+
id: string;
|
|
425
|
+
name: string;
|
|
426
|
+
tenantId?: string;
|
|
427
|
+
description?: string;
|
|
428
|
+
credential?: CredentialReferenceApiInsert;
|
|
429
|
+
server?: ServerConfig;
|
|
430
|
+
serverUrl: string;
|
|
431
|
+
toolName?: string;
|
|
432
|
+
activeTools?: string[];
|
|
433
|
+
headers?: Record<string, string>;
|
|
434
|
+
mcpType?: 'nango' | 'generic';
|
|
435
|
+
transport?: McpTransportConfig;
|
|
436
|
+
imageUrl?: string;
|
|
431
437
|
}
|
|
432
438
|
interface FetchDefinitionConfig {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
439
|
+
id: string;
|
|
440
|
+
name?: string;
|
|
441
|
+
trigger: 'initialization' | 'invocation';
|
|
442
|
+
url: string;
|
|
443
|
+
method?: string;
|
|
444
|
+
headers?: Record<string, string>;
|
|
445
|
+
body?: Record<string, unknown>;
|
|
446
|
+
transform?: string;
|
|
447
|
+
responseSchema?: z.ZodSchema<any>;
|
|
448
|
+
defaultValue?: unknown;
|
|
449
|
+
timeout?: number;
|
|
450
|
+
credential?: CredentialReferenceApiInsert;
|
|
445
451
|
}
|
|
446
|
-
|
|
447
452
|
interface RequestSchemaDefinition {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
453
|
+
body?: z.ZodSchema<any>;
|
|
454
|
+
headers?: z.ZodSchema<any>;
|
|
455
|
+
query?: z.ZodSchema<any>;
|
|
456
|
+
params?: z.ZodSchema<any>;
|
|
452
457
|
}
|
|
453
458
|
interface RequestSchemaConfig {
|
|
454
|
-
|
|
455
|
-
|
|
459
|
+
schemas: RequestSchemaDefinition;
|
|
460
|
+
optional?: ('body' | 'headers' | 'query' | 'params')[];
|
|
456
461
|
}
|
|
457
462
|
interface TransferConfig {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
463
|
+
agent: SubAgentInterface;
|
|
464
|
+
description?: string;
|
|
465
|
+
condition?: (context: any) => boolean;
|
|
461
466
|
}
|
|
462
467
|
interface GenerateOptions {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
468
|
+
maxTurns?: number;
|
|
469
|
+
maxSteps?: number;
|
|
470
|
+
temperature?: number;
|
|
471
|
+
toolChoice?: 'auto' | 'none' | string;
|
|
472
|
+
resourceId?: string;
|
|
473
|
+
conversationId?: string;
|
|
474
|
+
stream?: boolean;
|
|
475
|
+
customBodyParams?: Record<string, unknown>;
|
|
471
476
|
}
|
|
472
477
|
interface AgentResponse {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
478
|
+
id?: string;
|
|
479
|
+
text: string;
|
|
480
|
+
toolCalls?: ToolCall[];
|
|
481
|
+
transfer?: TransferConfig;
|
|
482
|
+
finishReason: 'completed' | 'tool_calls' | 'transfer' | 'max_turns' | 'error';
|
|
483
|
+
usage?: {
|
|
484
|
+
inputTokens: number;
|
|
485
|
+
outputTokens: number;
|
|
486
|
+
totalTokens?: number;
|
|
487
|
+
};
|
|
488
|
+
metadata?: Record<string, any>;
|
|
484
489
|
}
|
|
485
490
|
interface StreamResponse {
|
|
486
|
-
|
|
487
|
-
|
|
491
|
+
textStream?: AsyncGenerator<string>;
|
|
492
|
+
eventStream?: AsyncGenerator<StreamEvent>;
|
|
488
493
|
}
|
|
489
494
|
interface StreamEvent {
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
495
|
+
type: 'text' | 'tool_call' | 'transfer' | 'error' | 'done';
|
|
496
|
+
data: any;
|
|
497
|
+
timestamp: Date;
|
|
493
498
|
}
|
|
494
499
|
interface RunResult {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
500
|
+
finalOutput: string;
|
|
501
|
+
agent: SubAgentInterface;
|
|
502
|
+
turnCount: number;
|
|
503
|
+
usage?: {
|
|
504
|
+
inputTokens: number;
|
|
505
|
+
outputTokens: number;
|
|
506
|
+
totalTokens?: number;
|
|
507
|
+
};
|
|
508
|
+
metadata?: {
|
|
509
|
+
toolCalls: ToolCall[];
|
|
510
|
+
transfers: TransferConfig[];
|
|
511
|
+
};
|
|
507
512
|
}
|
|
508
513
|
interface AgentConfig {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
514
|
+
id: string;
|
|
515
|
+
name?: string;
|
|
516
|
+
description?: string;
|
|
517
|
+
defaultSubAgent: SubAgentInterface;
|
|
518
|
+
subAgents?: () => SubAgentInterface[];
|
|
519
|
+
contextConfig?: any;
|
|
520
|
+
credentials?: () => CredentialReferenceApiInsert[];
|
|
521
|
+
stopWhen?: AgentStopWhen;
|
|
522
|
+
prompt?: string;
|
|
523
|
+
models?: {
|
|
524
|
+
base?: ModelSettings;
|
|
525
|
+
structuredOutput?: ModelSettings;
|
|
526
|
+
summarizer?: ModelSettings;
|
|
527
|
+
};
|
|
528
|
+
statusUpdates?: StatusUpdateSettings;
|
|
524
529
|
}
|
|
525
530
|
declare class AgentError extends Error {
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
531
|
+
code?: string | undefined;
|
|
532
|
+
details?: any | undefined;
|
|
533
|
+
constructor(message: string, code?: string | undefined, details?: any | undefined);
|
|
529
534
|
}
|
|
530
535
|
declare class MaxTurnsExceededError extends AgentError {
|
|
531
|
-
|
|
536
|
+
constructor(maxTurns: number);
|
|
532
537
|
}
|
|
533
538
|
declare class ToolExecutionError extends AgentError {
|
|
534
|
-
|
|
539
|
+
constructor(toolName: string, originalError: Error);
|
|
535
540
|
}
|
|
536
541
|
declare class TransferError extends AgentError {
|
|
537
|
-
|
|
542
|
+
constructor(sourceAgent: string, targetAgent: string, reason: string);
|
|
538
543
|
}
|
|
539
544
|
interface SubAgentInterface {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
545
|
+
config: SubAgentConfig;
|
|
546
|
+
type: 'internal';
|
|
547
|
+
init(): Promise<void>;
|
|
548
|
+
getId(): string;
|
|
549
|
+
getName(): string;
|
|
550
|
+
getDescription(): string;
|
|
551
|
+
getInstructions(): string;
|
|
552
|
+
getTools(): Record<string, AgentTool>;
|
|
553
|
+
getTransfers(): SubAgentInterface[];
|
|
554
|
+
getDelegates(): AllDelegateOutputInterface[];
|
|
555
|
+
getSubAgentDelegates(): SubAgentInterface[];
|
|
556
|
+
getExternalAgentDelegates(): subAgentExternalAgentInterface[];
|
|
557
|
+
getDataComponents(): DataComponentApiInsert[];
|
|
558
|
+
getArtifactComponents(): ArtifactComponentApiInsert[];
|
|
559
|
+
setContext(tenantId: string, projectId: string, baseURL?: string): void;
|
|
560
|
+
addTool(name: string, tool: any): void;
|
|
561
|
+
addTransfer(...agents: SubAgentInterface[]): void;
|
|
562
|
+
addDelegate(...agents: AllDelegateInputInterface[]): void;
|
|
558
563
|
}
|
|
559
564
|
interface ExternalAgentInterface {
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
565
|
+
config: ExternalAgentConfig;
|
|
566
|
+
type: 'external';
|
|
567
|
+
init(): Promise<void>;
|
|
568
|
+
getId(): string;
|
|
569
|
+
getName(): string;
|
|
570
|
+
getDescription(): string;
|
|
571
|
+
getBaseUrl(): string;
|
|
572
|
+
setContext?(tenantId: string, projectId: string): void;
|
|
573
|
+
with(options: {
|
|
574
|
+
headers?: Record<string, string>;
|
|
575
|
+
}): subAgentExternalAgentInterface;
|
|
576
|
+
getCredentialReferenceId(): string | undefined;
|
|
577
|
+
getCredentialReference(): CredentialReferenceApiInsert | undefined;
|
|
573
578
|
}
|
|
574
579
|
type subAgentExternalAgentInterface = {
|
|
575
|
-
|
|
576
|
-
|
|
580
|
+
externalAgent: ExternalAgentInterface;
|
|
581
|
+
headers?: Record<string, string>;
|
|
577
582
|
};
|
|
578
583
|
type subAgentTeamAgentInterface = {
|
|
579
|
-
|
|
580
|
-
|
|
584
|
+
agent: AgentInterface;
|
|
585
|
+
headers?: Record<string, string>;
|
|
581
586
|
};
|
|
582
587
|
interface AgentInterface {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
588
|
+
init(): Promise<void>;
|
|
589
|
+
setConfig(tenantId: string, projectId: string, apiUrl: string): void;
|
|
590
|
+
getId(): string;
|
|
591
|
+
getName(): string;
|
|
592
|
+
getDescription(): string | undefined;
|
|
593
|
+
getTenantId(): string;
|
|
594
|
+
generate(input: MessageInput, options?: GenerateOptions): Promise<string>;
|
|
595
|
+
stream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
596
|
+
generateStream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
597
|
+
getDefaultSubAgent(): SubAgentInterface | undefined;
|
|
598
|
+
getSubAgent(name: string): SubAgentInterface | undefined;
|
|
599
|
+
getSubAgents(): SubAgentInterface[];
|
|
600
|
+
toFullAgentDefinition(): Promise<FullAgentDefinition>;
|
|
601
|
+
with(options: {
|
|
602
|
+
headers?: Record<string, string>;
|
|
603
|
+
}): subAgentTeamAgentInterface;
|
|
599
604
|
}
|
|
600
605
|
interface BuilderToolConfig {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
};
|
|
606
|
+
name: string;
|
|
607
|
+
description: string;
|
|
608
|
+
config: {
|
|
609
|
+
type: 'mcp';
|
|
610
|
+
mcp: {
|
|
611
|
+
server: {
|
|
612
|
+
url: string;
|
|
613
|
+
};
|
|
610
614
|
};
|
|
611
|
-
|
|
615
|
+
};
|
|
616
|
+
parameters?: Record<string, any>;
|
|
612
617
|
}
|
|
613
618
|
interface BuilderRelationConfig {
|
|
614
|
-
|
|
615
|
-
|
|
619
|
+
targetAgent: string;
|
|
620
|
+
relationType: 'transfer' | 'delegate';
|
|
616
621
|
}
|
|
617
622
|
interface BuilderAgentConfig {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
}
|
|
624
|
-
|
|
623
|
+
name: string;
|
|
624
|
+
description: string;
|
|
625
|
+
instructions: string;
|
|
626
|
+
tools: BuilderToolConfig[];
|
|
627
|
+
relations?: BuilderRelationConfig[];
|
|
628
|
+
}
|
|
629
|
+
//#endregion
|
|
630
|
+
//#region src/agent.d.ts
|
|
625
631
|
declare class Agent implements AgentInterface {
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
}
|
|
797
|
-
|
|
632
|
+
private subAgents;
|
|
633
|
+
private agentMap;
|
|
634
|
+
private defaultSubAgent?;
|
|
635
|
+
private baseURL;
|
|
636
|
+
private tenantId;
|
|
637
|
+
private projectId;
|
|
638
|
+
private agentId;
|
|
639
|
+
private agentName;
|
|
640
|
+
private agentDescription?;
|
|
641
|
+
private initialized;
|
|
642
|
+
private contextConfig?;
|
|
643
|
+
private credentials?;
|
|
644
|
+
private models?;
|
|
645
|
+
private statusUpdateSettings?;
|
|
646
|
+
private prompt?;
|
|
647
|
+
private stopWhen?;
|
|
648
|
+
constructor(config: AgentConfig);
|
|
649
|
+
/**
|
|
650
|
+
* Set or update the configuration (tenantId, projectId and apiUrl)
|
|
651
|
+
* This is used by the CLI to inject configuration from inkeep.config.ts
|
|
652
|
+
*/
|
|
653
|
+
setConfig(tenantId: string, projectId: string, apiUrl: string): void;
|
|
654
|
+
/**
|
|
655
|
+
* Convert the Agent to FullAgentDefinition format for the new agent endpoint
|
|
656
|
+
*/
|
|
657
|
+
toFullAgentDefinition(): Promise<FullAgentDefinition>;
|
|
658
|
+
/**
|
|
659
|
+
* Initialize all tools in all agents (especially IPCTools that need MCP server URLs)
|
|
660
|
+
*/
|
|
661
|
+
private initializeAllTools;
|
|
662
|
+
/**
|
|
663
|
+
* Initialize the agent and all agents in the backend using the new agent endpoint
|
|
664
|
+
*/
|
|
665
|
+
init(): Promise<void>;
|
|
666
|
+
/**
|
|
667
|
+
* Generate a response using the default agent
|
|
668
|
+
*/
|
|
669
|
+
generate(input: MessageInput, options?: GenerateOptions): Promise<string>;
|
|
670
|
+
/**
|
|
671
|
+
* Stream a response using the default agent
|
|
672
|
+
*/
|
|
673
|
+
stream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
674
|
+
/**
|
|
675
|
+
* Alias for stream() method for consistency with naming patterns
|
|
676
|
+
*/
|
|
677
|
+
generateStream(input: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
678
|
+
/**
|
|
679
|
+
* Run with a specific agent from the agent
|
|
680
|
+
*/
|
|
681
|
+
runWith(subAgentId: string, input: MessageInput, options?: GenerateOptions): Promise<RunResult>;
|
|
682
|
+
/**
|
|
683
|
+
* Get an agent by name (unified method for all agent types)
|
|
684
|
+
*/
|
|
685
|
+
getSubAgent(name: string): SubAgentInterface | undefined;
|
|
686
|
+
/**
|
|
687
|
+
* Add an agent to the agent
|
|
688
|
+
*/
|
|
689
|
+
addSubAgent(agent: SubAgentInterface): void;
|
|
690
|
+
/**
|
|
691
|
+
* Remove an agent from the agent
|
|
692
|
+
*/
|
|
693
|
+
removeSubAgent(id: string): boolean;
|
|
694
|
+
/**
|
|
695
|
+
* Get all agents in the agent
|
|
696
|
+
*/
|
|
697
|
+
getSubAgents(): SubAgentInterface[];
|
|
698
|
+
/**
|
|
699
|
+
* Get all agent ids (unified method for all agent types)
|
|
700
|
+
*/
|
|
701
|
+
getSubAgentIds(): string[];
|
|
702
|
+
/**
|
|
703
|
+
* Set the default agent
|
|
704
|
+
*/
|
|
705
|
+
setDefaultSubAgent(agent: SubAgentInterface): void;
|
|
706
|
+
/**
|
|
707
|
+
* Get the default agent
|
|
708
|
+
*/
|
|
709
|
+
getDefaultSubAgent(): SubAgentInterface | undefined;
|
|
710
|
+
/**
|
|
711
|
+
* Get the agent ID
|
|
712
|
+
*/
|
|
713
|
+
getId(): string;
|
|
714
|
+
getName(): string;
|
|
715
|
+
getDescription(): string | undefined;
|
|
716
|
+
getTenantId(): string;
|
|
717
|
+
/**
|
|
718
|
+
* Get the agent's model settingsuration
|
|
719
|
+
*/
|
|
720
|
+
getModels(): typeof this.models;
|
|
721
|
+
/**
|
|
722
|
+
* Set the agent's model settingsuration
|
|
723
|
+
*/
|
|
724
|
+
setModels(models: typeof this.models): void;
|
|
725
|
+
/**
|
|
726
|
+
* Get the agent's prompt configuration
|
|
727
|
+
*/
|
|
728
|
+
getPrompt(): string | undefined;
|
|
729
|
+
/**
|
|
730
|
+
* Get the agent's stopWhen configuration
|
|
731
|
+
*/
|
|
732
|
+
getStopWhen(): AgentStopWhen;
|
|
733
|
+
/**
|
|
734
|
+
* Get the agent's status updates configuration
|
|
735
|
+
*/
|
|
736
|
+
getStatusUpdateSettings(): StatusUpdateSettings | undefined;
|
|
737
|
+
/**
|
|
738
|
+
* Get the summarizer model from the agent's model settings
|
|
739
|
+
*/
|
|
740
|
+
getSummarizerModel(): ModelSettings | undefined;
|
|
741
|
+
/**
|
|
742
|
+
* Get agent statistics
|
|
743
|
+
*/
|
|
744
|
+
getStats(): {
|
|
745
|
+
agentCount: number;
|
|
746
|
+
defaultSubAgent: string | null;
|
|
747
|
+
initialized: boolean;
|
|
748
|
+
agentId: string;
|
|
749
|
+
tenantId: string;
|
|
750
|
+
};
|
|
751
|
+
with(options: {
|
|
752
|
+
headers?: Record<string, string>;
|
|
753
|
+
}): subAgentTeamAgentInterface;
|
|
754
|
+
/**
|
|
755
|
+
* Validate the agent configuration
|
|
756
|
+
*/
|
|
757
|
+
validate(): {
|
|
758
|
+
valid: boolean;
|
|
759
|
+
errors: string[];
|
|
760
|
+
};
|
|
761
|
+
private _init;
|
|
762
|
+
/**
|
|
763
|
+
* Type guard to check if an agent is an internal AgentInterface
|
|
764
|
+
*/
|
|
765
|
+
isInternalAgent(agent: AllDelegateInputInterface): agent is SubAgentInterface;
|
|
766
|
+
/**
|
|
767
|
+
* Get project-level model settingsuration defaults
|
|
768
|
+
*/
|
|
769
|
+
private getProjectModelDefaults;
|
|
770
|
+
/**
|
|
771
|
+
* Get project-level stopWhen configuration defaults
|
|
772
|
+
*/
|
|
773
|
+
private getProjectStopWhenDefaults;
|
|
774
|
+
/**
|
|
775
|
+
* Apply model inheritance hierarchy: Project -> Agent -> Agent
|
|
776
|
+
*/
|
|
777
|
+
private applyModelInheritance;
|
|
778
|
+
/**
|
|
779
|
+
* Apply stopWhen inheritance hierarchy: Project -> Agent -> Agent
|
|
780
|
+
*/
|
|
781
|
+
private applyStopWhenInheritance;
|
|
782
|
+
/**
|
|
783
|
+
* Propagate agent-level model settings to agents (supporting partial inheritance)
|
|
784
|
+
*/
|
|
785
|
+
private propagateModelSettingsToAgent;
|
|
786
|
+
/**
|
|
787
|
+
* Immediately propagate agent-level models to all agents during construction
|
|
788
|
+
*/
|
|
789
|
+
private propagateImmediateModelSettings;
|
|
790
|
+
/**
|
|
791
|
+
* Execute agent using the backend system instead of local runner
|
|
792
|
+
*/
|
|
793
|
+
private executeWithBackend;
|
|
794
|
+
/**
|
|
795
|
+
* Parse streaming response in SSE format
|
|
796
|
+
*/
|
|
797
|
+
private parseStreamingResponse;
|
|
798
|
+
/**
|
|
799
|
+
* Normalize input messages to the expected format
|
|
800
|
+
*/
|
|
801
|
+
private normalizeMessages;
|
|
802
|
+
}
|
|
803
|
+
//#endregion
|
|
804
|
+
//#region src/project.d.ts
|
|
798
805
|
/**
|
|
799
806
|
* Project configuration interface for the SDK
|
|
800
807
|
*/
|
|
801
808
|
interface ProjectConfig {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
809
|
+
id: string;
|
|
810
|
+
name: string;
|
|
811
|
+
description?: string;
|
|
812
|
+
models?: {
|
|
813
|
+
base?: ModelSettings;
|
|
814
|
+
structuredOutput?: ModelSettings;
|
|
815
|
+
summarizer?: ModelSettings;
|
|
816
|
+
};
|
|
817
|
+
stopWhen?: StopWhen;
|
|
818
|
+
agents?: () => Agent[];
|
|
819
|
+
tools?: () => Tool[];
|
|
820
|
+
externalAgents?: () => ExternalAgent[];
|
|
821
|
+
dataComponents?: () => DataComponent[];
|
|
822
|
+
artifactComponents?: () => ArtifactComponent[];
|
|
823
|
+
credentialReferences?: () => CredentialReferenceApiInsert[];
|
|
817
824
|
}
|
|
818
825
|
/**
|
|
819
826
|
* Project interface for operations
|
|
820
827
|
*/
|
|
821
828
|
interface ProjectInterface {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
829
|
+
init(): Promise<void>;
|
|
830
|
+
setConfig(tenantId: string, apiUrl: string): void;
|
|
831
|
+
getId(): string;
|
|
832
|
+
getName(): string;
|
|
833
|
+
getDescription(): string | undefined;
|
|
834
|
+
getTenantId(): string;
|
|
835
|
+
getModels(): ProjectConfig['models'];
|
|
836
|
+
getStopWhen(): ProjectConfig['stopWhen'];
|
|
837
|
+
getAgents(): Agent[];
|
|
838
|
+
addAgent(agent: Agent): void;
|
|
839
|
+
removeAgent(id: string): boolean;
|
|
840
|
+
getStats(): {
|
|
841
|
+
projectId: string;
|
|
842
|
+
tenantId: string;
|
|
843
|
+
agentCount: number;
|
|
844
|
+
initialized: boolean;
|
|
845
|
+
};
|
|
846
|
+
validate(): {
|
|
847
|
+
valid: boolean;
|
|
848
|
+
errors: string[];
|
|
849
|
+
};
|
|
843
850
|
}
|
|
844
851
|
/**
|
|
845
852
|
* Project class for managing agent projects
|
|
@@ -867,154 +874,156 @@ interface ProjectInterface {
|
|
|
867
874
|
* ```
|
|
868
875
|
*/
|
|
869
876
|
declare class Project implements ProjectInterface {
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
}
|
|
1000
|
-
|
|
877
|
+
readonly __type: "project";
|
|
878
|
+
private projectId;
|
|
879
|
+
private projectName;
|
|
880
|
+
private projectDescription?;
|
|
881
|
+
private tenantId;
|
|
882
|
+
private baseURL;
|
|
883
|
+
private apiKey?;
|
|
884
|
+
private initialized;
|
|
885
|
+
private models?;
|
|
886
|
+
private stopWhen?;
|
|
887
|
+
private agents;
|
|
888
|
+
private agentMap;
|
|
889
|
+
private credentialReferences?;
|
|
890
|
+
private projectTools;
|
|
891
|
+
private projectDataComponents;
|
|
892
|
+
private projectArtifactComponents;
|
|
893
|
+
private projectExternalAgents;
|
|
894
|
+
private externalAgentMap;
|
|
895
|
+
constructor(config: ProjectConfig);
|
|
896
|
+
/**
|
|
897
|
+
* Set or update the configuration (tenantId and apiUrl)
|
|
898
|
+
* This is used by the CLI to inject configuration from inkeep.config.ts
|
|
899
|
+
*/
|
|
900
|
+
setConfig(tenantId: string, apiUrl: string, models?: ProjectConfig['models'], apiKey?: string): void;
|
|
901
|
+
/**
|
|
902
|
+
* Set credential references for the project
|
|
903
|
+
* This is used by the CLI to inject environment-specific credentials
|
|
904
|
+
*/
|
|
905
|
+
setCredentials(credentials: Record<string, CredentialReferenceApiInsert>): void;
|
|
906
|
+
/**
|
|
907
|
+
* Initialize the project and create/update it in the backend using full project approach
|
|
908
|
+
*/
|
|
909
|
+
init(): Promise<void>;
|
|
910
|
+
/**
|
|
911
|
+
* Get the project ID
|
|
912
|
+
*/
|
|
913
|
+
getId(): string;
|
|
914
|
+
/**
|
|
915
|
+
* Get the project name
|
|
916
|
+
*/
|
|
917
|
+
getName(): string;
|
|
918
|
+
/**
|
|
919
|
+
* Get the project description
|
|
920
|
+
*/
|
|
921
|
+
getDescription(): string | undefined;
|
|
922
|
+
/**
|
|
923
|
+
* Get the tenant ID
|
|
924
|
+
*/
|
|
925
|
+
getTenantId(): string;
|
|
926
|
+
/**
|
|
927
|
+
* Get the project's model configuration
|
|
928
|
+
*/
|
|
929
|
+
getModels(): ProjectConfig['models'];
|
|
930
|
+
/**
|
|
931
|
+
* Set the project's model configuration
|
|
932
|
+
*/
|
|
933
|
+
setModels(models: ProjectConfig['models']): void;
|
|
934
|
+
/**
|
|
935
|
+
* Get the project's stopWhen configuration
|
|
936
|
+
*/
|
|
937
|
+
getStopWhen(): ProjectConfig['stopWhen'];
|
|
938
|
+
/**
|
|
939
|
+
* Set the project's stopWhen configuration
|
|
940
|
+
*/
|
|
941
|
+
setStopWhen(stopWhen: ProjectConfig['stopWhen']): void;
|
|
942
|
+
/**
|
|
943
|
+
* Get credential tracking information
|
|
944
|
+
*/
|
|
945
|
+
getCredentialTracking(): Promise<{
|
|
946
|
+
credentials: Record<string, any>;
|
|
947
|
+
usage: Record<string, Array<{
|
|
948
|
+
type: string;
|
|
949
|
+
id: string;
|
|
950
|
+
agentId?: string;
|
|
951
|
+
}>>;
|
|
952
|
+
}>;
|
|
953
|
+
getFullDefinition(): Promise<FullProjectDefinition>;
|
|
954
|
+
/**
|
|
955
|
+
* Get all agent in the project
|
|
956
|
+
*/
|
|
957
|
+
getAgents(): Agent[];
|
|
958
|
+
/**
|
|
959
|
+
* Get all external agents in the project
|
|
960
|
+
*/
|
|
961
|
+
getExternalAgents(): ExternalAgent[];
|
|
962
|
+
/**
|
|
963
|
+
* Get an external agent by ID
|
|
964
|
+
*/
|
|
965
|
+
getExternalAgent(id: string): ExternalAgent | undefined;
|
|
966
|
+
/**
|
|
967
|
+
* Add an external agent to the project
|
|
968
|
+
*/
|
|
969
|
+
addExternalAgent(externalAgent: ExternalAgent): void;
|
|
970
|
+
/**
|
|
971
|
+
* Remove an external agent from the project
|
|
972
|
+
*/
|
|
973
|
+
removeExternalAgent(id: string): boolean;
|
|
974
|
+
/**
|
|
975
|
+
* Get an agent by ID
|
|
976
|
+
*/
|
|
977
|
+
getAgent(id: string): Agent | undefined;
|
|
978
|
+
/**
|
|
979
|
+
* Add an agent to the project
|
|
980
|
+
*/
|
|
981
|
+
addAgent(agent: Agent): void;
|
|
982
|
+
/**
|
|
983
|
+
* Remove an agent from the project
|
|
984
|
+
*/
|
|
985
|
+
removeAgent(id: string): boolean;
|
|
986
|
+
/**
|
|
987
|
+
* Get project statistics
|
|
988
|
+
*/
|
|
989
|
+
getStats(): {
|
|
990
|
+
projectId: string;
|
|
991
|
+
tenantId: string;
|
|
992
|
+
agentCount: number;
|
|
993
|
+
initialized: boolean;
|
|
994
|
+
};
|
|
995
|
+
/**
|
|
996
|
+
* Validate the project configuration
|
|
997
|
+
*/
|
|
998
|
+
validate(): {
|
|
999
|
+
valid: boolean;
|
|
1000
|
+
errors: string[];
|
|
1001
|
+
};
|
|
1002
|
+
/**
|
|
1003
|
+
* Convert the Project to FullProjectDefinition format
|
|
1004
|
+
*/
|
|
1005
|
+
private toFullProjectDefinition;
|
|
1006
|
+
}
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region src/status-component.d.ts
|
|
1001
1009
|
type StatusComponentConfigWithZod = Omit<StatusComponent$1, 'detailsSchema'> & {
|
|
1002
|
-
|
|
1010
|
+
detailsSchema?: Record<string, unknown> | z.ZodObject<any>;
|
|
1003
1011
|
};
|
|
1004
1012
|
interface StatusComponentInterface {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1013
|
+
config: StatusComponent$1;
|
|
1014
|
+
getType(): string;
|
|
1015
|
+
getDescription(): string | undefined;
|
|
1016
|
+
getDetailsSchema(): StatusComponent$1['detailsSchema'];
|
|
1009
1017
|
}
|
|
1010
1018
|
declare class StatusComponent implements StatusComponentInterface {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1019
|
+
config: StatusComponent$1;
|
|
1020
|
+
constructor(config: StatusComponentConfigWithZod);
|
|
1021
|
+
getType(): string;
|
|
1022
|
+
getDescription(): string | undefined;
|
|
1023
|
+
getDetailsSchema(): StatusComponent$1['detailsSchema'];
|
|
1016
1024
|
}
|
|
1017
|
-
|
|
1025
|
+
//#endregion
|
|
1026
|
+
//#region src/builderFunctions.d.ts
|
|
1018
1027
|
/**
|
|
1019
1028
|
* Helper function to create agent - OpenAI style
|
|
1020
1029
|
*/
|
|
@@ -1093,16 +1102,16 @@ declare function subAgent(config: SubAgentConfig): SubAgent;
|
|
|
1093
1102
|
* ```
|
|
1094
1103
|
*/
|
|
1095
1104
|
declare function credential(config: CredentialReferenceApiInsert): {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1105
|
+
id: string;
|
|
1106
|
+
name: string;
|
|
1107
|
+
credentialStoreId: string;
|
|
1108
|
+
type: "memory" | "keychain" | "nango";
|
|
1109
|
+
retrievalParams?: Record<string, unknown> | null | undefined;
|
|
1110
|
+
toolId?: string | null | undefined;
|
|
1111
|
+
userId?: string | null | undefined;
|
|
1112
|
+
createdBy?: string | null | undefined;
|
|
1113
|
+
createdAt?: string | undefined;
|
|
1114
|
+
updatedAt?: string | undefined;
|
|
1106
1115
|
};
|
|
1107
1116
|
/**
|
|
1108
1117
|
* Creates an MCP (Model Context Protocol) server for tool functionality.
|
|
@@ -1282,7 +1291,8 @@ declare function agentMcp(config: AgentMcpConfig): AgentMcpConfig;
|
|
|
1282
1291
|
* ```
|
|
1283
1292
|
*/
|
|
1284
1293
|
declare function functionTool(config: FunctionToolConfig): FunctionTool;
|
|
1285
|
-
|
|
1294
|
+
//#endregion
|
|
1295
|
+
//#region src/credential-provider.d.ts
|
|
1286
1296
|
/**
|
|
1287
1297
|
* InkeepCredentialProvider - Abstraction for Credential Management
|
|
1288
1298
|
*
|
|
@@ -1309,23 +1319,23 @@ declare function functionTool(config: FunctionToolConfig): FunctionTool;
|
|
|
1309
1319
|
* This is a simplified version for SDK customers
|
|
1310
1320
|
*/
|
|
1311
1321
|
interface CredentialStore {
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1322
|
+
/** Unique identifier for this credential store */
|
|
1323
|
+
readonly id: string;
|
|
1324
|
+
/** Type of credential store */
|
|
1325
|
+
readonly type: CredentialProviderType;
|
|
1326
|
+
/** Get a credential by key */
|
|
1327
|
+
get(key: string): Promise<string | null>;
|
|
1328
|
+
/** Set a credential */
|
|
1329
|
+
set(key: string, value: string, metadata?: Record<string, string>): Promise<void>;
|
|
1330
|
+
/** Check if a credential exists */
|
|
1331
|
+
has(key: string): Promise<boolean>;
|
|
1332
|
+
/** Delete a credential */
|
|
1333
|
+
delete(key: string): Promise<boolean>;
|
|
1334
|
+
/** Check if the credential store is available */
|
|
1335
|
+
checkAvailability(): Promise<{
|
|
1336
|
+
available: boolean;
|
|
1337
|
+
reason?: string;
|
|
1338
|
+
}>;
|
|
1329
1339
|
}
|
|
1330
1340
|
/**
|
|
1331
1341
|
* Supported credential provider types
|
|
@@ -1335,40 +1345,40 @@ type CredentialProviderType = 'memory' | 'keychain' | 'nango' | 'custom';
|
|
|
1335
1345
|
* Configuration for memory-based credential storage
|
|
1336
1346
|
*/
|
|
1337
1347
|
interface MemoryCredentialConfig {
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1348
|
+
type: 'memory';
|
|
1349
|
+
/** Optional store ID (defaults to 'memory-default') */
|
|
1350
|
+
id?: string;
|
|
1341
1351
|
}
|
|
1342
1352
|
/**
|
|
1343
1353
|
* Configuration for keychain-based credential storage
|
|
1344
1354
|
*/
|
|
1345
1355
|
interface KeychainCredentialConfig {
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1356
|
+
type: 'keychain';
|
|
1357
|
+
/** Optional store ID (defaults to 'keychain-default') */
|
|
1358
|
+
id?: string;
|
|
1359
|
+
/** Optional service name for keychain entries */
|
|
1360
|
+
serviceName?: string;
|
|
1351
1361
|
}
|
|
1352
1362
|
/**
|
|
1353
1363
|
* Configuration for Nango-based credential storage (OAuth management)
|
|
1354
1364
|
* Note: Using Nango requires the @nangohq/node package to be installed
|
|
1355
1365
|
*/
|
|
1356
1366
|
interface NangoCredentialConfig {
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1367
|
+
type: 'nango';
|
|
1368
|
+
/** Optional store ID (defaults to 'nango-default') */
|
|
1369
|
+
id?: string;
|
|
1370
|
+
/** Nango secret key (defaults to NANGO_SECRET_KEY env var) */
|
|
1371
|
+
secretKey?: string;
|
|
1372
|
+
/** Nango API URL (defaults to https://api.nango.dev) */
|
|
1373
|
+
apiUrl?: string;
|
|
1364
1374
|
}
|
|
1365
1375
|
/**
|
|
1366
1376
|
* Configuration for custom credential provider
|
|
1367
1377
|
*/
|
|
1368
1378
|
interface CustomCredentialConfig {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1379
|
+
type: 'custom';
|
|
1380
|
+
/** Custom credential store implementation */
|
|
1381
|
+
store: CredentialStore;
|
|
1372
1382
|
}
|
|
1373
1383
|
/**
|
|
1374
1384
|
* Union type for all credential provider configurations
|
|
@@ -1396,59 +1406,59 @@ type CredentialProviderConfig = MemoryCredentialConfig | KeychainCredentialConfi
|
|
|
1396
1406
|
* ```
|
|
1397
1407
|
*/
|
|
1398
1408
|
declare class InkeepCredentialProvider implements CredentialStore {
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1409
|
+
private store;
|
|
1410
|
+
constructor(config?: CredentialProviderConfig);
|
|
1411
|
+
/**
|
|
1412
|
+
* Create the appropriate store based on configuration
|
|
1413
|
+
*/
|
|
1414
|
+
private createStore;
|
|
1415
|
+
/**
|
|
1416
|
+
* Create keychain store with dynamic import
|
|
1417
|
+
*/
|
|
1418
|
+
private createKeychainStore;
|
|
1419
|
+
/**
|
|
1420
|
+
* Create Nango store with dynamic import
|
|
1421
|
+
*/
|
|
1422
|
+
private createNangoStore;
|
|
1423
|
+
get id(): string;
|
|
1424
|
+
get type(): CredentialProviderType;
|
|
1425
|
+
/**
|
|
1426
|
+
* Get a credential by key
|
|
1427
|
+
* @param key - The credential key
|
|
1428
|
+
* @returns The credential value or null if not found
|
|
1429
|
+
*/
|
|
1430
|
+
get(key: string): Promise<string | null>;
|
|
1431
|
+
/**
|
|
1432
|
+
* Set a credential
|
|
1433
|
+
* @param key - The credential key
|
|
1434
|
+
* @param value - The credential value
|
|
1435
|
+
* @param metadata - Optional metadata
|
|
1436
|
+
*/
|
|
1437
|
+
set(key: string, value: string, metadata?: Record<string, string>): Promise<void>;
|
|
1438
|
+
/**
|
|
1439
|
+
* Check if a credential exists
|
|
1440
|
+
* @param key - The credential key
|
|
1441
|
+
* @returns True if the credential exists
|
|
1442
|
+
*/
|
|
1443
|
+
has(key: string): Promise<boolean>;
|
|
1444
|
+
/**
|
|
1445
|
+
* Delete a credential
|
|
1446
|
+
* @param key - The credential key
|
|
1447
|
+
* @returns True if the credential was deleted
|
|
1448
|
+
*/
|
|
1449
|
+
delete(key: string): Promise<boolean>;
|
|
1450
|
+
/**
|
|
1451
|
+
* Check if the credential store is available and functional
|
|
1452
|
+
* @returns Availability status
|
|
1453
|
+
*/
|
|
1454
|
+
checkAvailability(): Promise<{
|
|
1455
|
+
available: boolean;
|
|
1456
|
+
reason?: string;
|
|
1457
|
+
}>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Get the underlying store (for advanced use cases)
|
|
1460
|
+
*/
|
|
1461
|
+
getStore(): CredentialStore;
|
|
1452
1462
|
}
|
|
1453
1463
|
/**
|
|
1454
1464
|
* Factory function to create an InkeepCredentialProvider
|
|
@@ -1456,7 +1466,8 @@ declare class InkeepCredentialProvider implements CredentialStore {
|
|
|
1456
1466
|
* @returns A new InkeepCredentialProvider instance
|
|
1457
1467
|
*/
|
|
1458
1468
|
declare function createCredentialProvider(config?: CredentialProviderConfig): InkeepCredentialProvider;
|
|
1459
|
-
|
|
1469
|
+
//#endregion
|
|
1470
|
+
//#region src/credential-ref.d.ts
|
|
1460
1471
|
/**
|
|
1461
1472
|
* Credential Reference System
|
|
1462
1473
|
*
|
|
@@ -1469,8 +1480,8 @@ declare function createCredentialProvider(config?: CredentialProviderConfig): In
|
|
|
1469
1480
|
* The actual credential will be resolved from the environment file at push time.
|
|
1470
1481
|
*/
|
|
1471
1482
|
interface CredentialReference {
|
|
1472
|
-
|
|
1473
|
-
|
|
1483
|
+
__type: 'credential-ref';
|
|
1484
|
+
id: string;
|
|
1474
1485
|
}
|
|
1475
1486
|
/**
|
|
1476
1487
|
* Create a reference to a credential by its ID.
|
|
@@ -1498,53 +1509,46 @@ declare function isCredentialReference(value: any): value is CredentialReference
|
|
|
1498
1509
|
* Type helper to extract credential IDs from environment configuration
|
|
1499
1510
|
*/
|
|
1500
1511
|
type ExtractCredentialIds<T> = T extends {
|
|
1501
|
-
|
|
1512
|
+
credentials?: infer C;
|
|
1502
1513
|
} ? C extends Record<string, any> ? keyof C : never : never;
|
|
1503
1514
|
/**
|
|
1504
1515
|
* Type helper to create a union of all available credential IDs from multiple environments
|
|
1505
1516
|
*/
|
|
1506
|
-
type UnionCredentialIds<T extends Record<string, any>> = {
|
|
1507
|
-
[K in keyof T]: ExtractCredentialIds<T[K]>;
|
|
1508
|
-
}[keyof T];
|
|
1517
|
+
type UnionCredentialIds<T extends Record<string, any>> = { [K in keyof T]: ExtractCredentialIds<T[K]> }[keyof T];
|
|
1509
1518
|
/**
|
|
1510
1519
|
* Type helper to extract tool IDs from environment configuration
|
|
1511
1520
|
*/
|
|
1512
1521
|
type ExtractMcpServerIds<T> = T extends {
|
|
1513
|
-
|
|
1522
|
+
mcpServers?: infer T;
|
|
1514
1523
|
} ? T extends Record<string, any> ? keyof T : never : never;
|
|
1515
1524
|
/**
|
|
1516
1525
|
* Type helper to create a union of all available tool IDs from multiple environments
|
|
1517
1526
|
*/
|
|
1518
|
-
type UnionMcpServerIds<T extends Record<string, any>> = {
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1527
|
+
type UnionMcpServerIds<T extends Record<string, any>> = { [K in keyof T]: ExtractMcpServerIds<T[K]> }[keyof T];
|
|
1528
|
+
//#endregion
|
|
1529
|
+
//#region src/environment-settings.d.ts
|
|
1522
1530
|
interface EnvironmentSettingsConfig {
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1531
|
+
credentials?: {
|
|
1532
|
+
[settingId: string]: CredentialReferenceApiInsert;
|
|
1533
|
+
};
|
|
1534
|
+
mcpServers?: {
|
|
1535
|
+
[mcpServerId: string]: Tool;
|
|
1536
|
+
};
|
|
1529
1537
|
}
|
|
1530
1538
|
/**
|
|
1531
1539
|
* Create a setting helper with TypeScript autocomplete
|
|
1532
1540
|
*/
|
|
1533
1541
|
declare function createEnvironmentSettings<T extends Record<string, EnvironmentSettingsConfig>>(environments: T): {
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1542
|
+
getEnvironmentCredential: (key: UnionCredentialIds<T>) => CredentialReferenceApiInsert;
|
|
1543
|
+
getEnvironmentMcp: (key: UnionMcpServerIds<T>) => Tool;
|
|
1544
|
+
getEnvironmentSetting: (key: UnionCredentialIds<T>) => CredentialReferenceApiInsert;
|
|
1537
1545
|
};
|
|
1538
1546
|
/**
|
|
1539
1547
|
* Create type-safe environment configurations
|
|
1540
1548
|
*/
|
|
1541
1549
|
declare function registerEnvironmentSettings<T extends EnvironmentSettingsConfig>(config: T): T;
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
* Client-side functions for interacting with the Full Project API
|
|
1545
|
-
* These functions make HTTP requests to the server instead of direct database calls
|
|
1546
|
-
*/
|
|
1547
|
-
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region src/projectFullClient.d.ts
|
|
1548
1552
|
/**
|
|
1549
1553
|
* Create a full project via HTTP API
|
|
1550
1554
|
*/
|
|
@@ -1561,44 +1565,46 @@ declare function getFullProjectViaAPI(tenantId: string, apiUrl: string, projectI
|
|
|
1561
1565
|
* Delete a full project via HTTP API
|
|
1562
1566
|
*/
|
|
1563
1567
|
declare function deleteFullProjectViaAPI(tenantId: string, apiUrl: string, projectId: string, apiKey?: string): Promise<void>;
|
|
1564
|
-
|
|
1568
|
+
//#endregion
|
|
1569
|
+
//#region src/runner.d.ts
|
|
1565
1570
|
declare class Runner {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1571
|
+
/**
|
|
1572
|
+
* Run an agent until completion, handling transfers and tool calls
|
|
1573
|
+
* Similar to OpenAI's Runner.run() pattern
|
|
1574
|
+
* NOTE: This now requires an agent instead of an agent
|
|
1575
|
+
*/
|
|
1576
|
+
static run(agent: AgentInterface, messages: MessageInput, options?: GenerateOptions): Promise<RunResult>;
|
|
1577
|
+
/**
|
|
1578
|
+
* Stream an agent's response
|
|
1579
|
+
*/
|
|
1580
|
+
static stream(agent: AgentInterface, messages: MessageInput, options?: GenerateOptions): Promise<StreamResponse>;
|
|
1581
|
+
/**
|
|
1582
|
+
* Execute multiple agent in parallel and return the first successful result
|
|
1583
|
+
*/
|
|
1584
|
+
static raceAgents(agent: AgentInterface[], messages: MessageInput, options?: GenerateOptions): Promise<RunResult>;
|
|
1585
|
+
private static normalizeToMessageHistory;
|
|
1586
|
+
/**
|
|
1587
|
+
* Validate agent configuration before running
|
|
1588
|
+
*/
|
|
1589
|
+
static validateAgent(agent: AgentInterface): {
|
|
1590
|
+
valid: boolean;
|
|
1591
|
+
errors: string[];
|
|
1592
|
+
};
|
|
1593
|
+
/**
|
|
1594
|
+
* Get execution statistics for an agent
|
|
1595
|
+
*/
|
|
1596
|
+
static getExecutionStats(agent: AgentInterface, messages: MessageInput, options?: GenerateOptions): Promise<{
|
|
1597
|
+
estimatedTurns: number;
|
|
1598
|
+
estimatedTokens: number;
|
|
1599
|
+
subAgentCount: number;
|
|
1600
|
+
defaultSubAgent: string | undefined;
|
|
1601
|
+
}>;
|
|
1597
1602
|
}
|
|
1598
1603
|
declare const run: typeof Runner.run;
|
|
1599
1604
|
declare const stream: typeof Runner.stream;
|
|
1600
1605
|
declare const raceAgents: typeof Runner.raceAgents;
|
|
1601
|
-
|
|
1606
|
+
//#endregion
|
|
1607
|
+
//#region src/telemetry-provider.d.ts
|
|
1602
1608
|
/**
|
|
1603
1609
|
* TelemetryProvider - Abstraction for Telemetry/Observability
|
|
1604
1610
|
*
|
|
@@ -1626,120 +1632,120 @@ declare const raceAgents: typeof Runner.raceAgents;
|
|
|
1626
1632
|
* Span status codes
|
|
1627
1633
|
*/
|
|
1628
1634
|
declare const SpanStatus: {
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1635
|
+
readonly OK: "ok";
|
|
1636
|
+
readonly ERROR: "error";
|
|
1637
|
+
readonly UNSET: "unset";
|
|
1632
1638
|
};
|
|
1633
1639
|
type SpanStatusType = (typeof SpanStatus)[keyof typeof SpanStatus];
|
|
1634
1640
|
/**
|
|
1635
1641
|
* Span interface for tracing
|
|
1636
1642
|
*/
|
|
1637
1643
|
interface TelemetrySpan {
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1644
|
+
/** Set span attributes */
|
|
1645
|
+
setAttributes(attributes: Record<string, unknown>): TelemetrySpan;
|
|
1646
|
+
/** Set a single attribute */
|
|
1647
|
+
setAttribute(key: string, value: unknown): TelemetrySpan;
|
|
1648
|
+
/** Record an exception */
|
|
1649
|
+
recordException(error: Error): TelemetrySpan;
|
|
1650
|
+
/** Set span status */
|
|
1651
|
+
setStatus(status: SpanStatusType, message?: string): TelemetrySpan;
|
|
1652
|
+
/** Add an event to the span */
|
|
1653
|
+
addEvent(name: string, attributes?: Record<string, unknown>): TelemetrySpan;
|
|
1654
|
+
/** End the span */
|
|
1655
|
+
end(): void;
|
|
1656
|
+
/** Check if span is recording */
|
|
1657
|
+
isRecording(): boolean;
|
|
1658
|
+
/** Update span name */
|
|
1659
|
+
updateName(name: string): TelemetrySpan;
|
|
1654
1660
|
}
|
|
1655
1661
|
/**
|
|
1656
1662
|
* Span options
|
|
1657
1663
|
*/
|
|
1658
1664
|
interface SpanOptions {
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1665
|
+
/** Span attributes */
|
|
1666
|
+
attributes?: Record<string, unknown>;
|
|
1667
|
+
/** Parent span (for context propagation) */
|
|
1668
|
+
parent?: TelemetrySpan;
|
|
1663
1669
|
}
|
|
1664
1670
|
/**
|
|
1665
1671
|
* Tracer interface for creating spans
|
|
1666
1672
|
*/
|
|
1667
1673
|
interface TelemetryTracer {
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1674
|
+
/** Start a new active span and execute callback */
|
|
1675
|
+
startActiveSpan<T>(name: string, fn: (span: TelemetrySpan) => T): T;
|
|
1676
|
+
startActiveSpan<T>(name: string, options: SpanOptions, fn: (span: TelemetrySpan) => T): T;
|
|
1677
|
+
/** Start a new span without making it active */
|
|
1678
|
+
startSpan(name: string, options?: SpanOptions): TelemetrySpan;
|
|
1673
1679
|
}
|
|
1674
1680
|
/**
|
|
1675
1681
|
* Logger interface for structured logging
|
|
1676
1682
|
*/
|
|
1677
1683
|
interface TelemetryLogger {
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1684
|
+
debug(message: string, context?: Record<string, unknown>): void;
|
|
1685
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
1686
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
1687
|
+
error(message: string, context?: Record<string, unknown>): void;
|
|
1682
1688
|
}
|
|
1683
1689
|
/**
|
|
1684
1690
|
* Metrics interface for recording measurements
|
|
1685
1691
|
*/
|
|
1686
1692
|
interface TelemetryMetrics {
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
+
/** Increment a counter */
|
|
1694
|
+
increment(name: string, value?: number, attributes?: Record<string, unknown>): void;
|
|
1695
|
+
/** Record a gauge value */
|
|
1696
|
+
gauge(name: string, value: number, attributes?: Record<string, unknown>): void;
|
|
1697
|
+
/** Record a histogram value */
|
|
1698
|
+
histogram(name: string, value: number, attributes?: Record<string, unknown>): void;
|
|
1693
1699
|
}
|
|
1694
1700
|
/**
|
|
1695
1701
|
* Main telemetry provider interface
|
|
1696
1702
|
*/
|
|
1697
1703
|
interface TelemetryProvider {
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1704
|
+
/** Get a tracer for creating spans */
|
|
1705
|
+
getTracer(name: string, version?: string): TelemetryTracer;
|
|
1706
|
+
/** Get a logger for structured logging */
|
|
1707
|
+
getLogger(name: string): TelemetryLogger;
|
|
1708
|
+
/** Get metrics for recording measurements */
|
|
1709
|
+
getMetrics(name: string): TelemetryMetrics;
|
|
1710
|
+
/** Shutdown the telemetry provider */
|
|
1711
|
+
shutdown(): Promise<void>;
|
|
1712
|
+
/** Check if telemetry is enabled */
|
|
1713
|
+
isEnabled(): boolean;
|
|
1708
1714
|
}
|
|
1709
1715
|
/**
|
|
1710
1716
|
* Configuration for telemetry provider
|
|
1711
1717
|
*/
|
|
1712
1718
|
interface TelemetryConfig {
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1719
|
+
/** Whether telemetry is enabled (default: false) */
|
|
1720
|
+
enabled?: boolean;
|
|
1721
|
+
/** Service name for identifying the source */
|
|
1722
|
+
serviceName?: string;
|
|
1723
|
+
/** Service version */
|
|
1724
|
+
serviceVersion?: string;
|
|
1725
|
+
/** Custom provider implementation */
|
|
1726
|
+
provider?: TelemetryProvider;
|
|
1721
1727
|
}
|
|
1722
1728
|
/**
|
|
1723
1729
|
* No-op telemetry provider (default)
|
|
1724
1730
|
*/
|
|
1725
1731
|
declare class NoOpTelemetryProvider implements TelemetryProvider {
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1732
|
+
getTracer(_name: string, _version?: string): TelemetryTracer;
|
|
1733
|
+
getLogger(_name: string): TelemetryLogger;
|
|
1734
|
+
getMetrics(_name: string): TelemetryMetrics;
|
|
1735
|
+
shutdown(): Promise<void>;
|
|
1736
|
+
isEnabled(): boolean;
|
|
1731
1737
|
}
|
|
1732
1738
|
/**
|
|
1733
1739
|
* Console-based telemetry provider for development/debugging
|
|
1734
1740
|
*/
|
|
1735
1741
|
declare class ConsoleTelemetryProvider implements TelemetryProvider {
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1742
|
+
private serviceName;
|
|
1743
|
+
constructor(serviceName?: string);
|
|
1744
|
+
getTracer(name: string, _version?: string): TelemetryTracer;
|
|
1745
|
+
getLogger(name: string): TelemetryLogger;
|
|
1746
|
+
getMetrics(name: string): TelemetryMetrics;
|
|
1747
|
+
shutdown(): Promise<void>;
|
|
1748
|
+
isEnabled(): boolean;
|
|
1743
1749
|
}
|
|
1744
1750
|
/**
|
|
1745
1751
|
* InkeepTelemetryProvider - Main telemetry management class
|
|
@@ -1748,36 +1754,36 @@ declare class ConsoleTelemetryProvider implements TelemetryProvider {
|
|
|
1748
1754
|
* Telemetry is OPT-IN - by default, a no-op provider is used.
|
|
1749
1755
|
*/
|
|
1750
1756
|
declare class InkeepTelemetryProvider {
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1757
|
+
private provider;
|
|
1758
|
+
constructor(config?: TelemetryConfig);
|
|
1759
|
+
/**
|
|
1760
|
+
* Get a tracer for creating spans
|
|
1761
|
+
*/
|
|
1762
|
+
getTracer(name: string, version?: string): TelemetryTracer;
|
|
1763
|
+
/**
|
|
1764
|
+
* Get a logger for structured logging
|
|
1765
|
+
*/
|
|
1766
|
+
getLogger(name: string): TelemetryLogger;
|
|
1767
|
+
/**
|
|
1768
|
+
* Get metrics recorder
|
|
1769
|
+
*/
|
|
1770
|
+
getMetrics(name: string): TelemetryMetrics;
|
|
1771
|
+
/**
|
|
1772
|
+
* Check if telemetry is enabled
|
|
1773
|
+
*/
|
|
1774
|
+
isEnabled(): boolean;
|
|
1775
|
+
/**
|
|
1776
|
+
* Shutdown the provider
|
|
1777
|
+
*/
|
|
1778
|
+
shutdown(): Promise<void>;
|
|
1779
|
+
/**
|
|
1780
|
+
* Get the underlying provider
|
|
1781
|
+
*/
|
|
1782
|
+
getProvider(): TelemetryProvider;
|
|
1783
|
+
/**
|
|
1784
|
+
* Set as the global telemetry provider
|
|
1785
|
+
*/
|
|
1786
|
+
setAsGlobal(): void;
|
|
1781
1787
|
}
|
|
1782
1788
|
/**
|
|
1783
1789
|
* Get the global telemetry provider
|
|
@@ -1799,14 +1805,14 @@ declare function createConsoleTelemetryProvider(serviceName?: string): InkeepTel
|
|
|
1799
1805
|
* Configuration for OpenTelemetry provider
|
|
1800
1806
|
*/
|
|
1801
1807
|
interface OpenTelemetryConfig {
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1808
|
+
/** Service name */
|
|
1809
|
+
serviceName: string;
|
|
1810
|
+
/** Service version */
|
|
1811
|
+
serviceVersion?: string;
|
|
1812
|
+
/** OTLP endpoint URL */
|
|
1813
|
+
endpoint?: string;
|
|
1814
|
+
/** Additional resource attributes */
|
|
1815
|
+
resourceAttributes?: Record<string, string>;
|
|
1810
1816
|
}
|
|
1811
1817
|
/**
|
|
1812
1818
|
* Create an OpenTelemetry-based provider
|
|
@@ -1814,5 +1820,6 @@ interface OpenTelemetryConfig {
|
|
|
1814
1820
|
* Note: Requires @opentelemetry packages to be installed
|
|
1815
1821
|
*/
|
|
1816
1822
|
declare function createOpenTelemetryProvider(config: OpenTelemetryConfig): Promise<InkeepTelemetryProvider>;
|
|
1817
|
-
|
|
1818
|
-
export {
|
|
1823
|
+
//#endregion
|
|
1824
|
+
export { ANTHROPIC_MODELS, AgentConfig, AgentError, AgentInterface, AgentResponse, AgentTool, AllDelegateInputInterface, AllDelegateOutputInterface, ArtifactComponent, type ArtifactComponentInterface, ArtifactComponentWithZodProps, AssistantMessage, BuilderAgentConfig, BuilderRelationConfig, BuilderToolConfig, ConsoleTelemetryProvider, type CredentialProviderConfig, type CredentialProviderType, type CredentialReference, type CredentialStore, type CustomCredentialConfig, DataComponent, type DataComponentInterface, DataComponentWithZodProps, ExternalAgent, ExternalAgentInterface, type ExtractCredentialIds, FetchDefinitionConfig, FunctionTool, type FunctionToolConfig, GOOGLE_MODELS, GenerateOptions, InkeepCredentialProvider, InkeepTelemetryProvider, type KeychainCredentialConfig, MCPToolConfig, MaxTurnsExceededError, type MemoryCredentialConfig, Message, MessageInput, type ModelSettings, type NangoCredentialConfig, NoOpTelemetryProvider, OPENAI_MODELS, type OpenTelemetryConfig, Project, RequestSchemaConfig, RequestSchemaDefinition, RunResult, Runner, ServerConfig, type SpanOptions, SpanStatus, type SpanStatusType, StatusComponent, type StatusComponentInterface, StreamEvent, StreamResponse, SubAgent, SubAgentCanUseType, SubAgentConfig, SubAgentInterface, SystemMessage, type TelemetryConfig, type TelemetryLogger, type TelemetryMetrics, type TelemetryProvider, type TelemetrySpan, type TelemetryTracer, Tool, ToolCall, ToolConfig, ToolExecutionError, ToolMessage, ToolResult, TransferConfig, TransferError, type UnionCredentialIds, UserMessage, agent, agentMcp, artifactComponent, createConsoleTelemetryProvider, createCredentialProvider, createEnvironmentSettings, createFullProjectViaAPI, createNoOpTelemetryProvider, createOpenTelemetryProvider, credential, credentialRef, dataComponent, deleteFullProjectViaAPI, externalAgent, externalAgents, functionTool, getFullProjectViaAPI, getGlobalTelemetryProvider, isCredentialReference, mcpServer, mcpTool, project, raceAgents, registerEnvironmentSettings, run, setGlobalTelemetryProvider, statusComponent, stream, subAgent, subAgentExternalAgentInterface, subAgentTeamAgentInterface, transfer, updateFullProjectViaAPI };
|
|
1825
|
+
//# sourceMappingURL=index.d.cts.map
|