@inkeep/agents-sdk 0.1.1 → 0.1.7
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/SUPPLEMENTAL_TERMS.md +40 -0
- package/dist/index.cjs +3334 -0
- package/dist/index.d.cts +1131 -0
- package/dist/index.d.ts +1131 -11
- package/dist/index.js +3305 -10
- package/package.json +8 -7
- package/dist/__tests__/utils/testTenant.d.ts +0 -7
- package/dist/__tests__/utils/testTenant.d.ts.map +0 -1
- package/dist/__tests__/utils/testTenant.js +0 -10
- package/dist/__tests__/utils/testTenant.js.map +0 -1
- package/dist/agent.d.ts +0 -47
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -601
- package/dist/agent.js.map +0 -1
- package/dist/artifact-component.d.ts +0 -27
- package/dist/artifact-component.d.ts.map +0 -1
- package/dist/artifact-component.js +0 -116
- package/dist/artifact-component.js.map +0 -1
- package/dist/builders.d.ts +0 -211
- package/dist/builders.d.ts.map +0 -1
- package/dist/builders.js +0 -244
- package/dist/builders.js.map +0 -1
- package/dist/data-component.d.ts +0 -25
- package/dist/data-component.d.ts.map +0 -1
- package/dist/data-component.js +0 -112
- package/dist/data-component.js.map +0 -1
- package/dist/environment-settings.d.ts +0 -28
- package/dist/environment-settings.d.ts.map +0 -1
- package/dist/environment-settings.js +0 -78
- package/dist/environment-settings.js.map +0 -1
- package/dist/externalAgent.d.ts +0 -58
- package/dist/externalAgent.d.ts.map +0 -1
- package/dist/externalAgent.js +0 -161
- package/dist/externalAgent.js.map +0 -1
- package/dist/graph.d.ts +0 -200
- package/dist/graph.d.ts.map +0 -1
- package/dist/graph.js +0 -1294
- package/dist/graph.js.map +0 -1
- package/dist/graphFullClient.d.ts +0 -22
- package/dist/graphFullClient.d.ts.map +0 -1
- package/dist/graphFullClient.js +0 -189
- package/dist/graphFullClient.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/module-hosted-tool-manager.d.ts +0 -37
- package/dist/module-hosted-tool-manager.d.ts.map +0 -1
- package/dist/module-hosted-tool-manager.js +0 -375
- package/dist/module-hosted-tool-manager.js.map +0 -1
- package/dist/runner.d.ts +0 -38
- package/dist/runner.d.ts.map +0 -1
- package/dist/runner.js +0 -164
- package/dist/runner.js.map +0 -1
- package/dist/tool.d.ts +0 -29
- package/dist/tool.d.ts.map +0 -1
- package/dist/tool.js +0 -122
- package/dist/tool.js.map +0 -1
- package/dist/types.d.ts +0 -285
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -37
- package/dist/types.js.map +0 -1
package/dist/agent.js
DELETED
|
@@ -1,601 +0,0 @@
|
|
|
1
|
-
import { getLogger, } from '@inkeep/agents-core';
|
|
2
|
-
import { ArtifactComponent } from './artifact-component';
|
|
3
|
-
import { DataComponent } from './data-component';
|
|
4
|
-
const logger = getLogger('agent');
|
|
5
|
-
// Helper function to resolve getter functions
|
|
6
|
-
function resolveGetter(value) {
|
|
7
|
-
if (typeof value === 'function') {
|
|
8
|
-
return value();
|
|
9
|
-
}
|
|
10
|
-
return value;
|
|
11
|
-
}
|
|
12
|
-
export class Agent {
|
|
13
|
-
config;
|
|
14
|
-
type = 'internal';
|
|
15
|
-
baseURL;
|
|
16
|
-
tenantId;
|
|
17
|
-
projectId;
|
|
18
|
-
initialized = false;
|
|
19
|
-
constructor(config) {
|
|
20
|
-
this.config = { ...config, type: 'internal' };
|
|
21
|
-
this.baseURL = process.env.INKEEP_API_URL || 'http://localhost:3002';
|
|
22
|
-
this.tenantId = config.tenantId || 'default';
|
|
23
|
-
this.projectId = config.projectId || 'default';
|
|
24
|
-
logger.info({
|
|
25
|
-
tenantId: this.tenantId,
|
|
26
|
-
agentId: this.config.id,
|
|
27
|
-
agentName: config.name,
|
|
28
|
-
}, 'Agent constructor initialized');
|
|
29
|
-
}
|
|
30
|
-
// Return the configured ID
|
|
31
|
-
getId() {
|
|
32
|
-
return this.config.id;
|
|
33
|
-
}
|
|
34
|
-
// Agent introspection methods
|
|
35
|
-
getName() {
|
|
36
|
-
return this.config.name;
|
|
37
|
-
}
|
|
38
|
-
getInstructions() {
|
|
39
|
-
return this.config.prompt;
|
|
40
|
-
}
|
|
41
|
-
getTools() {
|
|
42
|
-
const tools = resolveGetter(this.config.tools);
|
|
43
|
-
if (!tools) {
|
|
44
|
-
return {};
|
|
45
|
-
}
|
|
46
|
-
// Tools must be an array from the getter function
|
|
47
|
-
if (!Array.isArray(tools)) {
|
|
48
|
-
throw new Error('tools getter must return an array');
|
|
49
|
-
}
|
|
50
|
-
// Convert array to record using tool id or name as key
|
|
51
|
-
const toolRecord = {};
|
|
52
|
-
for (const tool of tools) {
|
|
53
|
-
if (tool && typeof tool === 'object') {
|
|
54
|
-
const id = tool.id || tool.getId?.() || tool.name;
|
|
55
|
-
if (id) {
|
|
56
|
-
toolRecord[id] = tool;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return toolRecord;
|
|
61
|
-
}
|
|
62
|
-
getModels() {
|
|
63
|
-
return this.config.models;
|
|
64
|
-
}
|
|
65
|
-
setModels(models) {
|
|
66
|
-
this.config.models = models;
|
|
67
|
-
}
|
|
68
|
-
getTransfers() {
|
|
69
|
-
return typeof this.config.canTransferTo === 'function' ? this.config.canTransferTo() : [];
|
|
70
|
-
}
|
|
71
|
-
getDelegates() {
|
|
72
|
-
return typeof this.config.canDelegateTo === 'function' ? this.config.canDelegateTo() : [];
|
|
73
|
-
}
|
|
74
|
-
getDataComponents() {
|
|
75
|
-
return resolveGetter(this.config.dataComponents) || [];
|
|
76
|
-
}
|
|
77
|
-
getArtifactComponents() {
|
|
78
|
-
return resolveGetter(this.config.artifactComponents) || [];
|
|
79
|
-
}
|
|
80
|
-
addTool(name, tool) {
|
|
81
|
-
// Tools must now be a getter function returning an array
|
|
82
|
-
const existingTools = this.config.tools ? this.config.tools() : [];
|
|
83
|
-
this.config.tools = () => [...existingTools, tool];
|
|
84
|
-
}
|
|
85
|
-
addTransfer(...agents) {
|
|
86
|
-
if (typeof this.config.canTransferTo === 'function') {
|
|
87
|
-
// If already a function, we need to combine the results
|
|
88
|
-
const existingTransfers = this.config.canTransferTo;
|
|
89
|
-
this.config.canTransferTo = () => [...existingTransfers(), ...agents];
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
// Convert to function-based transfers
|
|
93
|
-
this.config.canTransferTo = () => agents;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
addDelegate(...agents) {
|
|
97
|
-
if (typeof this.config.canDelegateTo === 'function') {
|
|
98
|
-
const existingDelegates = this.config.canDelegateTo;
|
|
99
|
-
this.config.canDelegateTo = () => [...existingDelegates(), ...agents];
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
this.config.canDelegateTo = () => agents;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// Public method to ensure agent exists in backend (with upsert behavior)
|
|
106
|
-
async init() {
|
|
107
|
-
if (this.initialized)
|
|
108
|
-
return;
|
|
109
|
-
try {
|
|
110
|
-
// Always attempt to upsert the agent
|
|
111
|
-
await this.upsertAgent();
|
|
112
|
-
// Load existing data components from database and merge with config
|
|
113
|
-
await this.loadDataComponents();
|
|
114
|
-
// Load existing artifact components from database and merge with config
|
|
115
|
-
await this.loadArtifactComponents();
|
|
116
|
-
// Setup tools and relations
|
|
117
|
-
await this.saveToolsAndRelations();
|
|
118
|
-
await this.saveDataComponents();
|
|
119
|
-
await this.saveArtifactComponents();
|
|
120
|
-
logger.info({
|
|
121
|
-
agentId: this.getId(),
|
|
122
|
-
}, 'Agent initialized successfully');
|
|
123
|
-
this.initialized = true;
|
|
124
|
-
}
|
|
125
|
-
catch (error) {
|
|
126
|
-
logger.error({
|
|
127
|
-
agentId: this.getId(),
|
|
128
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
129
|
-
}, 'Failed to initialize agent');
|
|
130
|
-
throw error;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
// Private method to upsert agent (create or update)
|
|
134
|
-
async upsertAgent() {
|
|
135
|
-
const agentData = {
|
|
136
|
-
id: this.getId(),
|
|
137
|
-
name: this.config.name,
|
|
138
|
-
description: this.config.description || '',
|
|
139
|
-
prompt: this.config.prompt,
|
|
140
|
-
conversationHistoryConfig: this.config.conversationHistoryConfig,
|
|
141
|
-
models: this.config.models,
|
|
142
|
-
stopWhen: this.config.stopWhen,
|
|
143
|
-
};
|
|
144
|
-
// First try to update (in case agent exists)
|
|
145
|
-
const updateResponse = await fetch(`${this.baseURL}/tenants/${this.tenantId}/crud/agents/${this.getId()}`, {
|
|
146
|
-
method: 'PUT',
|
|
147
|
-
headers: {
|
|
148
|
-
'Content-Type': 'application/json',
|
|
149
|
-
},
|
|
150
|
-
body: JSON.stringify(agentData),
|
|
151
|
-
});
|
|
152
|
-
if (updateResponse.ok) {
|
|
153
|
-
logger.info({
|
|
154
|
-
agentId: this.getId(),
|
|
155
|
-
}, 'Agent updated successfully');
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
// If update failed with 404, agent doesn't exist - create it
|
|
159
|
-
if (updateResponse.status === 404) {
|
|
160
|
-
logger.info({
|
|
161
|
-
agentId: this.getId(),
|
|
162
|
-
}, 'Agent not found, creating new agent');
|
|
163
|
-
const createResponse = await fetch(`${this.baseURL}/tenants/${this.tenantId}/crud/agents`, {
|
|
164
|
-
method: 'POST',
|
|
165
|
-
headers: {
|
|
166
|
-
'Content-Type': 'application/json',
|
|
167
|
-
},
|
|
168
|
-
body: JSON.stringify(agentData),
|
|
169
|
-
});
|
|
170
|
-
if (!createResponse.ok) {
|
|
171
|
-
const errorText = await createResponse.text().catch(() => 'Unknown error');
|
|
172
|
-
throw new Error(`Failed to create agent: ${createResponse.status} ${createResponse.statusText} - ${errorText}`);
|
|
173
|
-
}
|
|
174
|
-
logger.info({
|
|
175
|
-
agentId: this.getId(),
|
|
176
|
-
}, 'Agent created successfully');
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
// Update failed for some other reason
|
|
180
|
-
const errorText = await updateResponse.text().catch(() => 'Unknown error');
|
|
181
|
-
throw new Error(`Failed to update agent: ${updateResponse.status} ${updateResponse.statusText} - ${errorText}`);
|
|
182
|
-
}
|
|
183
|
-
// Private implementation methods
|
|
184
|
-
normalizeMessages(messages) {
|
|
185
|
-
if (typeof messages === 'string') {
|
|
186
|
-
return [{ role: 'user', content: messages }];
|
|
187
|
-
}
|
|
188
|
-
if (Array.isArray(messages)) {
|
|
189
|
-
return messages.map((msg) => typeof msg === 'string' ? { role: 'user', content: msg } : msg);
|
|
190
|
-
}
|
|
191
|
-
return [messages];
|
|
192
|
-
}
|
|
193
|
-
async saveToolsAndRelations() {
|
|
194
|
-
logger.info({
|
|
195
|
-
transfers: this.getTransfers(),
|
|
196
|
-
delegates: this.getDelegates(),
|
|
197
|
-
tools: this.config.tools,
|
|
198
|
-
}, 'transfers, delegates, and tools');
|
|
199
|
-
// Setup tools using your existing SDK
|
|
200
|
-
if (this.config.tools) {
|
|
201
|
-
logger.info({ tools: this.config.tools }, 'tools and config');
|
|
202
|
-
for (const [toolId, toolConfig] of Object.entries(this.config.tools)) {
|
|
203
|
-
await this.createTool(toolId, toolConfig);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
// Note: Transfer and delegate relations are managed by the AgentGraph, not individual agents
|
|
207
|
-
}
|
|
208
|
-
async saveDataComponents() {
|
|
209
|
-
logger.info({ dataComponents: this.config.dataComponents }, 'dataComponents and config');
|
|
210
|
-
const components = resolveGetter(this.config.dataComponents);
|
|
211
|
-
if (components) {
|
|
212
|
-
for (const dataComponent of components) {
|
|
213
|
-
await this.createDataComponent(dataComponent);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
async saveArtifactComponents() {
|
|
218
|
-
logger.info({ artifactComponents: this.config.artifactComponents }, 'artifactComponents and config');
|
|
219
|
-
const components = resolveGetter(this.config.artifactComponents);
|
|
220
|
-
if (components) {
|
|
221
|
-
for (const artifactComponent of components) {
|
|
222
|
-
await this.createArtifactComponent(artifactComponent);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
async loadDataComponents() {
|
|
227
|
-
try {
|
|
228
|
-
// Import the getDataComponentsForAgent function
|
|
229
|
-
// TODO: Load data components from database for this agent
|
|
230
|
-
// This needs to be replaced with an HTTP API call
|
|
231
|
-
const existingComponents = [];
|
|
232
|
-
// const existingComponents = await getDataComponentsForAgent(dbClient)({
|
|
233
|
-
// scopes: { tenantId: this.tenantId, projectId: this.projectId },
|
|
234
|
-
// agentId: this.getId(),
|
|
235
|
-
// });
|
|
236
|
-
// Convert database format to config format
|
|
237
|
-
const dbDataComponents = existingComponents.map((component) => ({
|
|
238
|
-
id: component.id,
|
|
239
|
-
tenantId: component.tenantId || this.tenantId,
|
|
240
|
-
projectId: component.projectId || this.projectId,
|
|
241
|
-
name: component.name,
|
|
242
|
-
description: component.description,
|
|
243
|
-
props: component.props,
|
|
244
|
-
createdAt: component.createdAt,
|
|
245
|
-
updatedAt: component.updatedAt,
|
|
246
|
-
}));
|
|
247
|
-
// Merge with existing config data components (config takes precedence)
|
|
248
|
-
const configComponents = resolveGetter(this.config.dataComponents) || [];
|
|
249
|
-
const allComponents = [...dbDataComponents, ...configComponents];
|
|
250
|
-
// Remove duplicates (config components override database ones with same id)
|
|
251
|
-
const uniqueComponents = allComponents.reduce((acc, component) => {
|
|
252
|
-
const existingIndex = acc.findIndex((c) => c.id === component.id);
|
|
253
|
-
if (existingIndex >= 0) {
|
|
254
|
-
// Replace with the later one (config takes precedence)
|
|
255
|
-
acc[existingIndex] = component;
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
acc.push(component);
|
|
259
|
-
}
|
|
260
|
-
return acc;
|
|
261
|
-
}, []);
|
|
262
|
-
// Update the config with merged components
|
|
263
|
-
this.config.dataComponents = uniqueComponents;
|
|
264
|
-
logger.info({
|
|
265
|
-
agentId: this.getId(),
|
|
266
|
-
dbComponentCount: dbDataComponents.length,
|
|
267
|
-
configComponentCount: configComponents.length,
|
|
268
|
-
totalComponentCount: uniqueComponents.length,
|
|
269
|
-
}, 'Loaded and merged data components');
|
|
270
|
-
}
|
|
271
|
-
catch (error) {
|
|
272
|
-
logger.error({
|
|
273
|
-
agentId: this.getId(),
|
|
274
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
275
|
-
}, 'Failed to load data components from database');
|
|
276
|
-
// Don't throw - continue with just config components
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
async loadArtifactComponents() {
|
|
280
|
-
try {
|
|
281
|
-
// TODO: Load artifact components from database for this agent
|
|
282
|
-
// This needs to be replaced with an HTTP API call
|
|
283
|
-
const existingComponents = [];
|
|
284
|
-
// const existingComponents = await getArtifactComponentsForAgent(dbClient)({
|
|
285
|
-
// scopes: { tenantId: this.tenantId, projectId: this.projectId },
|
|
286
|
-
// agentId: this.getId(),
|
|
287
|
-
// });
|
|
288
|
-
// Convert database format to config format
|
|
289
|
-
const dbArtifactComponents = existingComponents.map((component) => ({
|
|
290
|
-
id: component.id,
|
|
291
|
-
tenantId: component.tenantId || this.tenantId,
|
|
292
|
-
projectId: component.projectId || this.projectId,
|
|
293
|
-
name: component.name,
|
|
294
|
-
description: component.description,
|
|
295
|
-
summaryProps: component.summaryProps,
|
|
296
|
-
fullProps: component.fullProps,
|
|
297
|
-
createdAt: component.createdAt,
|
|
298
|
-
updatedAt: component.updatedAt,
|
|
299
|
-
}));
|
|
300
|
-
// Merge with existing config artifact components (config takes precedence)
|
|
301
|
-
const configComponents = resolveGetter(this.config.artifactComponents) || [];
|
|
302
|
-
const allComponents = [...dbArtifactComponents, ...configComponents];
|
|
303
|
-
// Remove duplicates (config components override database ones with same id)
|
|
304
|
-
const uniqueComponents = allComponents.reduce((acc, component) => {
|
|
305
|
-
const existingIndex = acc.findIndex((c) => c.id === component.id);
|
|
306
|
-
if (existingIndex >= 0) {
|
|
307
|
-
// Replace with the later one (config takes precedence)
|
|
308
|
-
acc[existingIndex] = component;
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
acc.push(component);
|
|
312
|
-
}
|
|
313
|
-
return acc;
|
|
314
|
-
}, []);
|
|
315
|
-
// Update the config with merged components
|
|
316
|
-
this.config.artifactComponents = uniqueComponents;
|
|
317
|
-
logger.info({
|
|
318
|
-
agentId: this.getId(),
|
|
319
|
-
dbComponentCount: dbArtifactComponents.length,
|
|
320
|
-
configComponentCount: configComponents.length,
|
|
321
|
-
totalComponentCount: uniqueComponents.length,
|
|
322
|
-
}, 'Loaded and merged artifact components');
|
|
323
|
-
}
|
|
324
|
-
catch (error) {
|
|
325
|
-
logger.error({
|
|
326
|
-
agentId: this.getId(),
|
|
327
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
328
|
-
}, 'Failed to load artifact components from database');
|
|
329
|
-
// Don't throw - continue with just config components
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
async createTool(toolId, toolConfig) {
|
|
333
|
-
try {
|
|
334
|
-
// Check if this is a function tool (has type: 'function')
|
|
335
|
-
if (toolConfig.type === 'function') {
|
|
336
|
-
logger.info({
|
|
337
|
-
agentId: this.getId(),
|
|
338
|
-
toolId,
|
|
339
|
-
toolType: 'function',
|
|
340
|
-
}, 'Skipping function tool creation - will be handled at runtime');
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
// Import tool classes to check instances
|
|
344
|
-
const { Tool } = await import('./tool.js');
|
|
345
|
-
let tool;
|
|
346
|
-
// Check if this is already a tool instance
|
|
347
|
-
if (toolConfig instanceof Tool) {
|
|
348
|
-
logger.info({
|
|
349
|
-
agentId: this.getId(),
|
|
350
|
-
toolId,
|
|
351
|
-
toolType: 'Tool',
|
|
352
|
-
}, 'Initializing Tool instance');
|
|
353
|
-
tool = toolConfig;
|
|
354
|
-
await tool.init();
|
|
355
|
-
}
|
|
356
|
-
else {
|
|
357
|
-
// Legacy: create MCP tool from config
|
|
358
|
-
logger.info({
|
|
359
|
-
agentId: this.getId(),
|
|
360
|
-
toolId,
|
|
361
|
-
toolType: 'legacy-config',
|
|
362
|
-
}, 'Creating Tool from config');
|
|
363
|
-
tool = new Tool({
|
|
364
|
-
id: toolId,
|
|
365
|
-
tenantId: this.tenantId,
|
|
366
|
-
name: toolConfig.name || toolId,
|
|
367
|
-
description: toolConfig.description || `MCP tool: ${toolId}`,
|
|
368
|
-
serverUrl: toolConfig.config?.serverUrl || toolConfig.serverUrl || 'http://localhost:3000',
|
|
369
|
-
activeTools: toolConfig.config?.mcp?.activeTools,
|
|
370
|
-
credential: toolConfig.credential,
|
|
371
|
-
});
|
|
372
|
-
await tool.init();
|
|
373
|
-
}
|
|
374
|
-
// Create the agent-tool relation with credential reference
|
|
375
|
-
await this.createAgentToolRelation(tool.getId());
|
|
376
|
-
logger.info({
|
|
377
|
-
agentId: this.getId(),
|
|
378
|
-
toolId: tool.getId(),
|
|
379
|
-
}, 'Tool created and linked to agent');
|
|
380
|
-
}
|
|
381
|
-
catch (error) {
|
|
382
|
-
logger.error({
|
|
383
|
-
agentId: this.getId(),
|
|
384
|
-
toolId,
|
|
385
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
386
|
-
}, 'Failed to create tool');
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
async createDataComponent(dataComponent) {
|
|
390
|
-
try {
|
|
391
|
-
// Create a DataComponent instance from the config
|
|
392
|
-
const dc = new DataComponent({
|
|
393
|
-
tenantId: this.tenantId,
|
|
394
|
-
projectId: this.projectId,
|
|
395
|
-
name: dataComponent.name,
|
|
396
|
-
description: dataComponent.description,
|
|
397
|
-
props: dataComponent.props,
|
|
398
|
-
});
|
|
399
|
-
// Initialize the data component (this handles creation/update)
|
|
400
|
-
await dc.init();
|
|
401
|
-
// Create the agent-dataComponent association
|
|
402
|
-
await this.createAgentDataComponentRelation(dc.getId());
|
|
403
|
-
logger.info({
|
|
404
|
-
agentId: this.getId(),
|
|
405
|
-
dataComponentId: dc.getId(),
|
|
406
|
-
}, 'DataComponent created and linked to agent');
|
|
407
|
-
}
|
|
408
|
-
catch (error) {
|
|
409
|
-
logger.error({
|
|
410
|
-
agentId: this.getId(),
|
|
411
|
-
dataComponentName: dataComponent.name,
|
|
412
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
413
|
-
}, 'Failed to create data component');
|
|
414
|
-
// Re-throw the error so tests can catch it
|
|
415
|
-
throw error;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
async createArtifactComponent(artifactComponent) {
|
|
419
|
-
try {
|
|
420
|
-
// Create an ArtifactComponent instance from the config
|
|
421
|
-
const ac = new ArtifactComponent({
|
|
422
|
-
tenantId: this.tenantId,
|
|
423
|
-
projectId: this.projectId,
|
|
424
|
-
name: artifactComponent.name,
|
|
425
|
-
description: artifactComponent.description,
|
|
426
|
-
summaryProps: artifactComponent.summaryProps,
|
|
427
|
-
fullProps: artifactComponent.fullProps,
|
|
428
|
-
});
|
|
429
|
-
// Initialize the artifact component (this handles creation/update)
|
|
430
|
-
await ac.init();
|
|
431
|
-
// Create the agent-artifactComponent association
|
|
432
|
-
await this.createAgentArtifactComponentRelation(ac.getId());
|
|
433
|
-
logger.info({
|
|
434
|
-
agentId: this.getId(),
|
|
435
|
-
artifactComponentId: ac.getId(),
|
|
436
|
-
}, 'ArtifactComponent created and linked to agent');
|
|
437
|
-
}
|
|
438
|
-
catch (error) {
|
|
439
|
-
logger.error({
|
|
440
|
-
agentId: this.getId(),
|
|
441
|
-
artifactComponentName: artifactComponent.name,
|
|
442
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
443
|
-
}, 'Failed to create artifact component');
|
|
444
|
-
// Re-throw the error so tests can catch it
|
|
445
|
-
throw error;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
async createAgentDataComponentRelation(dataComponentId) {
|
|
449
|
-
const relationResponse = await fetch(`${this.baseURL}/tenants/${this.tenantId}/crud/agent-data-components`, {
|
|
450
|
-
method: 'POST',
|
|
451
|
-
headers: {
|
|
452
|
-
'Content-Type': 'application/json',
|
|
453
|
-
},
|
|
454
|
-
body: JSON.stringify({
|
|
455
|
-
id: `${this.getId()}-dc-${dataComponentId}`,
|
|
456
|
-
tenantId: this.tenantId,
|
|
457
|
-
agentId: this.getId(),
|
|
458
|
-
dataComponentId: dataComponentId,
|
|
459
|
-
}),
|
|
460
|
-
});
|
|
461
|
-
if (!relationResponse.ok) {
|
|
462
|
-
throw new Error(`Failed to create agent-dataComponent relation: ${relationResponse.status} ${relationResponse.statusText}`);
|
|
463
|
-
}
|
|
464
|
-
logger.info({
|
|
465
|
-
agentId: this.getId(),
|
|
466
|
-
dataComponentId,
|
|
467
|
-
}, 'Created agent-dataComponent relation');
|
|
468
|
-
}
|
|
469
|
-
async createAgentArtifactComponentRelation(artifactComponentId) {
|
|
470
|
-
const relationResponse = await fetch(`${this.baseURL}/tenants/${this.tenantId}/crud/agent-artifact-components`, {
|
|
471
|
-
method: 'POST',
|
|
472
|
-
headers: {
|
|
473
|
-
'Content-Type': 'application/json',
|
|
474
|
-
},
|
|
475
|
-
body: JSON.stringify({
|
|
476
|
-
id: crypto.randomUUID(),
|
|
477
|
-
tenantId: this.tenantId,
|
|
478
|
-
agentId: this.getId(),
|
|
479
|
-
artifactComponentId: artifactComponentId,
|
|
480
|
-
}),
|
|
481
|
-
});
|
|
482
|
-
if (!relationResponse.ok) {
|
|
483
|
-
throw new Error(`Failed to create agent-artifactComponent relation: ${relationResponse.status} ${relationResponse.statusText}`);
|
|
484
|
-
}
|
|
485
|
-
logger.info({
|
|
486
|
-
agentId: this.getId(),
|
|
487
|
-
artifactComponentId,
|
|
488
|
-
}, 'Created agent-artifactComponent relation');
|
|
489
|
-
}
|
|
490
|
-
async createAgentToolRelation(toolId) {
|
|
491
|
-
const relationResponse = await fetch(`${this.baseURL}/tenants/${this.tenantId}/crud/agent-tool-relations`, {
|
|
492
|
-
method: 'POST',
|
|
493
|
-
headers: {
|
|
494
|
-
'Content-Type': 'application/json',
|
|
495
|
-
},
|
|
496
|
-
body: JSON.stringify({
|
|
497
|
-
id: `${this.getId()}-tool-${toolId}`,
|
|
498
|
-
tenantId: this.tenantId,
|
|
499
|
-
agentId: this.getId(),
|
|
500
|
-
toolId: toolId,
|
|
501
|
-
}),
|
|
502
|
-
});
|
|
503
|
-
if (!relationResponse.ok) {
|
|
504
|
-
const errorBody = await relationResponse.text().catch(() => 'Unknown error');
|
|
505
|
-
throw new Error(`Failed to create agent-tool relation: ${relationResponse.status} - ${errorBody}`);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* Resolve context and apply templates to agent prompt
|
|
510
|
-
*/
|
|
511
|
-
async executeGeneration(messages, options, processedInstructions) {
|
|
512
|
-
// This is where you'd integrate with your actual agent execution logic
|
|
513
|
-
// For now, we'll return a basic response structure
|
|
514
|
-
const lastMessage = messages[messages.length - 1];
|
|
515
|
-
const userInput = lastMessage?.content || '';
|
|
516
|
-
const prompt = processedInstructions || this.config.prompt;
|
|
517
|
-
// Log the prompt being used (helpful for debugging context application)
|
|
518
|
-
logger.debug({
|
|
519
|
-
agentId: this.getId(),
|
|
520
|
-
promptLength: prompt.length,
|
|
521
|
-
hasProcessedInstructions: !!processedInstructions,
|
|
522
|
-
}, 'Executing generation with prompt');
|
|
523
|
-
// Example: Check for transfer conditions
|
|
524
|
-
const transferAgent = this.shouldTransfer(userInput);
|
|
525
|
-
if (transferAgent) {
|
|
526
|
-
return {
|
|
527
|
-
text: `I'm handing this over to ${transferAgent.getName()} who can better assist you.`,
|
|
528
|
-
toolCalls: [],
|
|
529
|
-
transfer: {
|
|
530
|
-
agent: transferAgent,
|
|
531
|
-
description: `Transfer to ${transferAgent.getName()}`,
|
|
532
|
-
},
|
|
533
|
-
finishReason: 'transfer',
|
|
534
|
-
usage: { inputTokens: 0, outputTokens: 0 },
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
// Example: Check for tool usage
|
|
538
|
-
const toolCalls = this.identifyToolCalls(userInput);
|
|
539
|
-
if (toolCalls.length > 0) {
|
|
540
|
-
return {
|
|
541
|
-
text: `I'll help you with that. Let me use the appropriate tools.`,
|
|
542
|
-
toolCalls,
|
|
543
|
-
finishReason: 'tool_calls',
|
|
544
|
-
usage: { inputTokens: 0, outputTokens: 0 },
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
// Default response
|
|
548
|
-
return {
|
|
549
|
-
text: `Hello! I'm ${this.config.name}. ${userInput ? `You said: "${userInput}"` : 'How can I help you today?'}`,
|
|
550
|
-
toolCalls: [],
|
|
551
|
-
finishReason: 'completed',
|
|
552
|
-
usage: { inputTokens: userInput.length, outputTokens: 50 },
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
async *createTextStream(messages, options) {
|
|
556
|
-
const response = await this.executeGeneration(messages, options);
|
|
557
|
-
// Simulate streaming by yielding chunks
|
|
558
|
-
const words = response.text.split(' ');
|
|
559
|
-
for (const word of words) {
|
|
560
|
-
yield `${word} `;
|
|
561
|
-
// Add small delay to simulate real streaming
|
|
562
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
shouldTransfer(input) {
|
|
566
|
-
// Simple transfer logic - you can make this more sophisticated
|
|
567
|
-
const transfers = this.getTransfers();
|
|
568
|
-
for (const agent of transfers) {
|
|
569
|
-
const agentName = agent.getName().toLowerCase();
|
|
570
|
-
if (input.toLowerCase().includes(agentName) ||
|
|
571
|
-
input.toLowerCase().includes('transfer') ||
|
|
572
|
-
input.toLowerCase().includes('transfer')) {
|
|
573
|
-
return agent;
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
return null;
|
|
577
|
-
}
|
|
578
|
-
identifyToolCalls(input) {
|
|
579
|
-
const tools = this.getTools();
|
|
580
|
-
const toolCalls = [];
|
|
581
|
-
// Simple tool identification logic
|
|
582
|
-
for (const [toolName, toolConfig] of Object.entries(tools)) {
|
|
583
|
-
if (input.toLowerCase().includes(toolName.toLowerCase())) {
|
|
584
|
-
toolCalls.push({
|
|
585
|
-
id: crypto.randomUUID(),
|
|
586
|
-
type: 'function',
|
|
587
|
-
function: {
|
|
588
|
-
name: toolName,
|
|
589
|
-
arguments: JSON.stringify({ input }),
|
|
590
|
-
},
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
return toolCalls;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
// Factory function for creating agents - similar to contextConfig() pattern
|
|
598
|
-
export function agent(config) {
|
|
599
|
-
return new Agent(config);
|
|
600
|
-
}
|
|
601
|
-
//# sourceMappingURL=agent.js.map
|
package/dist/agent.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAYjD,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AAElC,8CAA8C;AAC9C,SAAS,aAAa,CAAI,KAAgC;IACxD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,OAAQ,KAAiB,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO,KAAsB,CAAC;AAChC,CAAC;AAED,MAAM,OAAO,KAAK;IACT,MAAM,CAAc;IACX,IAAI,GAAG,UAAmB,CAAC;IACnC,OAAO,CAAS;IAChB,QAAQ,CAAS;IACjB,SAAS,CAAS;IAClB,WAAW,GAAG,KAAK,CAAC;IAC5B,YAAY,MAAmB;QAC7B,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG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AI,EAAE,QAAQ;wBACd,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC;qBACrC;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAED,4EAA4E;AAC5E,MAAM,UAAU,KAAK,CAAC,MAAmB;IACvC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { type ArtifactComponentInsert as ArtifactComponentType } from '@inkeep/agents-core';
|
|
2
|
-
export interface ArtifactComponentInterface {
|
|
3
|
-
config: Omit<ArtifactComponentType, 'id'>;
|
|
4
|
-
init(): Promise<void>;
|
|
5
|
-
getId(): ArtifactComponentType['id'];
|
|
6
|
-
getName(): ArtifactComponentType['name'];
|
|
7
|
-
getDescription(): ArtifactComponentType['description'];
|
|
8
|
-
getSummaryProps(): ArtifactComponentType['summaryProps'];
|
|
9
|
-
getFullProps(): ArtifactComponentType['fullProps'];
|
|
10
|
-
}
|
|
11
|
-
export declare class ArtifactComponent implements ArtifactComponentInterface {
|
|
12
|
-
config: ArtifactComponentType;
|
|
13
|
-
private baseURL;
|
|
14
|
-
private tenantId;
|
|
15
|
-
private projectId;
|
|
16
|
-
private initialized;
|
|
17
|
-
private id;
|
|
18
|
-
constructor(config: Omit<ArtifactComponentType, 'id'>);
|
|
19
|
-
getId(): string;
|
|
20
|
-
getName(): string;
|
|
21
|
-
getDescription(): string;
|
|
22
|
-
getSummaryProps(): ArtifactComponentType['summaryProps'];
|
|
23
|
-
getFullProps(): ArtifactComponentType['fullProps'];
|
|
24
|
-
init(): Promise<void>;
|
|
25
|
-
private upsertArtifactComponent;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=artifact-component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-component.d.ts","sourceRoot":"","sources":["../src/artifact-component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,IAAI,qBAAqB,EAGtD,MAAM,qBAAqB,CAAC;AAI7B,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;IAC1C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACzC,cAAc,IAAI,qBAAqB,CAAC,aAAa,CAAC,CAAC;IACvD,eAAe,IAAI,qBAAqB,CAAC,cAAc,CAAC,CAAC;IACzD,YAAY,IAAI,qBAAqB,CAAC,WAAW,CAAC,CAAC;CACpD;AAED,qBAAa,iBAAkB,YAAW,0BAA0B;IAC3D,MAAM,EAAE,qBAAqB,CAAC;IACrC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAoC;IACpD,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,EAAE,CAA8B;gBAE5B,MAAM,EAAE,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC;IAsBrD,KAAK,IAAI,MAAM;IAIf,OAAO,IAAI,MAAM;IAIjB,cAAc,IAAI,MAAM;IAIxB,eAAe,IAAI,qBAAqB,CAAC,cAAc,CAAC;IAIxD,YAAY,IAAI,qBAAqB,CAAC,WAAW,CAAC;IAK5C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YA4Bb,uBAAuB;CAmFtC"}
|