@inkeep/agents-core 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{chunk-TO2HNKGP.js → chunk-E4SFK6AI.js} +143 -157
- package/dist/{chunk-VPJ6Z5QZ.js → chunk-ID4CFGVF.js} +202 -131
- package/dist/chunk-JTHQYGCX.js +173 -0
- package/dist/chunk-TCLX6C3C.js +271 -0
- package/dist/client-exports.cjs +622 -272
- package/dist/client-exports.d.cts +6 -5
- package/dist/client-exports.d.ts +6 -5
- package/dist/client-exports.js +5 -4
- package/dist/db/schema.cjs +201 -130
- package/dist/db/schema.d.cts +2 -2
- package/dist/db/schema.d.ts +2 -2
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +2734 -1831
- package/dist/index.d.cts +1664 -1544
- package/dist/index.d.ts +1664 -1544
- package/dist/index.js +1953 -1467
- package/dist/{schema-BQk_FMBV.d.ts → schema-Bjy5TkFv.d.cts} +473 -172
- package/dist/{schema-Ct2NlO81.d.cts → schema-CfWbqju2.d.ts} +473 -172
- package/dist/signoz-queries-CifqdbnO.d.cts +269 -0
- package/dist/signoz-queries-CifqdbnO.d.ts +269 -0
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{utility-s9c5CVOe.d.cts → utility-Fxoh7s82.d.cts} +585 -384
- package/dist/{utility-s9c5CVOe.d.ts → utility-Fxoh7s82.d.ts} +585 -384
- package/dist/validation/index.cjs +429 -325
- package/dist/validation/index.d.cts +76 -4
- package/dist/validation/index.d.ts +76 -4
- package/dist/validation/index.js +2 -2
- package/drizzle/0005_wide_shriek.sql +127 -0
- package/drizzle/0006_damp_lenny_balinger.sql +52 -0
- package/drizzle/meta/0005_snapshot.json +2558 -0
- package/drizzle/meta/0006_snapshot.json +2751 -0
- package/drizzle/meta/_journal.json +14 -0
- package/package.json +1 -1
- package/dist/chunk-L53XWAYG.js +0 -134
|
@@ -5,18 +5,11 @@ import { sqliteTable, text, primaryKey, foreignKey, blob, integer, index, unique
|
|
|
5
5
|
// src/db/schema.ts
|
|
6
6
|
var schema_exports = {};
|
|
7
7
|
__export(schema_exports, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
agentDataComponents: () => agentDataComponents,
|
|
11
|
-
agentDataComponentsRelations: () => agentDataComponentsRelations,
|
|
8
|
+
agentFunctionToolRelations: () => agentFunctionToolRelations,
|
|
9
|
+
agentFunctionToolRelationsRelations: () => agentFunctionToolRelationsRelations,
|
|
12
10
|
agentGraph: () => agentGraph,
|
|
13
11
|
agentGraphRelations: () => agentGraphRelations,
|
|
14
|
-
agentRelations: () => agentRelations,
|
|
15
|
-
agentRelationsRelations: () => agentRelationsRelations,
|
|
16
|
-
agentToolRelations: () => agentToolRelations,
|
|
17
12
|
agentToolRelationsRelations: () => agentToolRelationsRelations,
|
|
18
|
-
agents: () => agents,
|
|
19
|
-
agentsRelations: () => agentsRelations,
|
|
20
13
|
apiKeys: () => apiKeys,
|
|
21
14
|
apiKeysRelations: () => apiKeysRelations,
|
|
22
15
|
artifactComponents: () => artifactComponents,
|
|
@@ -33,6 +26,8 @@ __export(schema_exports, {
|
|
|
33
26
|
dataComponentsRelations: () => dataComponentsRelations,
|
|
34
27
|
externalAgents: () => externalAgents,
|
|
35
28
|
externalAgentsRelations: () => externalAgentsRelations,
|
|
29
|
+
functionTools: () => functionTools,
|
|
30
|
+
functionToolsRelations: () => functionToolsRelations,
|
|
36
31
|
functions: () => functions,
|
|
37
32
|
functionsRelations: () => functionsRelations,
|
|
38
33
|
ledgerArtifacts: () => ledgerArtifacts,
|
|
@@ -41,6 +36,15 @@ __export(schema_exports, {
|
|
|
41
36
|
messagesRelations: () => messagesRelations,
|
|
42
37
|
projects: () => projects,
|
|
43
38
|
projectsRelations: () => projectsRelations,
|
|
39
|
+
subAgentArtifactComponents: () => subAgentArtifactComponents,
|
|
40
|
+
subAgentArtifactComponentsRelations: () => subAgentArtifactComponentsRelations,
|
|
41
|
+
subAgentDataComponents: () => subAgentDataComponents,
|
|
42
|
+
subAgentDataComponentsRelations: () => subAgentDataComponentsRelations,
|
|
43
|
+
subAgentRelations: () => subAgentRelations,
|
|
44
|
+
subAgentRelationsRelations: () => subAgentRelationsRelations,
|
|
45
|
+
subAgentToolRelations: () => subAgentToolRelations,
|
|
46
|
+
subAgents: () => subAgents,
|
|
47
|
+
subAgentsRelations: () => subAgentsRelations,
|
|
44
48
|
taskRelations: () => taskRelations,
|
|
45
49
|
taskRelationsRelations: () => taskRelationsRelations,
|
|
46
50
|
tasks: () => tasks,
|
|
@@ -60,9 +64,9 @@ var graphScoped = {
|
|
|
60
64
|
...projectScoped,
|
|
61
65
|
graphId: text("graph_id").notNull()
|
|
62
66
|
};
|
|
63
|
-
var
|
|
67
|
+
var subAgentScoped = {
|
|
64
68
|
...graphScoped,
|
|
65
|
-
|
|
69
|
+
subAgentId: text("sub_agent_id").notNull()
|
|
66
70
|
};
|
|
67
71
|
var uiProperties = {
|
|
68
72
|
name: text("name").notNull(),
|
|
@@ -93,7 +97,7 @@ var agentGraph = sqliteTable(
|
|
|
93
97
|
...projectScoped,
|
|
94
98
|
name: text("name").notNull(),
|
|
95
99
|
description: text("description"),
|
|
96
|
-
|
|
100
|
+
defaultSubAgentId: text("default_sub_agent_id"),
|
|
97
101
|
// Reference to shared context configuration for all agents in this graph
|
|
98
102
|
contextConfigId: text("context_config_id"),
|
|
99
103
|
// add fk relationship
|
|
@@ -172,8 +176,8 @@ var contextCache = sqliteTable(
|
|
|
172
176
|
)
|
|
173
177
|
]
|
|
174
178
|
);
|
|
175
|
-
var
|
|
176
|
-
"
|
|
179
|
+
var subAgents = sqliteTable(
|
|
180
|
+
"sub_agents",
|
|
177
181
|
{
|
|
178
182
|
...graphScoped,
|
|
179
183
|
...uiProperties,
|
|
@@ -195,17 +199,16 @@ var agents = sqliteTable(
|
|
|
195
199
|
}).onDelete("cascade")
|
|
196
200
|
]
|
|
197
201
|
);
|
|
198
|
-
var
|
|
199
|
-
"
|
|
202
|
+
var subAgentRelations = sqliteTable(
|
|
203
|
+
"sub_agent_relations",
|
|
200
204
|
{
|
|
201
205
|
...graphScoped,
|
|
202
|
-
|
|
206
|
+
sourceSubAgentId: text("source_sub_agent_id").notNull(),
|
|
203
207
|
// For internal relationships
|
|
204
|
-
|
|
208
|
+
targetSubAgentId: text("target_sub_agent_id"),
|
|
205
209
|
// For external relationships
|
|
206
|
-
|
|
210
|
+
externalSubAgentId: text("external_sub_agent_id"),
|
|
207
211
|
relationType: text("relation_type"),
|
|
208
|
-
// 'transfer' | 'delegate'
|
|
209
212
|
...timestamps
|
|
210
213
|
},
|
|
211
214
|
(table) => [
|
|
@@ -213,7 +216,7 @@ var agentRelations = sqliteTable(
|
|
|
213
216
|
foreignKey({
|
|
214
217
|
columns: [table.tenantId, table.projectId, table.graphId],
|
|
215
218
|
foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
|
|
216
|
-
name: "
|
|
219
|
+
name: "sub_agent_relations_graph_fk"
|
|
217
220
|
}).onDelete("cascade")
|
|
218
221
|
]
|
|
219
222
|
);
|
|
@@ -249,7 +252,7 @@ var externalAgents = sqliteTable(
|
|
|
249
252
|
var tasks = sqliteTable(
|
|
250
253
|
"tasks",
|
|
251
254
|
{
|
|
252
|
-
...
|
|
255
|
+
...subAgentScoped,
|
|
253
256
|
contextId: text("context_id").notNull(),
|
|
254
257
|
status: text("status").notNull(),
|
|
255
258
|
metadata: blob("metadata", { mode: "json" }).$type(),
|
|
@@ -258,9 +261,9 @@ var tasks = sqliteTable(
|
|
|
258
261
|
(table) => [
|
|
259
262
|
primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
260
263
|
foreignKey({
|
|
261
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
262
|
-
foreignColumns: [
|
|
263
|
-
name: "
|
|
264
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
265
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
266
|
+
name: "tasks_sub_agent_fk"
|
|
264
267
|
}).onDelete("cascade")
|
|
265
268
|
]
|
|
266
269
|
);
|
|
@@ -300,10 +303,10 @@ var dataComponents = sqliteTable(
|
|
|
300
303
|
}).onDelete("cascade")
|
|
301
304
|
]
|
|
302
305
|
);
|
|
303
|
-
var
|
|
304
|
-
"
|
|
306
|
+
var subAgentDataComponents = sqliteTable(
|
|
307
|
+
"sub_agent_data_components",
|
|
305
308
|
{
|
|
306
|
-
...
|
|
309
|
+
...subAgentScoped,
|
|
307
310
|
dataComponentId: text("data_component_id").notNull(),
|
|
308
311
|
createdAt: text("created_at").notNull().default(sql`CURRENT_TIMESTAMP`)
|
|
309
312
|
},
|
|
@@ -311,15 +314,15 @@ var agentDataComponents = sqliteTable(
|
|
|
311
314
|
primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
|
|
312
315
|
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
313
316
|
foreignKey({
|
|
314
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
315
|
-
foreignColumns: [
|
|
316
|
-
name: "
|
|
317
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
318
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
319
|
+
name: "sub_agent_data_components_sub_agent_fk"
|
|
317
320
|
}).onDelete("cascade"),
|
|
318
321
|
// Foreign key constraint to data_components table
|
|
319
322
|
foreignKey({
|
|
320
323
|
columns: [table.tenantId, table.projectId, table.dataComponentId],
|
|
321
324
|
foreignColumns: [dataComponents.tenantId, dataComponents.projectId, dataComponents.id],
|
|
322
|
-
name: "
|
|
325
|
+
name: "sub_agent_data_components_data_component_fk"
|
|
323
326
|
}).onDelete("cascade")
|
|
324
327
|
]
|
|
325
328
|
);
|
|
@@ -340,22 +343,22 @@ var artifactComponents = sqliteTable(
|
|
|
340
343
|
}).onDelete("cascade")
|
|
341
344
|
]
|
|
342
345
|
);
|
|
343
|
-
var
|
|
344
|
-
"
|
|
346
|
+
var subAgentArtifactComponents = sqliteTable(
|
|
347
|
+
"sub_agent_artifact_components",
|
|
345
348
|
{
|
|
346
|
-
...
|
|
349
|
+
...subAgentScoped,
|
|
347
350
|
artifactComponentId: text("artifact_component_id").notNull(),
|
|
348
351
|
createdAt: text("created_at").notNull().default(sql`CURRENT_TIMESTAMP`)
|
|
349
352
|
},
|
|
350
353
|
(table) => [
|
|
351
354
|
primaryKey({
|
|
352
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
355
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId, table.id]
|
|
353
356
|
}),
|
|
354
357
|
// Foreign key constraint to agents table (ensures graph and project exist via cascade)
|
|
355
358
|
foreignKey({
|
|
356
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
357
|
-
foreignColumns: [
|
|
358
|
-
name: "
|
|
359
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
360
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
361
|
+
name: "sub_agent_artifact_components_sub_agent_fk"
|
|
359
362
|
}).onDelete("cascade"),
|
|
360
363
|
// Foreign key constraint to artifact_components table
|
|
361
364
|
foreignKey({
|
|
@@ -365,7 +368,7 @@ var agentArtifactComponents = sqliteTable(
|
|
|
365
368
|
artifactComponents.projectId,
|
|
366
369
|
artifactComponents.id
|
|
367
370
|
],
|
|
368
|
-
name: "
|
|
371
|
+
name: "sub_agent_artifact_components_artifact_component_fk"
|
|
369
372
|
}).onDelete("cascade")
|
|
370
373
|
]
|
|
371
374
|
);
|
|
@@ -375,10 +378,7 @@ var tools = sqliteTable(
|
|
|
375
378
|
...projectScoped,
|
|
376
379
|
name: text("name").notNull(),
|
|
377
380
|
description: text("description"),
|
|
378
|
-
// Tool configuration - supports both MCP and function tools
|
|
379
381
|
config: blob("config", { mode: "json" }).$type().notNull(),
|
|
380
|
-
// For function tools, reference the global functions table
|
|
381
|
-
functionId: text("function_id"),
|
|
382
382
|
credentialReferenceId: text("credential_reference_id"),
|
|
383
383
|
headers: blob("headers", { mode: "json" }).$type(),
|
|
384
384
|
// Image URL for custom tool icon (supports regular URLs and base64 encoded images)
|
|
@@ -394,12 +394,30 @@ var tools = sqliteTable(
|
|
|
394
394
|
columns: [table.tenantId, table.projectId],
|
|
395
395
|
foreignColumns: [projects.tenantId, projects.id],
|
|
396
396
|
name: "tools_project_fk"
|
|
397
|
+
}).onDelete("cascade")
|
|
398
|
+
]
|
|
399
|
+
);
|
|
400
|
+
var functionTools = sqliteTable(
|
|
401
|
+
"function_tools",
|
|
402
|
+
{
|
|
403
|
+
...graphScoped,
|
|
404
|
+
name: text("name").notNull(),
|
|
405
|
+
description: text("description"),
|
|
406
|
+
functionId: text("function_id").notNull(),
|
|
407
|
+
...timestamps
|
|
408
|
+
},
|
|
409
|
+
(table) => [
|
|
410
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
|
|
411
|
+
foreignKey({
|
|
412
|
+
columns: [table.tenantId, table.projectId, table.graphId],
|
|
413
|
+
foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
|
|
414
|
+
name: "function_tools_graph_fk"
|
|
397
415
|
}).onDelete("cascade"),
|
|
398
|
-
// Foreign key constraint to functions table
|
|
416
|
+
// Foreign key constraint to functions table
|
|
399
417
|
foreignKey({
|
|
400
418
|
columns: [table.tenantId, table.projectId, table.functionId],
|
|
401
419
|
foreignColumns: [functions.tenantId, functions.projectId, functions.id],
|
|
402
|
-
name: "
|
|
420
|
+
name: "function_tools_function_fk"
|
|
403
421
|
}).onDelete("cascade")
|
|
404
422
|
]
|
|
405
423
|
);
|
|
@@ -421,10 +439,10 @@ var functions = sqliteTable(
|
|
|
421
439
|
}).onDelete("cascade")
|
|
422
440
|
]
|
|
423
441
|
);
|
|
424
|
-
var
|
|
425
|
-
"
|
|
442
|
+
var subAgentToolRelations = sqliteTable(
|
|
443
|
+
"sub_agent_tool_relations",
|
|
426
444
|
{
|
|
427
|
-
...
|
|
445
|
+
...subAgentScoped,
|
|
428
446
|
toolId: text("tool_id").notNull(),
|
|
429
447
|
selectedTools: blob("selected_tools", { mode: "json" }).$type(),
|
|
430
448
|
headers: blob("headers", { mode: "json" }).$type(),
|
|
@@ -434,15 +452,43 @@ var agentToolRelations = sqliteTable(
|
|
|
434
452
|
primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
|
|
435
453
|
// Foreign key constraint to agents table (which includes project and graph scope)
|
|
436
454
|
foreignKey({
|
|
437
|
-
columns: [table.tenantId, table.projectId, table.graphId, table.
|
|
438
|
-
foreignColumns: [
|
|
439
|
-
name: "
|
|
455
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
456
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
457
|
+
name: "sub_agent_tool_relations_agent_fk"
|
|
440
458
|
}).onDelete("cascade"),
|
|
441
|
-
// Foreign key constraint to tools table
|
|
459
|
+
// Foreign key constraint to tools table (MCP tools)
|
|
442
460
|
foreignKey({
|
|
443
461
|
columns: [table.tenantId, table.projectId, table.toolId],
|
|
444
462
|
foreignColumns: [tools.tenantId, tools.projectId, tools.id],
|
|
445
|
-
name: "
|
|
463
|
+
name: "sub_agent_tool_relations_tool_fk"
|
|
464
|
+
}).onDelete("cascade")
|
|
465
|
+
]
|
|
466
|
+
);
|
|
467
|
+
var agentFunctionToolRelations = sqliteTable(
|
|
468
|
+
"agent_function_tool_relations",
|
|
469
|
+
{
|
|
470
|
+
...subAgentScoped,
|
|
471
|
+
functionToolId: text("function_tool_id").notNull(),
|
|
472
|
+
...timestamps
|
|
473
|
+
},
|
|
474
|
+
(table) => [
|
|
475
|
+
primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
|
|
476
|
+
// Foreign key constraint to agents table
|
|
477
|
+
foreignKey({
|
|
478
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
|
|
479
|
+
foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
|
|
480
|
+
name: "agent_function_tool_relations_agent_fk"
|
|
481
|
+
}).onDelete("cascade"),
|
|
482
|
+
// Foreign key constraint to functionTools table
|
|
483
|
+
foreignKey({
|
|
484
|
+
columns: [table.tenantId, table.projectId, table.graphId, table.functionToolId],
|
|
485
|
+
foreignColumns: [
|
|
486
|
+
functionTools.tenantId,
|
|
487
|
+
functionTools.projectId,
|
|
488
|
+
functionTools.graphId,
|
|
489
|
+
functionTools.id
|
|
490
|
+
],
|
|
491
|
+
name: "agent_function_tool_relations_function_tool_fk"
|
|
446
492
|
}).onDelete("cascade")
|
|
447
493
|
]
|
|
448
494
|
);
|
|
@@ -451,7 +497,7 @@ var conversations = sqliteTable(
|
|
|
451
497
|
{
|
|
452
498
|
...projectScoped,
|
|
453
499
|
userId: text("user_id"),
|
|
454
|
-
|
|
500
|
+
activeSubAgentId: text("active_sub_agent_id").notNull(),
|
|
455
501
|
title: text("title"),
|
|
456
502
|
lastContextResolution: text("last_context_resolution"),
|
|
457
503
|
metadata: blob("metadata", { mode: "json" }).$type(),
|
|
@@ -475,15 +521,15 @@ var messages = sqliteTable(
|
|
|
475
521
|
role: text("role").notNull(),
|
|
476
522
|
// 'user' | 'agent' | 'system'
|
|
477
523
|
// Agent sender/recipient tracking (nullable - only populated when relevant)
|
|
478
|
-
|
|
524
|
+
fromSubAgentId: text("from_sub_agent_id"),
|
|
479
525
|
// Populated when message is from an agent
|
|
480
|
-
|
|
526
|
+
toSubAgentId: text("to_sub_agent_id"),
|
|
481
527
|
// Populated when message is directed to a specific agent (e.g., transfers/delegations)
|
|
482
528
|
// External agent sender tracking
|
|
483
|
-
fromExternalAgentId: text("
|
|
529
|
+
fromExternalAgentId: text("from_external_sub_agent_id"),
|
|
484
530
|
// Populated when message is directed from an external agent
|
|
485
531
|
// External agent recipient tracking
|
|
486
|
-
toExternalAgentId: text("
|
|
532
|
+
toExternalAgentId: text("to_external_sub_agent_id"),
|
|
487
533
|
// Populated when message is directed to an external agent
|
|
488
534
|
// Message content stored as JSON to support both formats
|
|
489
535
|
content: blob("content", { mode: "json" }).$type().notNull(),
|
|
@@ -492,8 +538,6 @@ var messages = sqliteTable(
|
|
|
492
538
|
// 'user-facing' | 'internal' | 'system' | 'external'
|
|
493
539
|
messageType: text("message_type").notNull().default("chat"),
|
|
494
540
|
// 'chat' | 'a2a-request' | 'a2a-response' | 'task-update' | 'tool-call'
|
|
495
|
-
// Legacy agent association (consider deprecating in favor of fromAgentId/toAgentId)
|
|
496
|
-
agentId: text("agent_id"),
|
|
497
541
|
taskId: text("task_id"),
|
|
498
542
|
parentMessageId: text("parent_message_id"),
|
|
499
543
|
// Remove self-reference constraint here
|
|
@@ -620,10 +664,9 @@ var tasksRelations = relations(tasks, ({ one, many }) => ({
|
|
|
620
664
|
childRelations: many(taskRelations, {
|
|
621
665
|
relationName: "parentTask"
|
|
622
666
|
}),
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
references: [agents.id]
|
|
667
|
+
subAgent: one(subAgents, {
|
|
668
|
+
fields: [tasks.subAgentId],
|
|
669
|
+
references: [subAgents.id]
|
|
627
670
|
}),
|
|
628
671
|
// A task can have many messages associated with it
|
|
629
672
|
messages: many(messages),
|
|
@@ -631,9 +674,10 @@ var tasksRelations = relations(tasks, ({ one, many }) => ({
|
|
|
631
674
|
ledgerArtifacts: many(ledgerArtifacts)
|
|
632
675
|
}));
|
|
633
676
|
var projectsRelations = relations(projects, ({ many }) => ({
|
|
634
|
-
|
|
677
|
+
subAgents: many(subAgents),
|
|
635
678
|
agentGraphs: many(agentGraph),
|
|
636
679
|
tools: many(tools),
|
|
680
|
+
functions: many(functions),
|
|
637
681
|
contextConfigs: many(contextConfigs),
|
|
638
682
|
externalAgents: many(externalAgents),
|
|
639
683
|
conversations: many(conversations),
|
|
@@ -669,17 +713,17 @@ var contextCacheRelations = relations(contextCache, ({ one }) => ({
|
|
|
669
713
|
references: [contextConfigs.id]
|
|
670
714
|
})
|
|
671
715
|
}));
|
|
672
|
-
var
|
|
716
|
+
var subAgentsRelations = relations(subAgents, ({ many, one }) => ({
|
|
673
717
|
project: one(projects, {
|
|
674
|
-
fields: [
|
|
718
|
+
fields: [subAgents.tenantId, subAgents.projectId],
|
|
675
719
|
references: [projects.tenantId, projects.id]
|
|
676
720
|
}),
|
|
677
721
|
tasks: many(tasks),
|
|
678
722
|
defaultForGraphs: many(agentGraph),
|
|
679
|
-
sourceRelations: many(
|
|
723
|
+
sourceRelations: many(subAgentRelations, {
|
|
680
724
|
relationName: "sourceRelations"
|
|
681
725
|
}),
|
|
682
|
-
targetRelations: many(
|
|
726
|
+
targetRelations: many(subAgentRelations, {
|
|
683
727
|
relationName: "targetRelations"
|
|
684
728
|
}),
|
|
685
729
|
sentMessages: many(messages, {
|
|
@@ -691,30 +735,32 @@ var agentsRelations = relations(agents, ({ many, one }) => ({
|
|
|
691
735
|
associatedMessages: many(messages, {
|
|
692
736
|
relationName: "associatedAgent"
|
|
693
737
|
}),
|
|
694
|
-
toolRelations: many(
|
|
695
|
-
|
|
696
|
-
|
|
738
|
+
toolRelations: many(subAgentToolRelations),
|
|
739
|
+
functionToolRelations: many(agentFunctionToolRelations),
|
|
740
|
+
dataComponentRelations: many(subAgentDataComponents),
|
|
741
|
+
artifactComponentRelations: many(subAgentArtifactComponents)
|
|
697
742
|
}));
|
|
698
|
-
var agentGraphRelations = relations(agentGraph, ({ one }) => ({
|
|
743
|
+
var agentGraphRelations = relations(agentGraph, ({ one, many }) => ({
|
|
699
744
|
project: one(projects, {
|
|
700
745
|
fields: [agentGraph.tenantId, agentGraph.projectId],
|
|
701
746
|
references: [projects.tenantId, projects.id]
|
|
702
747
|
}),
|
|
703
|
-
|
|
704
|
-
fields: [agentGraph.
|
|
705
|
-
references: [
|
|
748
|
+
defaultSubAgent: one(subAgents, {
|
|
749
|
+
fields: [agentGraph.defaultSubAgentId],
|
|
750
|
+
references: [subAgents.id]
|
|
706
751
|
}),
|
|
707
752
|
contextConfig: one(contextConfigs, {
|
|
708
753
|
fields: [agentGraph.contextConfigId],
|
|
709
754
|
references: [contextConfigs.id]
|
|
710
|
-
})
|
|
755
|
+
}),
|
|
756
|
+
functionTools: many(functionTools)
|
|
711
757
|
}));
|
|
712
758
|
var externalAgentsRelations = relations(externalAgents, ({ one, many }) => ({
|
|
713
759
|
project: one(projects, {
|
|
714
760
|
fields: [externalAgents.tenantId, externalAgents.projectId],
|
|
715
761
|
references: [projects.tenantId, projects.id]
|
|
716
762
|
}),
|
|
717
|
-
|
|
763
|
+
subAgentRelations: many(subAgentRelations),
|
|
718
764
|
credentialReference: one(credentialReferences, {
|
|
719
765
|
fields: [externalAgents.credentialReferenceId],
|
|
720
766
|
references: [credentialReferences.id]
|
|
@@ -730,13 +776,13 @@ var apiKeysRelations = relations(apiKeys, ({ one }) => ({
|
|
|
730
776
|
references: [agentGraph.id]
|
|
731
777
|
})
|
|
732
778
|
}));
|
|
733
|
-
var agentToolRelationsRelations = relations(
|
|
734
|
-
|
|
735
|
-
fields: [
|
|
736
|
-
references: [
|
|
779
|
+
var agentToolRelationsRelations = relations(subAgentToolRelations, ({ one }) => ({
|
|
780
|
+
subAgent: one(subAgents, {
|
|
781
|
+
fields: [subAgentToolRelations.subAgentId],
|
|
782
|
+
references: [subAgents.id]
|
|
737
783
|
}),
|
|
738
784
|
tool: one(tools, {
|
|
739
|
-
fields: [
|
|
785
|
+
fields: [subAgentToolRelations.toolId],
|
|
740
786
|
references: [tools.id]
|
|
741
787
|
})
|
|
742
788
|
}));
|
|
@@ -748,14 +794,10 @@ var toolsRelations = relations(tools, ({ one, many }) => ({
|
|
|
748
794
|
fields: [tools.tenantId, tools.projectId],
|
|
749
795
|
references: [projects.tenantId, projects.id]
|
|
750
796
|
}),
|
|
751
|
-
|
|
797
|
+
subAgentRelations: many(subAgentToolRelations),
|
|
752
798
|
credentialReference: one(credentialReferences, {
|
|
753
799
|
fields: [tools.credentialReferenceId],
|
|
754
800
|
references: [credentialReferences.id]
|
|
755
|
-
}),
|
|
756
|
-
function: one(functions, {
|
|
757
|
-
fields: [tools.functionId],
|
|
758
|
-
references: [functions.id]
|
|
759
801
|
})
|
|
760
802
|
}));
|
|
761
803
|
var conversationsRelations = relations(conversations, ({ one, many }) => ({
|
|
@@ -764,9 +806,9 @@ var conversationsRelations = relations(conversations, ({ one, many }) => ({
|
|
|
764
806
|
references: [projects.tenantId, projects.id]
|
|
765
807
|
}),
|
|
766
808
|
messages: many(messages),
|
|
767
|
-
|
|
768
|
-
fields: [conversations.
|
|
769
|
-
references: [
|
|
809
|
+
activeSubAgent: one(subAgents, {
|
|
810
|
+
fields: [conversations.activeSubAgentId],
|
|
811
|
+
references: [subAgents.id]
|
|
770
812
|
})
|
|
771
813
|
}));
|
|
772
814
|
var messagesRelations = relations(messages, ({ one, many }) => ({
|
|
@@ -774,20 +816,14 @@ var messagesRelations = relations(messages, ({ one, many }) => ({
|
|
|
774
816
|
fields: [messages.conversationId],
|
|
775
817
|
references: [conversations.id]
|
|
776
818
|
}),
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
references: [agents.id],
|
|
781
|
-
relationName: "associatedAgent"
|
|
782
|
-
}),
|
|
783
|
-
fromAgent: one(agents, {
|
|
784
|
-
fields: [messages.fromAgentId],
|
|
785
|
-
references: [agents.id],
|
|
819
|
+
fromSubAgent: one(subAgents, {
|
|
820
|
+
fields: [messages.fromSubAgentId],
|
|
821
|
+
references: [subAgents.id],
|
|
786
822
|
relationName: "sentMessages"
|
|
787
823
|
}),
|
|
788
|
-
|
|
789
|
-
fields: [messages.
|
|
790
|
-
references: [
|
|
824
|
+
toSubAgent: one(subAgents, {
|
|
825
|
+
fields: [messages.toSubAgentId],
|
|
826
|
+
references: [subAgents.id],
|
|
791
827
|
relationName: "receivedMessages"
|
|
792
828
|
}),
|
|
793
829
|
fromExternalAgent: one(externalAgents, {
|
|
@@ -813,33 +849,40 @@ var messagesRelations = relations(messages, ({ one, many }) => ({
|
|
|
813
849
|
relationName: "parentChild"
|
|
814
850
|
})
|
|
815
851
|
}));
|
|
816
|
-
var artifactComponentsRelations = relations(artifactComponents, ({ many }) => ({
|
|
817
|
-
|
|
852
|
+
var artifactComponentsRelations = relations(artifactComponents, ({ many, one }) => ({
|
|
853
|
+
project: one(projects, {
|
|
854
|
+
fields: [artifactComponents.tenantId, artifactComponents.projectId],
|
|
855
|
+
references: [projects.tenantId, projects.id]
|
|
856
|
+
}),
|
|
857
|
+
subAgentRelations: many(subAgentArtifactComponents)
|
|
818
858
|
}));
|
|
819
|
-
var
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
859
|
+
var subAgentArtifactComponentsRelations = relations(
|
|
860
|
+
subAgentArtifactComponents,
|
|
861
|
+
({ one }) => ({
|
|
862
|
+
subAgent: one(subAgents, {
|
|
863
|
+
fields: [subAgentArtifactComponents.subAgentId],
|
|
864
|
+
references: [subAgents.id]
|
|
865
|
+
}),
|
|
866
|
+
artifactComponent: one(artifactComponents, {
|
|
867
|
+
fields: [subAgentArtifactComponents.artifactComponentId],
|
|
868
|
+
references: [artifactComponents.id]
|
|
869
|
+
})
|
|
827
870
|
})
|
|
828
|
-
|
|
871
|
+
);
|
|
829
872
|
var dataComponentsRelations = relations(dataComponents, ({ many, one }) => ({
|
|
830
873
|
project: one(projects, {
|
|
831
874
|
fields: [dataComponents.tenantId, dataComponents.projectId],
|
|
832
875
|
references: [projects.tenantId, projects.id]
|
|
833
876
|
}),
|
|
834
|
-
|
|
877
|
+
subAgentRelations: many(subAgentDataComponents)
|
|
835
878
|
}));
|
|
836
|
-
var
|
|
837
|
-
|
|
838
|
-
fields: [
|
|
839
|
-
references: [
|
|
879
|
+
var subAgentDataComponentsRelations = relations(subAgentDataComponents, ({ one }) => ({
|
|
880
|
+
subAgent: one(subAgents, {
|
|
881
|
+
fields: [subAgentDataComponents.subAgentId],
|
|
882
|
+
references: [subAgents.id]
|
|
840
883
|
}),
|
|
841
884
|
dataComponent: one(dataComponents, {
|
|
842
|
-
fields: [
|
|
885
|
+
fields: [subAgentDataComponents.dataComponentId],
|
|
843
886
|
references: [dataComponents.id]
|
|
844
887
|
})
|
|
845
888
|
}));
|
|
@@ -854,27 +897,55 @@ var ledgerArtifactsRelations = relations(ledgerArtifacts, ({ one }) => ({
|
|
|
854
897
|
})
|
|
855
898
|
}));
|
|
856
899
|
var functionsRelations = relations(functions, ({ many }) => ({
|
|
857
|
-
|
|
900
|
+
functionTools: many(functionTools)
|
|
858
901
|
}));
|
|
859
|
-
var
|
|
902
|
+
var subAgentRelationsRelations = relations(subAgentRelations, ({ one }) => ({
|
|
860
903
|
graph: one(agentGraph, {
|
|
861
|
-
fields: [
|
|
904
|
+
fields: [subAgentRelations.graphId],
|
|
862
905
|
references: [agentGraph.id]
|
|
863
906
|
}),
|
|
864
|
-
|
|
865
|
-
fields: [
|
|
866
|
-
references: [
|
|
907
|
+
sourceSubAgent: one(subAgents, {
|
|
908
|
+
fields: [subAgentRelations.sourceSubAgentId],
|
|
909
|
+
references: [subAgents.id],
|
|
867
910
|
relationName: "sourceRelations"
|
|
868
911
|
}),
|
|
869
|
-
|
|
870
|
-
fields: [
|
|
871
|
-
references: [
|
|
912
|
+
targetSubAgent: one(subAgents, {
|
|
913
|
+
fields: [subAgentRelations.targetSubAgentId],
|
|
914
|
+
references: [subAgents.id],
|
|
872
915
|
relationName: "targetRelations"
|
|
873
916
|
}),
|
|
874
917
|
externalAgent: one(externalAgents, {
|
|
875
|
-
fields: [
|
|
918
|
+
fields: [subAgentRelations.externalSubAgentId],
|
|
876
919
|
references: [externalAgents.id]
|
|
877
920
|
})
|
|
878
921
|
}));
|
|
922
|
+
var functionToolsRelations = relations(functionTools, ({ one, many }) => ({
|
|
923
|
+
project: one(projects, {
|
|
924
|
+
fields: [functionTools.tenantId, functionTools.projectId],
|
|
925
|
+
references: [projects.tenantId, projects.id]
|
|
926
|
+
}),
|
|
927
|
+
graph: one(agentGraph, {
|
|
928
|
+
fields: [functionTools.tenantId, functionTools.projectId, functionTools.graphId],
|
|
929
|
+
references: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id]
|
|
930
|
+
}),
|
|
931
|
+
function: one(functions, {
|
|
932
|
+
fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
|
|
933
|
+
references: [functions.tenantId, functions.projectId, functions.id]
|
|
934
|
+
}),
|
|
935
|
+
agentRelations: many(agentFunctionToolRelations)
|
|
936
|
+
}));
|
|
937
|
+
var agentFunctionToolRelationsRelations = relations(
|
|
938
|
+
agentFunctionToolRelations,
|
|
939
|
+
({ one }) => ({
|
|
940
|
+
agent: one(subAgents, {
|
|
941
|
+
fields: [agentFunctionToolRelations.subAgentId],
|
|
942
|
+
references: [subAgents.id]
|
|
943
|
+
}),
|
|
944
|
+
functionTool: one(functionTools, {
|
|
945
|
+
fields: [agentFunctionToolRelations.functionToolId],
|
|
946
|
+
references: [functionTools.id]
|
|
947
|
+
})
|
|
948
|
+
})
|
|
949
|
+
);
|
|
879
950
|
|
|
880
|
-
export {
|
|
951
|
+
export { agentFunctionToolRelations, agentFunctionToolRelationsRelations, agentGraph, agentGraphRelations, agentToolRelationsRelations, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, schema_exports, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentRelations, subAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations };
|